about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-01-10 00:58:03 +0100
committeroy <Tom_Adams@web.de>2011-01-10 00:58:03 +0100
commit8f999837c674b83fb813ef7f394b4c611d08311b (patch)
tree30bbc5bdbfcd18344740f035d21ff4705a44b04b /src/game
parent9819163c5f86c45283306e87fed9353836c7fd6b (diff)
downloadzcatch-8f999837c674b83fb813ef7f394b4c611d08311b.tar.gz
zcatch-8f999837c674b83fb813ef7f394b4c611d08311b.zip
improved the count down timer. Closes #391
Diffstat (limited to 'src/game')
-rw-r--r--src/game/client/components/hud.cpp7
1 files changed, 7 insertions, 0 deletions
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);
 	}
 }