mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #3841
3841: Add better support for compose binds in demo menu r=def- a=ChillerDragon I assume shift is a common compose bind. So users might have bound shift+scroll or shift+arrowkeys to something else and do not want to change the playback speed while triggering that compose bind. I have to admit this is something I personally need and I am not sure what the demand for it is. But for example my zoom bind is shift+mousewheelup and shift+mousewheeldown and I change that a lot while watching demos but it keeps affecting the playback speed. Maybe someone else has a compose bind using the alt key I do not know. But this solves my issue :) ## Checklist - [X] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
This commit is contained in:
commit
bf1fa15380
|
@ -169,6 +169,8 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
|
|||
if(m_pClient->m_pGameConsole->IsClosed() && m_DemoPlayerState == DEMOPLAYER_NONE && g_Config.m_ClDemoKeyboardShortcuts)
|
||||
{
|
||||
// increase/decrease speed
|
||||
if(!Input()->KeyIsPressed(KEY_LSHIFT) && !Input()->KeyIsPressed(KEY_RSHIFT))
|
||||
{
|
||||
if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP))
|
||||
{
|
||||
DemoPlayer()->SetSpeedIndex(+1);
|
||||
|
@ -179,6 +181,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
|
|||
DemoPlayer()->SetSpeedIndex(-1);
|
||||
LastSpeedChange = time_get();
|
||||
}
|
||||
}
|
||||
|
||||
// pause/unpause
|
||||
if(Input()->KeyPress(KEY_SPACE) || Input()->KeyPress(KEY_RETURN) || Input()->KeyPress(KEY_K))
|
||||
|
|
Loading…
Reference in a new issue