no goals hud when empty

This commit is contained in:
Lukas Kitsche 2022-06-16 15:30:58 +02:00
parent edab7c0e8c
commit 379d93ae7b
2 changed files with 11 additions and 6 deletions

View file

@ -90,10 +90,8 @@ void CScoreboard::RenderGoals(float x, float y, float w)
}
}
void CScoreboard::RenderSpectators(float x, float y, float w)
void CScoreboard::RenderSpectators(float x, float y, float w, float h)
{
float h = 140.0f;
// background
Graphics()->BlendNormal();
Graphics()->TextureClear();
@ -686,9 +684,16 @@ void CScoreboard::OnRender()
RenderScoreboard(Width / 2 + 5.0f, 150.0f, w, TEAM_BLUE, pBlueClanName ? pBlueClanName : Localize("Blue team"), NumPlayers);
}
}
if(m_pClient->m_Snap.m_pGameInfoObj && (m_pClient->m_Snap.m_pGameInfoObj->m_ScoreLimit || m_pClient->m_Snap.m_pGameInfoObj->m_TimeLimit || (m_pClient->m_Snap.m_pGameInfoObj->m_RoundNum && m_pClient->m_Snap.m_pGameInfoObj->m_RoundCurrent)))
{
RenderGoals(Width / 2 - w / 2, 150 + 760 + 10, w);
RenderSpectators(Width / 2 - w / 2, 150 + 760 + 10 + 50 + 10, w);
RenderSpectators(Width / 2 - w / 2, 150 + 760 + 10 + 50 + 10, w, 160.0f);
}
else
{
RenderSpectators(Width / 2 - w / 2, 150 + 760 + 10, w, 200.0f);
}
RenderRecordingNotification((Width / 7) * 4 + 20);
}

View file

@ -10,7 +10,7 @@
class CScoreboard : public CComponent
{
void RenderGoals(float x, float y, float w);
void RenderSpectators(float x, float y, float w);
void RenderSpectators(float x, float y, float w, float h);
void RenderScoreboard(float x, float y, float w, int Team, const char *pTitle, int NumPlayers = -1);
void RenderRecordingNotification(float x);