mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Adjust spectator notification to show up for non-empty servers only
This commit is contained in:
parent
8e8e05c4f3
commit
2f5ca88b4d
|
@ -673,12 +673,21 @@ void CHud::RenderSpectatorNotification()
|
||||||
{
|
{
|
||||||
if(m_pClient->m_aClients[m_pClient->m_LocalClientID].m_Team == TEAM_SPECTATORS &&
|
if(m_pClient->m_aClients[m_pClient->m_LocalClientID].m_Team == TEAM_SPECTATORS &&
|
||||||
m_pClient->m_TeamChangeTime + 5.0f >= Client()->LocalTime())
|
m_pClient->m_TeamChangeTime + 5.0f >= Client()->LocalTime())
|
||||||
|
{
|
||||||
|
// count non spectators
|
||||||
|
int NumPlayers = 0;
|
||||||
|
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||||
|
if(m_pClient->m_aClients[i].m_Active && m_pClient->m_aClients[i].m_Team != TEAM_SPECTATORS)
|
||||||
|
NumPlayers++;
|
||||||
|
|
||||||
|
if(NumPlayers > 0)
|
||||||
{
|
{
|
||||||
const char *pText = Localize("Click on a player or a flag to follow it");
|
const char *pText = Localize("Click on a player or a flag to follow it");
|
||||||
float FontSize = 16.0f;
|
float FontSize = 16.0f;
|
||||||
float w = TextRender()->TextWidth(0, FontSize, pText, -1);
|
float w = TextRender()->TextWidth(0, FontSize, pText, -1);
|
||||||
TextRender()->Text(0, 150 * Graphics()->ScreenAspect() + -w / 2, 30, FontSize, pText, -1);
|
TextRender()->Text(0, 150 * Graphics()->ScreenAspect() + -w / 2, 30, FontSize, pText, -1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHud::RenderReadyUpNotification()
|
void CHud::RenderReadyUpNotification()
|
||||||
|
|
Loading…
Reference in a new issue