Merge pull request #7373 from Robyt3/Client-Quitting-State-Fixes

Fix incorrect menu behavior when quitting/restarting
This commit is contained in:
Dennis Felsing 2023-10-26 22:41:40 +00:00 committed by GitHub
commit c325f830e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 15 deletions

View file

@ -323,7 +323,7 @@ bool CMenuBackground::Render()
if(!m_Loaded) if(!m_Loaded)
return false; return false;
if(Client()->State() >= IClient::STATE_ONLINE) if(Client()->State() == IClient::STATE_ONLINE || Client()->State() == IClient::STATE_DEMOPLAYBACK)
return false; return false;
m_Camera.m_Zoom = 0.7f; m_Camera.m_Zoom = 0.7f;

View file

@ -978,22 +978,11 @@ int CMenus::Render()
else if(s_Frame == 1) else if(s_Frame == 1)
{ {
UpdateMusicState(); UpdateMusicState();
s_Frame++;
RefreshBrowserTab(g_Config.m_UiPage); RefreshBrowserTab(g_Config.m_UiPage);
if(g_Config.m_UiPage == PAGE_INTERNET) s_Frame++;
ServerBrowser()->Refresh(IServerBrowser::TYPE_INTERNET);
else if(g_Config.m_UiPage == PAGE_LAN)
ServerBrowser()->Refresh(IServerBrowser::TYPE_LAN);
else if(g_Config.m_UiPage == PAGE_FAVORITES)
ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES);
else if(g_Config.m_UiPage == PAGE_DDNET)
ServerBrowser()->Refresh(IServerBrowser::TYPE_DDNET);
else if(g_Config.m_UiPage == PAGE_KOG)
ServerBrowser()->Refresh(IServerBrowser::TYPE_KOG);
} }
if(Client()->State() >= IClient::STATE_ONLINE) if(Client()->State() == IClient::STATE_ONLINE || Client()->State() == IClient::STATE_DEMOPLAYBACK)
{ {
ms_ColorTabbarInactive = ms_ColorTabbarInactiveIngame; ms_ColorTabbarInactive = ms_ColorTabbarInactiveIngame;
ms_ColorTabbarActive = ms_ColorTabbarActiveIngame; ms_ColorTabbarActive = ms_ColorTabbarActiveIngame;

View file

@ -389,7 +389,7 @@ void CMenus::RefreshSkins()
RenderLoading(Localize("Loading skin files"), "", 0, false); RenderLoading(Localize("Loading skin files"), "", 0, false);
} }
}); });
if(Client()->State() >= IClient::STATE_ONLINE) if(Client()->State() == IClient::STATE_ONLINE || Client()->State() == IClient::STATE_DEMOPLAYBACK)
{ {
m_pClient->RefindSkins(); m_pClient->RefindSkins();
} }