mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
improved loading progression in the server browser
This commit is contained in:
parent
a7f37446b6
commit
f1ce0d1949
|
@ -707,6 +707,10 @@ void CServerBrowser::RemoveFavorite(const NETADDR &Addr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CServerBrowser::IsRefreshing() const
|
||||||
|
{
|
||||||
|
return m_pFirstReqServer != 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool CServerBrowser::IsRefreshingMasters() const
|
bool CServerBrowser::IsRefreshingMasters() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
|
|
||||||
// interface functions
|
// interface functions
|
||||||
void Refresh(int Type);
|
void Refresh(int Type);
|
||||||
|
bool IsRefreshing() const;
|
||||||
bool IsRefreshingMasters() const;
|
bool IsRefreshingMasters() const;
|
||||||
int LoadingProgression() const;
|
int LoadingProgression() const;
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void Refresh(int Type) = 0;
|
virtual void Refresh(int Type) = 0;
|
||||||
|
virtual bool IsRefreshing() const = 0;
|
||||||
virtual bool IsRefreshingMasters() const = 0;
|
virtual bool IsRefreshingMasters() const = 0;
|
||||||
virtual int LoadingProgression() const = 0;
|
virtual int LoadingProgression() const = 0;
|
||||||
|
|
||||||
|
|
|
@ -395,7 +395,10 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
||||||
|
|
||||||
// render status
|
// render status
|
||||||
char aBuf[128];
|
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);
|
Status.VSplitRight(TextRender()->TextWidth(0, 14.0f, aBuf, -1), 0, &Status);
|
||||||
UI()->DoLabel(&Status, aBuf, 14.0f, -1);
|
UI()->DoLabel(&Status, aBuf, 14.0f, -1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue