about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/controls.cpp10
-rw-r--r--src/game/client/components/controls.hpp1
-rw-r--r--src/game/client/components/menus_browser.cpp31
-rw-r--r--src/game/client/components/scoreboard.cpp31
4 files changed, 55 insertions, 18 deletions
diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp
index 0cf8b861..6cb89836 100644
--- a/src/game/client/components/controls.cpp
+++ b/src/game/client/components/controls.cpp
@@ -65,6 +65,16 @@ void CONTROLS::on_init()
 	{ static INPUTSET set = {this, &input_data.prev_weapon, 0};  MACRO_REGISTER_COMMAND("+prevweapon", "", con_key_input_nextprev_weapon, (void *)&set); }
 }
 
+void CONTROLS::on_message(int msg, void *rawmsg)
+{
+    if(msg == NETMSGTYPE_SV_WEAPONPICKUP)
+    {
+    	NETMSG_SV_WEAPONPICKUP *msg = (NETMSG_SV_WEAPONPICKUP *)rawmsg;
+        if(config.cl_autoswitch_weapons)
+        	input_data.wanted_weapon = msg->weapon+1;
+    }
+}
+
 int CONTROLS::snapinput(int *data)
 {
 	static NETOBJ_PLAYER_INPUT last_data = {0};
diff --git a/src/game/client/components/controls.hpp b/src/game/client/components/controls.hpp
index d875522a..262fd235 100644
--- a/src/game/client/components/controls.hpp
+++ b/src/game/client/components/controls.hpp
@@ -12,6 +12,7 @@ public:
 	int input_direction_right;
 
 	CONTROLS();
+	virtual void on_message(int msg, void *rawmsg);
 	virtual bool on_mousemove(float x, float y);
 	virtual void on_init();
 	
diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp
index e2e1ae9e..be0e1904 100644
--- a/src/game/client/components/menus_browser.cpp
+++ b/src/game/client/components/menus_browser.cpp
@@ -296,7 +296,17 @@ void MENUS::render_serverbrowser(RECT main_view)
 				ui_do_label(&button, version, 12.0f, 1);
 			}			
 			else if(id == COL_GAMETYPE)
-				ui_do_label(&button, item->gametype, 12.0f, 0);
+			{
+				// all these are just for nice compability
+				if(item->gametype[0] == '0' && item->gametype[1] == 0)
+					ui_do_label(&button, "DM", 12.0f, 0);
+				else if(item->gametype[0] == '1' && item->gametype[1] == 0)
+					ui_do_label(&button, "TDM", 12.0f, 0);
+				else if(item->gametype[0] == '2' && item->gametype[1] == 0)
+					ui_do_label(&button, "CTF", 12.0f, 0);
+				else
+					ui_do_label(&button, item->gametype, 12.0f, 0);
+			}
 		}
 	}
 
@@ -425,8 +435,16 @@ void MENUS::render_serverbrowser(RECT main_view)
 	ui_hsplit_t(&filters, 20.0f, &button, &filters);
 	ui_do_label(&button, "Quick search: ", 14.0f, -1);
 	ui_vsplit_l(&button, 95.0f, 0, &button);
+	ui_margin(&button, 1.0f, &button);
 	ui_do_edit_box(&config.b_filter_string, &button, config.b_filter_string, sizeof(config.b_filter_string), 14.0f);
 
+
+	ui_hsplit_t(&filters, 20.0f, &button, &filters);
+	ui_do_label(&button, "Game types: ", 14.0f, -1);
+	ui_vsplit_l(&button, 95.0f, 0, &button);
+	ui_margin(&button, 1.0f, &button);
+	ui_do_edit_box(&config.b_filter_gametype, &button, config.b_filter_gametype, sizeof(config.b_filter_gametype), 14.0f);
+
 	ui_vsplit_l(&filters, 180.0f, &filters, &types);
 
 	// render filters
@@ -442,10 +460,6 @@ void MENUS::render_serverbrowser(RECT main_view)
 	if (ui_do_button(&config.b_filter_pw, "No password", config.b_filter_pw, &button, ui_draw_checkbox, 0))
 		config.b_filter_pw ^= 1;
 
-	ui_hsplit_t(&filters, 20.0f, &button, &filters);
-	if (ui_do_button((char *)&config.b_filter_compatversion, "Compatible Version", config.b_filter_compatversion, &button, ui_draw_checkbox, 0))
-		config.b_filter_compatversion ^= 1;
-
 	// game types
 	/*
 	ui_hsplit_t(&types, 20.0f, &button, &types);
@@ -462,8 +476,13 @@ void MENUS::render_serverbrowser(RECT main_view)
 	*/
 
 	// ping
+	ui_hsplit_t(&types, 20.0f, &button, &types);
+	if (ui_do_button((char *)&config.b_filter_compatversion, "Compatible Version", config.b_filter_compatversion, &button, ui_draw_checkbox, 0))
+		config.b_filter_compatversion ^= 1;
+	
 	ui_hsplit_t(&types, 2.0f, &button, &types);
 	ui_hsplit_t(&types, 20.0f, &button, &types);
+	
 	{
 		RECT editbox;
 		ui_vsplit_l(&button, 40.0f, &editbox, &button);
@@ -517,7 +536,7 @@ void MENUS::render_serverbrowser(RECT main_view)
 			config.b_filter_empty = 0;
 			config.b_filter_pw = 0;
 			config.b_filter_ping = 999;
-			config.b_filter_gametype = 0xf;
+			config.b_filter_gametype[0] = 0;
 			config.b_filter_compatversion = 1;
 			config.b_filter_string[0] = 0;
 		}
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp
index bd8c7ea9..2388c4c3 100644
--- a/src/game/client/components/scoreboard.cpp
+++ b/src/game/client/components/scoreboard.cpp
@@ -225,23 +225,30 @@ void SCOREBOARD::render_scoreboard(float x, float y, float w, int team, const ch
 
 void SCOREBOARD::on_render()
 {
-	if(!active)
-		return;
-		
-	// if the score board is active, then we should clear the motd message aswell
-	gameclient.motd->clear();
-	
-	// TODO: repair me
-	/*
 	bool do_scoreboard = false;
 
-	// if we are dead
-	if(!spectate && (!gameclient.snap.local_character || gameclient.snap.local_character->health < 0))
+	// if we activly wanna look on the scoreboard	
+	if(active)
 		do_scoreboard = true;
-	
+		
+	if(gameclient.snap.local_info && gameclient.snap.local_info->team != -1)
+	{
+		// we are not a spectator, check if we are ead
+		if(!gameclient.snap.local_character || gameclient.snap.local_character->health < 0)
+			do_scoreboard = true;
+	}
+
 	// if we the game is over
 	if(gameclient.snap.gameobj && gameclient.snap.gameobj->game_over)
-		do_scoreboard = true;*/
+		do_scoreboard = true;
+		
+	if(!do_scoreboard)
+		return;
+		
+	// if the score board is active, then we should clear the motd message aswell
+	if(active)
+		gameclient.motd->clear();
+	
 
 	float width = 400*3.0f*gfx_screenaspect();
 	float height = 400*3.0f;