Merge pull request #7222 from furo321/update-server-browser

Update server browser when adding friends from ingame.
This commit is contained in:
Robert Müller 2023-09-20 19:49:00 +00:00 committed by GitHub
commit b7cbbb48be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -1662,10 +1662,11 @@ CTeeRenderInfo CMenus::GetTeeRenderInfo(vec2 Size, const char *pSkinName, bool C
void CMenus::ConchainFriendlistUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
{
pfnCallback(pResult, pCallbackUserData);
if(pResult->NumArguments() >= 1 && ((CMenus *)pUserData)->Client()->State() == IClient::STATE_OFFLINE)
CMenus *pThis = ((CMenus *)pUserData);
if(pResult->NumArguments() >= 1 && (pThis->Client()->State() == IClient::STATE_OFFLINE || pThis->Client()->State() == IClient::STATE_ONLINE))
{
((CMenus *)pUserData)->FriendlistOnUpdate();
((CMenus *)pUserData)->Client()->ServerBrowserUpdate();
pThis->FriendlistOnUpdate();
pThis->Client()->ServerBrowserUpdate();
}
}

View file

@ -349,6 +349,8 @@ void CMenus::RenderPlayers(CUIRect MainView)
m_pClient->Friends()->RemoveFriend(CurrentClient.m_aName, CurrentClient.m_aClan);
else
m_pClient->Friends()->AddFriend(CurrentClient.m_aName, CurrentClient.m_aClan);
m_pClient->Client()->ServerBrowserUpdate();
}
}