diff options
| author | oy <Tom_Adams@web.de> | 2010-07-02 14:14:41 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-07-02 14:14:41 +0200 |
| commit | c42679a10ef46704e3cbe20a237c37fe3a7cfd3f (patch) | |
| tree | 0100b5aed7c2d60c1cffba719f3e940bf179cbb9 /src/game/client/components/scoreboard.cpp | |
| parent | 31b63e488a69fa8603d3a558c0cc562e4fa243c8 (diff) | |
| download | zcatch-c42679a10ef46704e3cbe20a237c37fe3a7cfd3f.tar.gz zcatch-c42679a10ef46704e3cbe20a237c37fe3a7cfd3f.zip | |
cut too long player names in the server browser. Closes #151
fixed overlapping of too long player names in the scoreboard
Diffstat (limited to 'src/game/client/components/scoreboard.cpp')
| -rw-r--r-- | src/game/client/components/scoreboard.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 80330e9c..9558c840 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -226,7 +226,10 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch str_format(aBuf, sizeof(aBuf), "%4d", pInfo->m_Score); TextRender()->Text(0, x+60-TextRender()->TextWidth(0, FontSize,aBuf,-1), y, FontSize, aBuf, -1); - TextRender()->Text(0, x+128, y, FontSize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1); + float FontSizeName = FontSize; + while(TextRender()->TextWidth(0, FontSizeName, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1) > w-200) + --FontSizeName; + TextRender()->Text(0, x+128, y+(FontSize-FontSizeName)/2, FontSizeName, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1); str_format(aBuf, sizeof(aBuf), "%4d", pInfo->m_Latency); float tw = TextRender()->TextWidth(0, FontSize, aBuf, -1); |