mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add better support for compose binds in demo menu
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.
This commit is contained in:
parent
baf10236d0
commit
18e69b4df1
|
@ -169,15 +169,18 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
|
|||
if(m_pClient->m_pGameConsole->IsClosed() && m_DemoPlayerState == DEMOPLAYER_NONE && g_Config.m_ClDemoKeyboardShortcuts)
|
||||
{
|
||||
// increase/decrease speed
|
||||
if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP))
|
||||
if(!Input()->KeyIsPressed(KEY_LSHIFT) && !Input()->KeyIsPressed(KEY_RSHIFT))
|
||||
{
|
||||
DemoPlayer()->SetSpeedIndex(+1);
|
||||
LastSpeedChange = time_get();
|
||||
}
|
||||
else if(Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN) || Input()->KeyPress(KEY_DOWN))
|
||||
{
|
||||
DemoPlayer()->SetSpeedIndex(-1);
|
||||
LastSpeedChange = time_get();
|
||||
if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP))
|
||||
{
|
||||
DemoPlayer()->SetSpeedIndex(+1);
|
||||
LastSpeedChange = time_get();
|
||||
}
|
||||
else if(Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN) || Input()->KeyPress(KEY_DOWN))
|
||||
{
|
||||
DemoPlayer()->SetSpeedIndex(-1);
|
||||
LastSpeedChange = time_get();
|
||||
}
|
||||
}
|
||||
|
||||
// pause/unpause
|
||||
|
|
Loading…
Reference in a new issue