Merge pull request #8819 from Anime-pdf/master

speedup demo with mouse scroll only if menu is active
This commit is contained in:
Dennis Felsing 2024-08-27 07:15:38 +00:00 committed by GitHub
commit b30b493ab8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -175,12 +175,12 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
// increase/decrease speed
if(!Input()->ModifierIsPressed() && !Input()->ShiftIsPressed() && !Input()->AltIsPressed())
{
if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP))
if(Input()->KeyPress(KEY_UP) || (m_MenuActive && Input()->KeyPress(KEY_MOUSE_WHEEL_UP)))
{
DemoPlayer()->AdjustSpeedIndex(+1);
UpdateLastSpeedChange();
}
else if(Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN) || Input()->KeyPress(KEY_DOWN))
else if(Input()->KeyPress(KEY_DOWN) || (m_MenuActive && Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN)))
{
DemoPlayer()->AdjustSpeedIndex(-1);
UpdateLastSpeedChange();