about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-02-10 16:50:59 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-02-10 16:50:59 +0000
commitfb336cddbb081b11449e6e1e0cf18a2b8ffdfb68 (patch)
tree8ff419e19322742f47b90ca7575f373005ac4453 /src/game/client
parent294cbe18c17cd20f70f965e7f89a3250ef39b990 (diff)
downloadzcatch-fb336cddbb081b11449e6e1e0cf18a2b8ffdfb68.tar.gz
zcatch-fb336cddbb081b11449e6e1e0cf18a2b8ffdfb68.zip
added simple map downloading \o/
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/gc_hooks.cpp1
-rw-r--r--src/game/client/gc_menu.cpp16
2 files changed, 15 insertions, 2 deletions
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp
index 4ab5cf6a..a6391007 100644
--- a/src/game/client/gc_hooks.cpp
+++ b/src/game/client/gc_hooks.cpp
@@ -394,7 +394,6 @@ extern "C" void modc_statechange(int state, int old)
 	}
 }
 
-
 obj_projectile extraproj_projectiles[MAX_EXTRA_PROJECTILES];
 int extraproj_num;
 
diff --git a/src/game/client/gc_menu.cpp b/src/game/client/gc_menu.cpp
index 409edbe8..633c44da 100644
--- a/src/game/client/gc_menu.cpp
+++ b/src/game/client/gc_menu.cpp
@@ -1796,21 +1796,30 @@ int menu2_render()
 		// make sure that other windows doesn't do anything funnay!
 		//ui_set_hot_item(0);
 		//ui_set_active_item(0);
+		char buf[128];
 		const char *title = "";
 		const char *extra_text = "";
 		const char *button_text = "";
+		int extra_align = 0;
 		
 		if(popup == POPUP_CONNECTING)
 		{
 			title = "Connecting to";
 			extra_text = config.ui_server_address;  // TODO: query the client about the address
 			button_text = "Abort";
+			if(client_mapdownload_totalsize() > 0)
+			{
+				title = "Downloading map";
+				sprintf(buf, "%d/%d KiB", client_mapdownload_amount()/1024, client_mapdownload_totalsize()/1024);
+				extra_text = buf;
+			}
 		}
 		else if(popup == POPUP_DISCONNECTED)
 		{
 			title = "Disconnected";
 			extra_text = client_error_string();
 			button_text = "Ok";
+			extra_align = -1;
 		}
 		else if(popup == POPUP_PASSWORD)
 		{
@@ -1831,6 +1840,7 @@ int menu2_render()
 			"It's recommended that you check the settings to adjust them to your liking "
 			"before joining a server.";
 			button_text = "Ok";
+			extra_align = -1;
 		}
 		
 		RECT box, part;
@@ -1847,7 +1857,11 @@ int menu2_render()
 		ui_hsplit_t(&box, 20.f, &part, &box);
 		ui_hsplit_t(&box, 24.f, &part, &box);
 		ui_vmargin(&part, 20.f, &part);
-		ui_do_label(&part, extra_text, 20.f, -1, (int)part.w);
+		
+		if(extra_align == -1)
+			ui_do_label(&part, extra_text, 20.f, -1, (int)part.w);
+		else
+			ui_do_label(&part, extra_text, 20.f, 0, -1);
 
 		if(popup == POPUP_QUIT)
 		{