Fix demo player hotkeys not working when menu is inactive

The demo player needs to be rendered also when the menu is inactive, to handle the hotkeys for controlling the demo player and to render the play/pause and speed indicators.

Closes #8208.
This commit is contained in:
Robert Müller 2024-04-14 11:23:59 +02:00
parent 1b77cbc821
commit 717cbef375

View file

@ -2176,10 +2176,15 @@ void CMenus::OnRender()
if(!IsActive())
{
if(Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE))
{
SetActive(true);
Ui()->FinishCheck();
Ui()->ClearHotkeys();
return;
}
else if(Client()->State() != IClient::STATE_DEMOPLAYBACK)
{
Ui()->FinishCheck();
Ui()->ClearHotkeys();
return;
}
}
UpdateColors();
@ -2187,7 +2192,11 @@ void CMenus::OnRender()
Ui()->Update();
Render();
RenderTools()->RenderCursor(Ui()->MousePos(), 24.0f);
if(IsActive())
{
RenderTools()->RenderCursor(Ui()->MousePos(), 24.0f);
}
// render debug information
if(g_Config.m_Debug)