Skip to content

Commit

Permalink
Merge pull request ddnet#8636 from archimede67/fix-teamcount-rendering
Browse files Browse the repository at this point in the history
Fix team number and team size rendering
  • Loading branch information
def- authored Jul 23, 2024
2 parents 7e45b9b + 5f8e274 commit b7e1af4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/game/client/components/scoreboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ void CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,

char aBuf[64];
int MaxTeamSize = m_pClient->Config()->m_SvMaxTeamSize;
float TeamStartY = 0;
static float s_TeamStartY = 0;
static float s_TeamStartX = 0;

for(int i = 0; i < MAX_CLIENTS; i++)
{
Expand Down Expand Up @@ -373,7 +374,8 @@ void CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
if(PrevDDTeam != DDTeam)
{
TeamRectCorners |= IGraphics::CORNER_T;
TeamStartY = Row.y;
s_TeamStartY = Row.y;
s_TeamStartX = Row.x;
}
if(NextDDTeam != DDTeam)
TeamRectCorners |= IGraphics::CORNER_B;
Expand All @@ -393,7 +395,7 @@ void CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
str_format(aBuf, sizeof(aBuf), "%d", DDTeam);
else
str_format(aBuf, sizeof(aBuf), Localize("%d\n(%d/%d)", "Team and size"), DDTeam, CurrentDDTeamSize, MaxTeamSize);
TextRender()->Text(Row.x, TeamStartY + Row.h / 2.0f - TeamFontSize / 2.0f, TeamFontSize, aBuf);
TextRender()->Text(s_TeamStartX, maximum(s_TeamStartY + Row.h / 2.0f - TeamFontSize, s_TeamStartY + 3.0f /* padding top */), TeamFontSize, aBuf);
}
else
{
Expand Down

0 comments on commit b7e1af4

Please sign in to comment.