(svn r1526) -Fix: [1103027] Minor changes for the lobby GUI (widen window) (bociusz)
authordarkvater
Sat, 15 Jan 2005 19:17:45 +0000
changeset 1025 882be6e4ad19
parent 1024 9b06b01490a4
child 1026 5b2681cad645
(svn r1526) -Fix: [1103027] Minor changes for the lobby GUI (widen window) (bociusz)
network_gui.c
--- a/network_gui.c	Sat Jan 15 19:06:22 2005 +0000
+++ b/network_gui.c	Sat Jan 15 19:17:45 2005 +0000
@@ -694,17 +694,14 @@
 		int y = NET_PRC__OFFSET_TOP_WIDGET_COMPANY, pos;
 		StringID str;
 
-		if (_selected_company_item == -1) {
-			w->disabled_state = (1<<7);
-		} else
-			w->disabled_state = 0;
+		w->disabled_state = (_selected_company_item == -1) ? 1 << 7 : 0;
 
 		if (_network_lobby_company_count == MAX_PLAYERS)
-			w->disabled_state |= (1<<8);
+			SETBIT(w->disabled_state, 8);
 		/* You can not join a server as spectator when it has no companies active..
 		     it causes some nasty crashes */
 		if (_network_lobby_company_count == 0)
-			w->disabled_state |= (1<<9);
+			SETBIT(w->disabled_state, 9);
 
 		DrawWindowWidgets(w);
 
@@ -712,22 +709,22 @@
 		DrawString(10, 22, STR_NETWORK_PREPARE_TO_JOIN, 2);
 
 		// draw company list
-		GfxFillRect(11, 41, 139, 165, 0xD7);
+		GfxFillRect(11, 41, 154, 165, 0xD7);
 		pos = w->vscroll.pos;
 		while (pos < _network_lobby_company_count) {
 			byte index = NetworkLobbyFindCompanyIndex(pos);
 			bool income = false;
 			if (_selected_company_item == index)
-				GfxFillRect(11, y - 1, 139, y + 10, 155); // show highlighted item with a different colour
+				GfxFillRect(11, y - 1, 154, y + 10, 155); // show highlighted item with a different colour
 
 			DoDrawString(_network_player_info[index].company_name, 13, y, 2);
 			if(_network_player_info[index].use_password != 0)
-				DrawSprite(SPR_LOCK, 120, y);
+				DrawSprite(SPR_LOCK, 135, y);
 
 			/* If the company's income was positive puts a green dot else a red dot */
-			if ((_network_player_info[index].income) > 0)
+			if ((_network_player_info[index].income) >= 0)
 				income = true;
-			DrawSprite(SPR_BLOT | (income?0x30d8000:0x30b8000), 130, y);
+			DrawSprite(SPR_BLOT | (income ? PALETTE_TO_GREEN : PALETTE_TO_RED), 145, y);
 
 			pos++;
 			y += NET_PRC__SIZE_OF_ROW_COMPANY;
@@ -736,10 +733,10 @@
 		}
 
 		// draw info about selected company
-		DrawStringMultiCenter(270, 48, STR_NETWORK_COMPANY_INFO, 0);
+		DrawStringMultiCenter(290, 48, STR_NETWORK_COMPANY_INFO, 0);
 		if (_selected_company_item != -1) { // if a company is selected...
 			// show company info
-			const uint x = 168;
+			const uint x = 183;
 			uint xm;
 			y = 65;
 
@@ -848,12 +845,12 @@
 {     WWT_IMGBTN,   RESIZE_NONE,   BGC,     0,   419,    14,   209, 0x0,												STR_NULL},
 
 // company list
-{          WWT_6,   RESIZE_NONE,   BGC,    10,   152,    40,   166, 0x0,												STR_NETWORK_COMPANY_LIST_TIP},
-{  WWT_SCROLLBAR,   RESIZE_NONE,   BGC,   140,   151,    41,   165, 0x1,												STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{          WWT_6,   RESIZE_NONE,   BGC,    10,   167,    40,   166, 0x0,												STR_NETWORK_COMPANY_LIST_TIP},
+{  WWT_SCROLLBAR,   RESIZE_NONE,   BGC,   155,   166,    41,   165, 0x1,												STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
 // company/player info
-{     WWT_IMGBTN,   RESIZE_NONE,   BGC,   158,   389,    38,   165, 0x0,					STR_NULL},
-{          WWT_6,   RESIZE_NONE,   BGC,   159,   388,    39,   164, 0x0,					STR_NULL},
+{     WWT_IMGBTN,   RESIZE_NONE,   BGC,   173,   404,    38,   166, 0x0,					STR_NULL},
+{          WWT_6,   RESIZE_NONE,   BGC,   174,   403,    39,   165, 0x0,					STR_NULL},
 
 // buttons
 { WWT_PUSHTXTBTN,   RESIZE_NONE,   BTC,    10,   151,   175,   186, STR_NETWORK_JOIN_COMPANY,	STR_NETWORK_JOIN_COMPANY_TIP},