town_gui.c
changeset 4709 a81ab800c25b
parent 4634 07699ac2bf37
child 4848 45f848b46222
equal deleted inserted replaced
4708:b2d7c0945664 4709:a81ab800c25b
   104 		SetVScrollCount(w, numact + 1);
   104 		SetVScrollCount(w, numact + 1);
   105 
   105 
   106 		if (WP(w,def_d).data_1 != -1 && !HASBIT(buttons, WP(w,def_d).data_1))
   106 		if (WP(w,def_d).data_1 != -1 && !HASBIT(buttons, WP(w,def_d).data_1))
   107 			WP(w,def_d).data_1 = -1;
   107 			WP(w,def_d).data_1 = -1;
   108 
   108 
   109 		w->disabled_state = (WP(w,def_d).data_1 == -1) ? (1 << 6) : 0;
   109 		SetWindowWidgetDisabledState(w, 6, WP(w, def_d).data_1 == -1);
   110 
   110 
   111 		{
   111 		{
   112 			int y;
   112 			int y;
   113 			const Player *p;
   113 			const Player *p;
   114 			int r;
   114 			int r;
   232 	Town *t = GetTown(w->window_number);
   232 	Town *t = GetTown(w->window_number);
   233 
   233 
   234 	switch (e->event) {
   234 	switch (e->event) {
   235 	case WE_PAINT:
   235 	case WE_PAINT:
   236 		// disable renaming town in network games if you are not the server
   236 		// disable renaming town in network games if you are not the server
   237 		if (_networking && !_network_server) SETBIT(w->disabled_state, 8);
   237 		SetWindowWidgetDisabledState(w, 8, _networking && !_network_server);
   238 
   238 
   239 		SetDParam(0, t->index);
   239 		SetDParam(0, t->index);
   240 		DrawWindowWidgets(w);
   240 		DrawWindowWidgets(w);
   241 
   241 
   242 		SetDParam(0, t->population);
   242 		SetDParam(0, t->population);