From 7bea6971147b1131bb7e5acc66d0b5652868260d Mon Sep 17 00:00:00 2001 From: def Date: Tue, 8 Sep 2020 11:42:52 +0200 Subject: [PATCH] Add some keyboard shortcuts for demos --- src/game/client/components/menus_demo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 91a88ae7e..da758cac9 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -458,7 +458,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView) // close button ButtonBar.VSplitRight(ButtonbarHeight*3, &ButtonBar, &Button); static int s_ExitButton = 0; - if(DoButton_DemoPlayer(&s_ExitButton, Localize("Close"), 0, &Button)) + if(DoButton_DemoPlayer(&s_ExitButton, Localize("Close"), 0, &Button) || Input()->KeyPress(KEY_C)) { Client()->Disconnect(); DemolistOnUpdate(false); @@ -1245,7 +1245,7 @@ void CMenus::RenderDemoList(CUIRect MainView) } static int s_PlayButton = 0; - if(DoButton_Menu(&s_PlayButton, m_DemolistSelectedIsDir?Localize("Open"):Localize("Play"), 0, &PlayRect) || Activated) + if(DoButton_Menu(&s_PlayButton, m_DemolistSelectedIsDir?Localize("Open"):Localize("Play"), 0, &PlayRect) || Activated || Input()->KeyPress(KEY_P)) { if(m_DemolistSelectedIndex >= 0) { @@ -1282,7 +1282,7 @@ void CMenus::RenderDemoList(CUIRect MainView) if(!m_DemolistSelectedIsDir) { static int s_DeleteButton = 0; - if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &DeleteRect) || m_DeletePressed) + if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &DeleteRect) || m_DeletePressed || Input()->KeyPress(KEY_D)) { if(m_DemolistSelectedIndex >= 0) { @@ -1306,7 +1306,7 @@ void CMenus::RenderDemoList(CUIRect MainView) #if defined(CONF_VIDEORECORDER) static int s_RenderButton = 0; - if(DoButton_Menu(&s_RenderButton, Localize("Render"), 0, &RenderRect)) + if(DoButton_Menu(&s_RenderButton, Localize("Render"), 0, &RenderRect) || Input()->KeyPress(KEY_R)) { if(m_DemolistSelectedIndex >= 0) {