improved loading progression in the server browser

This commit is contained in:
oy 2010-11-17 12:43:24 +01:00
parent a7f37446b6
commit f1ce0d1949
4 changed files with 10 additions and 1 deletions

View file

@ -707,6 +707,10 @@ void CServerBrowser::RemoveFavorite(const NETADDR &Addr)
}
}
bool CServerBrowser::IsRefreshing() const
{
return m_pFirstReqServer != 0;
}
bool CServerBrowser::IsRefreshingMasters() const
{

View file

@ -29,6 +29,7 @@ public:
// interface functions
void Refresh(int Type);
bool IsRefreshing() const;
bool IsRefreshingMasters() const;
int LoadingProgression() const;

View file

@ -78,6 +78,7 @@ public:
};
virtual void Refresh(int Type) = 0;
virtual bool IsRefreshing() const = 0;
virtual bool IsRefreshingMasters() const = 0;
virtual int LoadingProgression() const = 0;

View file

@ -395,7 +395,10 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
// render status
char aBuf[128];
str_format(aBuf, sizeof(aBuf), Localize("%d of %d servers, %d players (%d%% loaded)"), ServerBrowser()->NumSortedServers(), ServerBrowser()->NumServers(), NumPlayers, ServerBrowser()->LoadingProgression());
if(ServerBrowser()->IsRefreshing())
str_format(aBuf, sizeof(aBuf), Localize("%d%% loaded"), ServerBrowser()->LoadingProgression());
else
str_format(aBuf, sizeof(aBuf), Localize("%d of %d servers, %d players"), ServerBrowser()->NumSortedServers(), ServerBrowser()->NumServers(), NumPlayers);
Status.VSplitRight(TextRender()->TextWidth(0, 14.0f, aBuf, -1), 0, &Status);
UI()->DoLabel(&Status, aBuf, 14.0f, -1);
}