From 379d93ae7b822f81f0f041ea517952de6576917f Mon Sep 17 00:00:00 2001 From: Lukas Kitsche Date: Thu, 16 Jun 2022 15:30:58 +0200 Subject: [PATCH] no goals hud when empty --- src/game/client/components/scoreboard.cpp | 15 ++++++++++----- src/game/client/components/scoreboard.h | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index a42eee645..62a15b7fb 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -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, 160.0f); + } + else + { + RenderSpectators(Width / 2 - w / 2, 150 + 760 + 10, w, 200.0f); + } - RenderGoals(Width / 2 - w / 2, 150 + 760 + 10, w); - RenderSpectators(Width / 2 - w / 2, 150 + 760 + 10 + 50 + 10, w); RenderRecordingNotification((Width / 7) * 4 + 20); } diff --git a/src/game/client/components/scoreboard.h b/src/game/client/components/scoreboard.h index fe23f5c4d..e45b781cf 100644 --- a/src/game/client/components/scoreboard.h +++ b/src/game/client/components/scoreboard.h @@ -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);