mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #7222 from furo321/update-server-browser
Update server browser when adding friends from ingame.
This commit is contained in:
commit
b7cbbb48be
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue