ship_gui.c
changeset 1901 03bf9bf99319
parent 1891 862800791170
child 1906 257d7487409a
equal deleted inserted replaced
1900:1f3309a61546 1901:03bf9bf99319
   426 	w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
   426 	w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
   427 
   427 
   428 	w->resize.step_height = 24;
   428 	w->resize.step_height = 24;
   429 
   429 
   430 	if (tile != 0) {
   430 	if (tile != 0) {
   431 		w->caption_color = _map_owner[tile];
   431 		w->caption_color = GetTileOwner(tile);
   432 	} else {
   432 	} else {
   433 		w->caption_color = _local_player;
   433 		w->caption_color = _local_player;
   434 	}
   434 	}
   435 
   435 
   436 }
   436 }
   586 	Depot *depot;
   586 	Depot *depot;
   587 
   587 
   588 	tile = w->window_number;
   588 	tile = w->window_number;
   589 
   589 
   590 	/* setup disabled buttons */
   590 	/* setup disabled buttons */
   591 	w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<7));
   591 	w->disabled_state =
       
   592 		IsTileOwner(tile, _local_player) ? 0 : ((1 << 4) | (1 << 7));
   592 
   593 
   593 	/* determine amount of items for scroller */
   594 	/* determine amount of items for scroller */
   594 	num = 0;
   595 	num = 0;
   595 	FOR_ALL_VEHICLES(v) {
   596 	FOR_ALL_VEHICLES(v) {
   596 		if (v->type == VEH_Ship && v->u.ship.state == 0x80 &&
   597 		if (v->type == VEH_Ship && v->u.ship.state == 0x80 &&
   806 {
   807 {
   807 	Window *w;
   808 	Window *w;
   808 
   809 
   809 	w = AllocateWindowDescFront(&_ship_depot_desc,tile);
   810 	w = AllocateWindowDescFront(&_ship_depot_desc,tile);
   810 	if (w) {
   811 	if (w) {
   811 		w->caption_color = _map_owner[w->window_number];
   812 		w->caption_color = GetTileOwner(w->window_number);
   812 		w->vscroll.cap = 2;
   813 		w->vscroll.cap = 2;
   813 		w->hscroll.cap = 3;
   814 		w->hscroll.cap = 3;
   814 		w->resize.step_width = 90;
   815 		w->resize.step_width = 90;
   815 		w->resize.step_height = 24;
   816 		w->resize.step_height = 24;
   816 		WP(w,traindepot_d).sel = INVALID_VEHICLE;
   817 		WP(w,traindepot_d).sel = INVALID_VEHICLE;
   993 				break;
   994 				break;
   994 
   995 
   995 
   996 
   996 			tile = _last_built_ship_depot_tile;
   997 			tile = _last_built_ship_depot_tile;
   997 			do {
   998 			do {
   998 				if (_map_owner[tile] == _local_player && IsTileDepotType(tile, TRANSPORT_WATER)) {
   999 				if (IsTileOwner(tile, _local_player) && IsTileDepotType(tile, TRANSPORT_WATER)) {
   999 					ShowShipDepotWindow(tile);
  1000 					ShowShipDepotWindow(tile);
  1000 					ShowBuildShipWindow(tile);
  1001 					ShowBuildShipWindow(tile);
  1001 					return;
  1002 					return;
  1002 				}
  1003 				}
  1003 
  1004