diff options
| author | SushiTee <weichel.sascha@xxx.xx> | 2011-04-02 15:10:51 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-04-02 15:18:52 +0200 |
| commit | 4adad07ad807d09b5f0fa94ec47d3cb9108e86c0 (patch) | |
| tree | 72a7094a454e0e8300f05ae634a4f82327c7bbac /src | |
| parent | 0db6022c642352dc3d68814f43ef0c9ca9395274 (diff) | |
| download | zcatch-4adad07ad807d09b5f0fa94ec47d3cb9108e86c0.tar.gz zcatch-4adad07ad807d09b5f0fa94ec47d3cb9108e86c0.zip | |
polished scoreboard a bit
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/client/components/scoreboard.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index edf9eb4b..863cae58 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -143,7 +143,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch else pTitle = Localize("Score board"); } - TextRender()->Text(0, x+30, y, TitleFontsize, pTitle, -1); + TextRender()->Text(0, x+20.0f, y, TitleFontsize, pTitle, -1); char aBuf[128] = {0}; if(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS) @@ -163,7 +163,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch } } float tw = TextRender()->TextWidth(0, TitleFontsize, aBuf, -1); - TextRender()->Text(0, x+w-tw-30, y, TitleFontsize, aBuf, -1); + TextRender()->Text(0, x+w-tw-20.0f, y, TitleFontsize, aBuf, -1); // calculate measurements x += 10.0f; @@ -186,17 +186,23 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch float ScoreOffset = x+10.0f, ScoreLength = 60.0f; float TeeOffset = ScoreOffset+ScoreLength, TeeLength = 60*TeeSizeMod; float NameOffset = TeeOffset+TeeLength, NameLength = 300.0f-TeeLength; - float PingOffset = x+600.0f, PingLength = 70.0f; + float PingOffset = x+610.0f, PingLength = 65.0f; float CountryOffset = PingOffset-(LineHeight-Spacing-TeeSizeMod*5.0f)*96.0f/64.0f, CountryLength = (LineHeight-Spacing-TeeSizeMod*5.0f)*96.0f/64.0f; float ClanOffset = x+370.0f, ClanLength = 230.0f-CountryLength; // render headlines y += 50.0f; float HeadlineFontsize = 22.0f; - TextRender()->Text(0, ScoreOffset, y, HeadlineFontsize, Localize("Score"), -1); - TextRender()->Text(0, NameOffset+10.0f, y, HeadlineFontsize, Localize("Name"), -1); - TextRender()->Text(0, ClanOffset+10.0f, y, HeadlineFontsize, Localize("Clan"), -1); - TextRender()->Text(0, PingOffset+10.0f, y, HeadlineFontsize, Localize("Ping"), -1); + tw = TextRender()->TextWidth(0, HeadlineFontsize, Localize("Score"), -1); + TextRender()->Text(0, ScoreOffset+ScoreLength-tw, y, HeadlineFontsize, Localize("Score"), -1); + + TextRender()->Text(0, NameOffset, y, HeadlineFontsize, Localize("Name"), -1); + + tw = TextRender()->TextWidth(0, HeadlineFontsize, Localize("Clan"), -1); + TextRender()->Text(0, ClanOffset+ClanLength/2-tw/2, y, HeadlineFontsize, Localize("Clan"), -1); + + tw = TextRender()->TextWidth(0, HeadlineFontsize, Localize("Ping"), -1); + TextRender()->Text(0, PingOffset+PingLength-tw, y, HeadlineFontsize, Localize("Ping"), -1); // render player entries y += HeadlineFontsize*2.0f; @@ -255,7 +261,8 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch TextRender()->TextEx(&Cursor, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1); // clan - TextRender()->SetCursor(&Cursor, ClanOffset, y+Spacing, FontSize, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); + tw = TextRender()->TextWidth(0, FontSize, m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, -1); + TextRender()->SetCursor(&Cursor, ClanOffset+ClanLength/2-tw/2, y+Spacing, FontSize, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); Cursor.m_LineWidth = ClanLength; TextRender()->TextEx(&Cursor, m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, -1); |