File diff r9142:8eefd8081b0a → r9143:e484ce861c88
src/vehicle_gui.cpp
Show inline comments
 
@@ -448,13 +448,13 @@ static const WindowDesc _vehicle_refit_d
 
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order)
 
{
 
	Window *w;
 

	
 
	DeleteWindowById(WC_VEHICLE_REFIT, v->index);
 

	
 
	w = AllocateWindowDescFront(&_vehicle_refit_desc, v->index);
 
	w = AllocateWindowDescFront<Window>(&_vehicle_refit_desc, v->index);
 
	WP(w, refit_d).order = order;
 

	
 
	if (w != NULL) {
 
		w->caption_color = v->owner;
 
		w->vscroll.cap = 8;
 
		w->resize.step_height = 14;
 
@@ -1241,24 +1241,24 @@ static void ShowVehicleListWindowLocal(P
 
	/* The vehicle list windows have been unified. Just some strings need
 
	 * to be changed which happens in the WE_CREATE event and resizing
 
	 * some of the windows to the correct size */
 
	switch (vehicle_type) {
 
		default: NOT_REACHED();
 
		case VEH_TRAIN:
 
			w = AllocateWindowDescFront(&_player_vehicle_list_train_desc, num);
 
			w = AllocateWindowDescFront<Window>(&_player_vehicle_list_train_desc, num);
 
			if (w != NULL) ResizeWindow(w, 65, 38);
 
			break;
 
		case VEH_ROAD:
 
			w = AllocateWindowDescFront(&_player_vehicle_list_road_veh_desc, num);
 
			w = AllocateWindowDescFront<Window>(&_player_vehicle_list_road_veh_desc, num);
 
			if (w != NULL) ResizeWindow(w, 0, 38);
 
			break;
 
		case VEH_SHIP:
 
			w = AllocateWindowDescFront(&_player_vehicle_list_ship_desc, num);
 
			w = AllocateWindowDescFront<Window>(&_player_vehicle_list_ship_desc, num);
 
			break;
 
		case VEH_AIRCRAFT:
 
			w = AllocateWindowDescFront(&_player_vehicle_list_aircraft_desc, num);
 
			w = AllocateWindowDescFront<Window>(&_player_vehicle_list_aircraft_desc, num);
 
			break;
 
	}
 

	
 
	if (w != NULL) {
 
		/* Set the minimum window size to the current window size */
 
		w->resize.width = w->width;
 
@@ -1668,13 +1668,13 @@ static const WindowDesc _vehicle_details
 

	
 
/** Shows the vehicle details window of the given vehicle. */
 
static void ShowVehicleDetailsWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_ORDERS, v->index);
 
	DeleteWindowById(WC_VEHICLE_DETAILS, v->index);
 
	AllocateWindowDescFront(&_vehicle_details_desc, v->index);
 
	AllocateWindowDescFront<Window>(&_vehicle_details_desc, v->index);
 
}
 

	
 

	
 
/* Unified vehicle GUI - Vehicle View Window */
 

	
 
/** Vehicle view widgets. */
 
@@ -1744,13 +1744,13 @@ static const int VV_INITIAL_VIEWPORT_WID
 
static const int VV_INITIAL_VIEWPORT_HEIGHT = 84;
 
static const int VV_INITIAL_VIEWPORT_HEIGHT_TRAIN = 102;
 

	
 
/** Shows the vehicle view window of the given vehicle. */
 
void ShowVehicleViewWindow(const Vehicle *v)
 
{
 
	Window *w = AllocateWindowDescFront((v->type == VEH_TRAIN) ? &_train_view_desc : &_vehicle_view_desc, v->index);
 
	Window *w = AllocateWindowDescFront<Window>((v->type == VEH_TRAIN) ? &_train_view_desc : &_vehicle_view_desc, v->index);
 

	
 
	if (w != NULL) {
 
		w->caption_color = v->owner;
 
		InitializeWindowViewport(w, VV_VIEWPORT_X, VV_VIEWPORT_Y, VV_INITIAL_VIEWPORT_WIDTH,
 
												 (v->type == VEH_TRAIN) ? VV_INITIAL_VIEWPORT_HEIGHT_TRAIN : VV_INITIAL_VIEWPORT_HEIGHT,
 
												 w->window_number | (1 << 31), _vehicle_view_zoom_levels[v->type]);