aircraft_gui.c
changeset 1901 03bf9bf99319
parent 1891 862800791170
child 1906 257d7487409a
equal deleted inserted replaced
1900:1f3309a61546 1901:03bf9bf99319
   197 	w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
   197 	w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
   198 
   198 
   199 	w->resize.step_height = 24;
   199 	w->resize.step_height = 24;
   200 
   200 
   201 	if (tile != 0) {
   201 	if (tile != 0) {
   202 		w->caption_color = _map_owner[tile];
   202 		w->caption_color = GetTileOwner(tile);
   203 	} else {
   203 	} else {
   204 		w->caption_color = _local_player;
   204 		w->caption_color = _local_player;
   205 	}
   205 	}
   206 }
   206 }
   207 
   207 
   610 	int num,x,y;
   610 	int num,x,y;
   611 
   611 
   612 	tile = w->window_number;
   612 	tile = w->window_number;
   613 
   613 
   614 	/* setup disabled buttons */
   614 	/* setup disabled buttons */
   615 	w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<7));
   615 	w->disabled_state =
       
   616 		IsTileOwner(tile, _local_player) ? 0 : ((1 << 4) | (1 << 7));
   616 
   617 
   617 	/* determine amount of items for scroller */
   618 	/* determine amount of items for scroller */
   618 	num = 0;
   619 	num = 0;
   619 	FOR_ALL_VEHICLES(v) {
   620 	FOR_ALL_VEHICLES(v) {
   620 		if (v->type == VEH_Aircraft && v->subtype <= 2 && v->vehstatus&VS_HIDDEN &&
   621 		if (v->type == VEH_Aircraft && v->subtype <= 2 && v->vehstatus&VS_HIDDEN &&
   826 {
   827 {
   827 	Window *w;
   828 	Window *w;
   828 
   829 
   829 	w = AllocateWindowDescFront(&_aircraft_depot_desc, tile);
   830 	w = AllocateWindowDescFront(&_aircraft_depot_desc, tile);
   830 	if (w) {
   831 	if (w) {
   831 		w->caption_color = _map_owner[tile];
   832 		w->caption_color = GetTileOwner(tile);
   832 		w->vscroll.cap = 2;
   833 		w->vscroll.cap = 2;
   833 		w->hscroll.cap = 4;
   834 		w->hscroll.cap = 4;
   834 		w->resize.step_width = 74;
   835 		w->resize.step_width = 74;
   835 		w->resize.step_height = 24;
   836 		w->resize.step_height = 24;
   836 		WP(w,traindepot_d).sel = INVALID_VEHICLE;
   837 		WP(w,traindepot_d).sel = INVALID_VEHICLE;
  1011 			if (!IsWindowOfPrototype(w, _player_aircraft_widgets))
  1012 			if (!IsWindowOfPrototype(w, _player_aircraft_widgets))
  1012 				break;
  1013 				break;
  1013 
  1014 
  1014 			tile = _last_built_aircraft_depot_tile;
  1015 			tile = _last_built_aircraft_depot_tile;
  1015 			do {
  1016 			do {
  1016 				if (_map_owner[tile] == _local_player && IsAircraftHangarTile(tile)) {
  1017 				if (IsTileOwner(tile, _local_player) && IsAircraftHangarTile(tile)) {
  1017 					ShowAircraftDepotWindow(tile);
  1018 					ShowAircraftDepotWindow(tile);
  1018 					ShowBuildAircraftWindow(tile);
  1019 					ShowBuildAircraftWindow(tile);
  1019 					return;
  1020 					return;
  1020 				}
  1021 				}
  1021 
  1022