src/network/network_gui.cpp
branchcpp_gui
changeset 6246 2a4c2c4d66f0
parent 6242 17609af8a1d1
child 6250 5135b200b376
equal deleted inserted replaced
6245:6fa82c6ee8ca 6246:2a4c2c4d66f0
   241 			BuildNetworkGameList(&WP(w, network_ql_d));
   241 			BuildNetworkGameList(&WP(w, network_ql_d));
   242 			SetVScrollCount(w, ld->list_length);
   242 			SetVScrollCount(w, ld->list_length);
   243 		}
   243 		}
   244 		if (ld->flags & VL_RESORT) SortNetworkGameList(&WP(w, network_ql_d));
   244 		if (ld->flags & VL_RESORT) SortNetworkGameList(&WP(w, network_ql_d));
   245 
   245 
   246 		SetWindowWidgetDisabledState(w, 17, sel == NULL);
   246 		w->SetWidgetDisabledState(17, sel == NULL);
   247 		/* Join Button disabling conditions */
   247 		/* Join Button disabling conditions */
   248 		SetWindowWidgetDisabledState(w, 16, sel == NULL || // no Selected Server
   248 		w->SetWidgetDisabledState(16, sel == NULL || // no Selected Server
   249 				!sel->online || // Server offline
   249 				!sel->online || // Server offline
   250 				sel->info.clients_on >= sel->info.clients_max || // Server full
   250 				sel->info.clients_on >= sel->info.clients_max || // Server full
   251 				!sel->info.compatible); // Revision mismatch
   251 				!sel->info.compatible); // Revision mismatch
   252 
   252 
   253 		SetWindowWidgetHiddenState(w, 18, sel == NULL ||
   253 		SetWindowWidgetHiddenState(w, 18, sel == NULL ||
   822 
   822 
   823 	case WE_PAINT: {
   823 	case WE_PAINT: {
   824 		const NetworkGameInfo *gi = &nd->server->info;
   824 		const NetworkGameInfo *gi = &nd->server->info;
   825 		int y = NET_PRC__OFFSET_TOP_WIDGET_COMPANY, pos;
   825 		int y = NET_PRC__OFFSET_TOP_WIDGET_COMPANY, pos;
   826 
   826 
   827 		SetWindowWidgetDisabledState(w, 7, nd->company == (byte)-1);
   827 		w->SetWidgetDisabledState(7, nd->company == (byte)-1);
   828 		SetWindowWidgetDisabledState(w, 8, gi->companies_on >= gi->companies_max);
   828 		w->SetWidgetDisabledState(8, gi->companies_on >= gi->companies_max);
   829 		/* You can not join a server as spectator when it has no companies active..
   829 		/* You can not join a server as spectator when it has no companies active..
   830 		 * it causes some nasty crashes */
   830 		 * it causes some nasty crashes */
   831 		SetWindowWidgetDisabledState(w, 9, gi->spectators_on >= gi->spectators_max ||
   831 		w->SetWidgetDisabledState(9, gi->spectators_on >= gi->spectators_max ||
   832 				gi->companies_on == 0);
   832 				gi->companies_on == 0);
   833 
   833 
   834 		w->DrawWidgets();
   834 		w->DrawWidgets();
   835 
   835 
   836 		SetDParamStr(0, gi->server_name);
   836 		SetDParamStr(0, gi->server_name);