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.
This commit is contained in:
Robert Müller 2023-11-19 15:31:56 +01:00
parent aba67f46ee
commit ccc470ecc9

View file

@ -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<CMenus *>(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)