mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Merge pull request #8636 from archimede67/fix-teamcount-rendering
Fix team number and team size rendering
This commit is contained in:
commit
b7e1af4bbe
|
@ -323,7 +323,8 @@ void CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
|
||||||
|
|
||||||
char aBuf[64];
|
char aBuf[64];
|
||||||
int MaxTeamSize = m_pClient->Config()->m_SvMaxTeamSize;
|
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++)
|
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||||
{
|
{
|
||||||
|
@ -373,7 +374,8 @@ void CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
|
||||||
if(PrevDDTeam != DDTeam)
|
if(PrevDDTeam != DDTeam)
|
||||||
{
|
{
|
||||||
TeamRectCorners |= IGraphics::CORNER_T;
|
TeamRectCorners |= IGraphics::CORNER_T;
|
||||||
TeamStartY = Row.y;
|
s_TeamStartY = Row.y;
|
||||||
|
s_TeamStartX = Row.x;
|
||||||
}
|
}
|
||||||
if(NextDDTeam != DDTeam)
|
if(NextDDTeam != DDTeam)
|
||||||
TeamRectCorners |= IGraphics::CORNER_B;
|
TeamRectCorners |= IGraphics::CORNER_B;
|
||||||
|
@ -393,7 +395,7 @@ void CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
|
||||||
str_format(aBuf, sizeof(aBuf), "%d", DDTeam);
|
str_format(aBuf, sizeof(aBuf), "%d", DDTeam);
|
||||||
else
|
else
|
||||||
str_format(aBuf, sizeof(aBuf), Localize("%d\n(%d/%d)", "Team and size"), DDTeam, CurrentDDTeamSize, MaxTeamSize);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue