Merge pull request #8636 from archimede67/fix-teamcount-rendering

Fix team number and team size rendering
This commit is contained in:
Dennis Felsing 2024-07-23 08:55:54 +00:00 committed by GitHub
commit b7e1af4bbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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++)
{
@ -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;
@ -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
{