train_gui.c
changeset 1901 fb05044cf5c3
parent 1891 92a3b0aa0946
child 1905 f43d9e821deb
equal deleted inserted replaced
1900:f409d5517cb0 1901:fb05044cf5c3
   269 
   269 
   270 	w->resize.step_height = 14;
   270 	w->resize.step_height = 14;
   271 	w->resize.height = w->height - 14 * 4; /* Minimum of 4 vehicles in the display */
   271 	w->resize.height = w->height - 14 * 4; /* Minimum of 4 vehicles in the display */
   272 
   272 
   273 	if (tile != 0) {
   273 	if (tile != 0) {
   274 		w->caption_color = _map_owner[tile];
   274 		w->caption_color = GetTileOwner(tile);
   275 		WP(w,buildtrain_d).railtype = _map3_lo[tile] & 0xF;
   275 		WP(w,buildtrain_d).railtype = _map3_lo[tile] & 0xF;
   276 	} else {
   276 	} else {
   277 		w->caption_color = _local_player;
   277 		w->caption_color = _local_player;
   278 		WP(w,buildtrain_d).railtype = DEREF_PLAYER(_local_player)->max_railtype - 1;
   278 		WP(w,buildtrain_d).railtype = DEREF_PLAYER(_local_player)->max_railtype - 1;
   279 	}
   279 	}
   305 	Depot *depot;
   305 	Depot *depot;
   306 
   306 
   307 	tile = w->window_number;
   307 	tile = w->window_number;
   308 
   308 
   309 	/* setup disabled buttons */
   309 	/* setup disabled buttons */
   310 	w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<5)|(1<<8));
   310 	w->disabled_state =
       
   311 		IsTileOwner(tile, _local_player) ? 0 : ((1 << 4) | (1 << 5) | (1 << 8));
   311 
   312 
   312 	/* determine amount of items for scroller */
   313 	/* determine amount of items for scroller */
   313 	num = 0;
   314 	num = 0;
   314 	hnum = 1;
   315 	hnum = 1;
   315 	FOR_ALL_VEHICLES(v) {
   316 	FOR_ALL_VEHICLES(v) {
   649 {
   650 {
   650 	Window *w;
   651 	Window *w;
   651 
   652 
   652 	w = AllocateWindowDescFront(&_train_depot_desc, tile);
   653 	w = AllocateWindowDescFront(&_train_depot_desc, tile);
   653 	if (w) {
   654 	if (w) {
   654 		w->caption_color = _map_owner[w->window_number];
   655 		w->caption_color = GetTileOwner(w->window_number);
   655 		w->vscroll.cap = 6;
   656 		w->vscroll.cap = 6;
   656 		w->hscroll.cap = 10;
   657 		w->hscroll.cap = 10;
   657 		w->resize.step_width = 29;
   658 		w->resize.step_width = 29;
   658 		w->resize.step_height = 14;
   659 		w->resize.step_height = 14;
   659 		WP(w,traindepot_d).sel = INVALID_VEHICLE;
   660 		WP(w,traindepot_d).sel = INVALID_VEHICLE;
  1343 			if (!IsWindowOfPrototype(w, _player_trains_widgets))
  1344 			if (!IsWindowOfPrototype(w, _player_trains_widgets))
  1344 				break;
  1345 				break;
  1345 
  1346 
  1346 			tile = _last_built_train_depot_tile;
  1347 			tile = _last_built_train_depot_tile;
  1347 			do {
  1348 			do {
  1348 				if (_map_owner[tile] == _local_player && IsTileDepotType(tile, TRANSPORT_RAIL)) {
  1349 				if (IsTileOwner(tile, _local_player) && IsTileDepotType(tile, TRANSPORT_RAIL)) {
  1349 					ShowTrainDepotWindow(tile);
  1350 					ShowTrainDepotWindow(tile);
  1350 					ShowBuildTrainWindow(tile);
  1351 					ShowBuildTrainWindow(tile);
  1351 					return;
  1352 					return;
  1352 				}
  1353 				}
  1353 
  1354