Changeset - r4541:a0183e9d0c1c
[Not reviewed]
master
0 5 0
bjarni - 18 years ago 2006-09-03 23:14:39
bjarni@openttd.org
(svn r6370) -Codechange: moved all the remaining setup for PlayerVehWndProc() into WE_CREATE
5 files changed with 13 insertions and 28 deletions:
0 comments (0 inline, 0 general)
aircraft_gui.c
Show inline comments
 
@@ -1031,18 +1031,12 @@ void ShowPlayerAircraftLocal(PlayerID pl
 
		if (player == _local_player) {
 
			w = AllocateWindowDescFront(&_player_aircraft_desc, (station << 16) | (VEH_Aircraft << 11) | VLW_flag | player);
 
		} else  {
 
			w = AllocateWindowDescFront(&_other_player_aircraft_desc, (station << 16) | (VEH_Aircraft << 11) | VLW_flag | player);
 
		}
 
	}
 

	
 
	if (w != NULL) {
 
		w->vscroll.cap = 4;
 
		w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
 
		w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_BIG;
 
	}
 
}
 

	
 
void ShowPlayerAircraft(PlayerID player, StationID station)
 
{
 
	ShowPlayerAircraftLocal(player, station, INVALID_ORDER, false);
 
}
roadveh_gui.c
Show inline comments
 
@@ -960,19 +960,12 @@ static void ShowPlayerRoadVehiclesLocal(
 
		if (player == _local_player) {
 
			w = AllocateWindowDescFront(&_player_roadveh_desc, (station << 16) | (VEH_Road << 11) | VLW_flag | player);
 
		} else  {
 
			w = AllocateWindowDescFront(&_other_player_roadveh_desc, (station << 16) | (VEH_Road << 11) | VLW_flag | player);
 
		}
 
	}
 

	
 
	if (w != NULL) {
 
		w->vscroll.cap = 7; // maximum number of vehicles shown
 
		w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
 
		w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_SMALL;
 
		w->resize.height = 220 - (PLY_WND_PRC__SIZE_OF_ROW_SMALL * 3); /* Minimum of 4 vehicles */
 
	}
 
}
 

	
 
void ShowPlayerRoadVehicles(PlayerID player, StationID station)
 
{
 
	ShowPlayerRoadVehiclesLocal(player, station, 0, false);
 
}
ship_gui.c
Show inline comments
 
@@ -973,18 +973,12 @@ static void ShowPlayerShipsLocal(PlayerI
 
		if (player == _local_player) {
 
			w = AllocateWindowDescFront(&_player_ships_desc, (station << 16) | (VEH_Ship << 11) | VLW_flag | player);
 
		} else  {
 
			w = AllocateWindowDescFront(&_other_player_ships_desc, (station << 16) | (VEH_Ship << 11) | VLW_flag | player);
 
		}
 
	}
 

	
 
	if (w != NULL) {
 
		w->vscroll.cap = 4;
 
		w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
 
		w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_BIG;
 
	}
 
}
 

	
 
void ShowPlayerShips(PlayerID player, StationID station)
 
{
 
	ShowPlayerShipsLocal(player, station, 0, false);
 
}
train_gui.c
Show inline comments
 
@@ -1431,21 +1431,12 @@ static void ShowPlayerTrainsLocal(Player
 
		if (player == _local_player) {
 
			w = AllocateWindowDescFront(&_player_trains_desc, (station << 16) | (VEH_Train << 11) | VLW_flag | player);
 
		} else  {
 
			w = AllocateWindowDescFront(&_other_player_trains_desc, (station << 16) | (VEH_Train << 11) | VLW_flag | player);
 
		}
 
	}
 

	
 
	if (w != NULL) {
 
		w->hscroll.cap = 10 * 29;
 
		w->vscroll.cap = 7; // maximum number of vehicles shown
 
		w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
 
		w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_SMALL;
 
		w->resize.step_width = 1;
 
		w->resize.height = 220 - (PLY_WND_PRC__SIZE_OF_ROW_SMALL * 3); /* Minimum of 4 vehicles */
 
	}
 
}
 

	
 
void ShowPlayerTrains(PlayerID player, StationID station)
 
{
 
	ShowPlayerTrainsLocal(player, station, INVALID_ORDER, false);
 
}
vehicle_gui.c
Show inline comments
 
@@ -1362,12 +1362,14 @@ void PlayerVehWndProc(Window *w, WindowE
 
			break;
 

	
 
		case WE_CREATE:
 
			w->caption_color = GB(w->window_number, 0, 8); // OwnerID is stored in the last 8 bits of the window number
 
			switch (vehicle_type) {
 
				case VEH_Train:
 
					w->hscroll.cap = 10 * 29;
 
					w->resize.step_width = 1;
 
					vl->flags = VL_REBUILD | (_sorting.train.order << (VL_DESC - 1));
 
					vl->sort_type = _sorting.train.criteria;
 
					break;
 
				case VEH_Road:
 
					vl->flags = VL_REBUILD | (_sorting.roadveh.order << (VL_DESC - 1));
 
					vl->sort_type = _sorting.roadveh.criteria;
 
@@ -1379,12 +1381,23 @@ void PlayerVehWndProc(Window *w, WindowE
 
				case VEH_Aircraft:
 
					vl->flags = VL_REBUILD | (_sorting.aircraft.order << (VL_DESC - 1));
 
					vl->sort_type = _sorting.aircraft.criteria;
 
					break;
 
				default: NOT_REACHED(); break;
 
			}
 

	
 
			if (vehicle_type == VEH_Ship || vehicle_type == VEH_Aircraft) {
 
				w->vscroll.cap = 4;
 
				w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_BIG;
 
			} else {
 
				w->vscroll.cap = 7;
 
				w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_SMALL;
 
				w->resize.height = 220 - (PLY_WND_PRC__SIZE_OF_ROW_SMALL * 3); // Minimum of 4 vehicles
 
			}
 

	
 
			w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
 
			vl->sort_list = NULL;
 
			vl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;	// Set up resort timer
 
			break;
 

	
 
		case WE_DESTROY:
 
			free((void*)vl->sort_list);
0 comments (0 inline, 0 general)