Merge pull request #8211 from Robyt3/Menus-Demo-Hotkeys-Fix

Fix demo player hotkeys not working when menu is inactive, fix duplicated rendering of popup menus in demo player
This commit is contained in:
Dennis Felsing 2024-04-14 10:06:49 +00:00 committed by GitHub
commit c878cc70f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

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)

View file

@ -750,8 +750,6 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
{
RenderDemoPlayerSliceSavePopup(MainView);
}
Ui()->RenderPopupMenus();
}
void CMenus::RenderDemoPlayerSliceSavePopup(CUIRect MainView)