about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
authorAlfred Eriksson <somerunce@gmail.com>2008-09-01 18:17:01 +0000
committerAlfred Eriksson <somerunce@gmail.com>2008-09-01 18:17:01 +0000
commitb649ab6c16c6275c9ef9c21b2971d410ffd5b0db (patch)
treefe8f911031777913a9626081ff4ebdf5b7eba963 /src/game/client/components
parent67aa042dcbf9938896f20f47d2a778761efa4dcc (diff)
downloadzcatch-b649ab6c16c6275c9ef9c21b2971d410ffd5b0db.tar.gz
zcatch-b649ab6c16c6275c9ef9c21b2971d410ffd5b0db.zip
merged teambalance-warning and mini-/maximize-stuff from 0.4.3
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/hud.cpp20
-rw-r--r--src/game/client/components/hud.hpp1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp
index 762ed1fb..f2c37b83 100644
--- a/src/game/client/components/hud.cpp
+++ b/src/game/client/components/hud.cpp
@@ -183,6 +183,25 @@ void HUD::render_tunewarning()
 	}
 }		
 
+void HUD::render_teambalancewarning()
+{
+	// render prompt about team-balance
+	bool flash = time_get()/(time_freq()/2)%2 == 0;
+	if (gameclient.snap.gameobj && gameclient.snap.gameobj->flags&GAMEFLAG_TEAMS != 0)
+	{	
+		if (config.cl_warning_teambalance && abs(gameclient.snap.team_size[0]-gameclient.snap.team_size[1]) >= 2)
+		{
+			const char *text = "Please balance teams!";
+			if(flash)
+				gfx_text_color(1,1,0.5f,1);
+			else
+				gfx_text_color(0.7f,0.7f,0.2f,1.0f);
+			gfx_text(0x0, 5, 50, 6, text, -1);
+			gfx_text_color(1,1,1,1);
+		}
+	}
+}
+
 void HUD::render_cursor()
 {
 	if(!gameclient.snap.local_character)
@@ -263,5 +282,6 @@ void HUD::on_render()
 	render_fps();
 	render_connectionwarning();
 	render_tunewarning();
+	render_teambalancewarning();
 	render_cursor();
 }
diff --git a/src/game/client/components/hud.hpp b/src/game/client/components/hud.hpp
index f8eb5e8f..15b9e52c 100644
--- a/src/game/client/components/hud.hpp
+++ b/src/game/client/components/hud.hpp
@@ -9,6 +9,7 @@ class HUD : public COMPONENT
 	void render_fps();
 	void render_connectionwarning();
 	void render_tunewarning();
+	void render_teambalancewarning();
 	void render_healthandammo();
 	void render_goals();