From ccc470ecc9fa8cdc6155a80ff9340bc540fefbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 19 Nov 2023 15:31:56 +0100 Subject: [PATCH] Fix server browser update on community filter change via console Also update server browser filtering/sorting when changing the community/country/type filter config variables with the console. Clean the filter config variables when they are changed instead of only when the community filter is rendered. --- src/game/client/components/menus_browser.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 5f132788f..171ef66d5 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -688,8 +688,6 @@ void CMenus::RenderServerbrowserFilters(CUIRect View) // community filter if((g_Config.m_UiPage == PAGE_INTERNET || g_Config.m_UiPage == PAGE_FAVORITES) && !ServerBrowser()->Communities().empty()) { - ServerBrowser()->CleanFilters(); - CUIRect Row; View.HSplitTop(6.0f, nullptr, &View); View.HSplitTop(19.0f, &Row, &View); @@ -1742,8 +1740,13 @@ void CMenus::ConchainFavoritesUpdate(IConsole::IResult *pResult, void *pUserData void CMenus::ConchainCommunitiesUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) { pfnCallback(pResult, pCallbackUserData); + CMenus *pThis = static_cast(pUserData); if(pResult->NumArguments() >= 1 && (g_Config.m_UiPage == PAGE_INTERNET || g_Config.m_UiPage == PAGE_FAVORITES)) - ((CMenus *)pUserData)->UpdateCommunityCache(true); + { + pThis->ServerBrowser()->CleanFilters(); + pThis->UpdateCommunityCache(true); + pThis->Client()->ServerBrowserUpdate(); + } } void CMenus::UpdateCommunityCache(bool Force)