mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add some keyboard shortcuts for demos
This commit is contained in:
parent
757998e7d0
commit
7bea697114
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue