mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 14:08:19 +00:00
Merge pull request #8519 from Robyt3/Client-Browser-Refresh-UiPage-Fix
Fix browser not refreshing if `ui_page` is changed in start menu, refresh LAN tab after starting/stopping local server
This commit is contained in:
commit
e29409de64
|
@ -2354,9 +2354,15 @@ void CMenus::SetMenuPage(int NewPage)
|
|||
if(NewPage >= PAGE_INTERNET && NewPage <= PAGE_FAVORITE_COMMUNITY_5)
|
||||
{
|
||||
g_Config.m_UiPage = NewPage;
|
||||
if(!m_ShowStart && OldPage != NewPage)
|
||||
bool ForceRefresh = false;
|
||||
if(m_ForceRefreshLanPage)
|
||||
{
|
||||
RefreshBrowserTab(false);
|
||||
ForceRefresh = NewPage == PAGE_LAN;
|
||||
m_ForceRefreshLanPage = false;
|
||||
}
|
||||
if(OldPage != NewPage || ForceRefresh)
|
||||
{
|
||||
RefreshBrowserTab(ForceRefresh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,6 +170,7 @@ protected:
|
|||
|
||||
bool m_JoinTutorial = false;
|
||||
bool m_CreateDefaultFavoriteCommunities = false;
|
||||
bool m_ForceRefreshLanPage = false;
|
||||
|
||||
char m_aNextServer[256];
|
||||
|
||||
|
|
|
@ -155,6 +155,7 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
if(str_find(aBuf, "/") == 0 || fs_is_file(aBuf))
|
||||
{
|
||||
m_ServerProcess.m_Process = shell_execute(aBuf, EShellExecuteWindowState::BACKGROUND);
|
||||
m_ForceRefreshLanPage = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -285,8 +286,8 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
|
||||
if(NewPage != -1)
|
||||
{
|
||||
m_MenuPage = NewPage;
|
||||
m_ShowStart = false;
|
||||
SetMenuPage(NewPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,6 +298,7 @@ void CMenus::KillServer()
|
|||
if(kill_process(m_ServerProcess.m_Process))
|
||||
{
|
||||
m_ServerProcess.m_Process = INVALID_PROCESS;
|
||||
m_ForceRefreshLanPage = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue