Scoreboard headline for score can now be Time when on DDRace

This commit is contained in:
fokkonaut 2019-03-07 17:42:49 +01:00 committed by def
parent f0cce859ef
commit 5c1dfe6b65

View file

@ -285,9 +285,10 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
// render headlines
y += 50.0f;
float HeadlineFontsize = 22.0f;
float ScoreWidth = TextRender()->TextWidth(0, HeadlineFontsize, Localize("Score"), -1);
const char* pScore = (m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard && m_pClient->m_AllowTimeScore[g_Config.m_ClDummy]) ? Localize("Time") : Localize("Score");
float ScoreWidth = TextRender()->TextWidth(0, HeadlineFontsize, pScore, -1);
tw = ScoreLength > ScoreWidth ? ScoreLength : ScoreWidth;
TextRender()->Text(0, ScoreOffset+ScoreLength-tw, y + (HeadlineFontsize * 2.f - HeadlineFontsize) / 2.f, HeadlineFontsize, Localize("Score"), -1);
TextRender()->Text(0, ScoreOffset+ScoreLength-tw, y + (HeadlineFontsize * 2.f - HeadlineFontsize) / 2.f, HeadlineFontsize, pScore, -1);
TextRender()->Text(0, NameOffset, y + (HeadlineFontsize * 2.f - HeadlineFontsize) / 2.f, HeadlineFontsize, Localize("Name"), -1);