From 8f999837c674b83fb813ef7f394b4c611d08311b Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 10 Jan 2011 00:58:03 +0100 Subject: improved the count down timer. Closes #391 --- src/game/client/components/hud.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/game/client/components/hud.cpp') diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index 1f57558e..093e4f6c 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -49,7 +49,14 @@ void CHud::RenderGameTimer() str_format(Buf, sizeof(Buf), "%d:%02d", Time/60, Time%60); float FontSize = 10.0f; float w = TextRender()->TextWidth(0, FontSize, Buf, -1); + // last 60 sec red, last 10 sec blink + if(m_pClient->m_Snap.m_pGameobj->m_TimeLimit && Time <= 60) + { + float Alpha = Time <= 10 && (2*time_get()/time_freq()) % 2 ? 0.5f : 1.0f; + TextRender()->TextColor(1.0f, 0.25f, 0.25f, Alpha); + } TextRender()->Text(0, Half-w/2, 2, FontSize, Buf, -1); + TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); } } -- cgit 1.4.1