# vehicle_gui.cpp File Reference

The base GUI for all vehicles. More...

`#include "stdafx.h"`
`#include "openttd.h"`
`#include "debug.h"`
`#include "company_func.h"`
`#include "gui.h"`
`#include "window_gui.h"`
`#include "textbuf_gui.h"`
`#include "command_func.h"`
`#include "vehicle_gui.h"`
`#include "vehicle_gui_base.h"`
`#include "viewport_func.h"`
`#include "gfx_func.h"`
`#include "newgrf_engine.h"`
`#include "newgrf_text.h"`
`#include "station_map.h"`
`#include "roadveh.h"`
`#include "depot_base.h"`
`#include "group_gui.h"`
`#include "strings_func.h"`
`#include "window_func.h"`
`#include "vehicle_func.h"`
`#include "autoreplace_gui.h"`
`#include "string_func.h"`
`#include "widgets/dropdown_func.h"`
`#include "timetable.h"`
`#include "vehiclelist.h"`
`#include "settings_type.h"`
`#include "articulated_vehicles.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Data Structures
struct | RefitOption
struct | RefitList
struct | RefitWindow
struct | VehicleListWindow
| Window for the (old) vehicle listing. More...
struct | VehicleDetailsWindow
struct | VehicleViewWindow
## Enumerations
enum | VehicleListWindowWidgets { VLW_WIDGET_CLOSEBOX = 0, VLW_WIDGET_CAPTION, VLW_WIDGET_STICKY, VLW_WIDGET_SORT_ORDER, VLW_WIDGET_SORT_BY_PULLDOWN, VLW_WIDGET_EMPTY_TOP_RIGHT, VLW_WIDGET_LIST, VLW_WIDGET_SCROLLBAR, VLW_WIDGET_OTHER_COMPANY_FILLER, VLW_WIDGET_AVAILABLE_VEHICLES, VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN, VLW_WIDGET_STOP_ALL, VLW_WIDGET_START_ALL, VLW_WIDGET_EMPTY_BOTTOM_RIGHT, VLW_WIDGET_RESIZE }
enum | VehicleDetailsWindowWidgets { VLD_WIDGET_CLOSEBOX = 0, VLD_WIDGET_CAPTION, VLD_WIDGET_RENAME_VEHICLE, VLD_WIDGET_STICKY, VLD_WIDGET_TOP_DETAILS, VLD_WIDGET_INCREASE_SERVICING_INTERVAL, VLD_WIDGET_DECREASE_SERVICING_INTERVAL, VLD_WIDGET_BOTTOM_RIGHT, VLD_WIDGET_MIDDLE_DETAILS, VLD_WIDGET_SCROLLBAR, VLD_WIDGET_DETAILS_CARGO_CARRIED, VLD_WIDGET_DETAILS_TRAIN_VEHICLES, VLD_WIDGET_DETAILS_CAPACITY_OF_EACH, VLD_WIDGET_DETAILS_TOTAL_CARGO, VLD_WIDGET_RESIZE }
| Constants of vehicle details widget indices.
enum | VehicleStringTranslation { VST_VEHICLE_AGE_RUNNING_COST_YR, VST_VEHICLE_MAX_SPEED, VST_VEHICLE_PROFIT_THIS_YEAR_LAST_YEAR, VST_VEHICLE_RELIABILITY_BREAKDOWNS }
| Command indices for the _vehicle_command_translation_table. More...
enum | VehicleCommandTranslation { VCT_CMD_START_STOP = 0, VCT_CMD_GOTO_DEPOT, VCT_CMD_CLONE_VEH, VCT_CMD_TURN_AROUND }
| Command indices for the _vehicle_command_translation_table. More...
## Functions
void | DepotSortList (VehicleList *list)
void | DrawVehicleProfitButton (const Vehicle *v, int x, int y)
| draw the vehicle profit button in the vehicle list window.
static RefitList * | BuildRefitList (const Vehicle *v)
static RefitOption * | DrawVehicleRefitWindow (const RefitList *list, int sel, uint pos, uint rows, uint delta)
| Draw the list of available refit options for a consist.
void | ShowVehicleRefitWindow (const Vehicle *v, VehicleOrderID order, Window *parent)
| Show the refit window for a vehicle.
uint | ShowAdditionalText (int x, int y, uint w, EngineID engine)
| Display additional text from NewGRF in the purchase information window.
uint | ShowRefitOptionsList (int x, int y, uint w, EngineID engine)
| Display list of cargo types of the engine, for the purchase information window.
StringID | GetCargoSubtypeText (const Vehicle *v)
| Get the cargo subtype text from NewGRF for the vehicle details window.
static int CDECL | VehicleNumberSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by their number.
static int CDECL | VehicleNameSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by their name.
static int CDECL | VehicleAgeSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by their age.
static int CDECL | VehicleProfitThisYearSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by this year profit.
static int CDECL | VehicleProfitLastYearSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by last year profit.
static int CDECL | VehicleCargoSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by their cargo.
static int CDECL | VehicleReliabilitySorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by their reliability.
static int CDECL | VehicleMaxSpeedSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by their max speed.
static int CDECL | VehicleModelSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by model.
static int CDECL | VehicleValueSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehciles by their value.
static int CDECL | VehicleLengthSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by their length.
static int CDECL | VehicleTimeToLiveSorter (const Vehicle *const *a, const Vehicle *const *b)
| Sort vehicles by the time they can still live.
void | InitializeGUI ()
static void | ChangeVehicleWindow (WindowClass window_class, VehicleID from_index, VehicleID to_index)
| Assign a vehicle window a new vehicle.
void | ChangeVehicleViewWindow (VehicleID from_index, VehicleID to_index)
| Report a change in vehicle IDs (due to autoreplace) to affected vehicle windows.
static void | DrawSmallOrderList (const Vehicle *v, int x, int y)
static void | DrawVehicleImage (const Vehicle *v, int x, int y, VehicleID selection, int count, int skip)
static void | ShowVehicleListWindowLocal (CompanyID company, uint16 VLW_flag, VehicleType vehicle_type, uint16 unique_number)
void | ShowVehicleListWindow (CompanyID company, VehicleType vehicle_type)
void | ShowVehicleListWindow (const Waypoint *wp)
void | ShowVehicleListWindow (const Vehicle *v)
void | ShowVehicleListWindow (CompanyID company, VehicleType vehicle_type, StationID station)
void | ShowVehicleListWindow (CompanyID company, VehicleType vehicle_type, TileIndex depot_tile)
int | GetTrainDetailsWndVScroll (VehicleID veh_id, byte det_tab)
void | DrawTrainDetails (const Vehicle *v, int x, int y, int vscroll_pos, uint16 vscroll_cap, byte det_tab)
void | DrawRoadVehDetails (const Vehicle *v, int x, int y)
void | DrawShipDetails (const Vehicle *v, int x, int y)
| Draw the details for the given vehicle at the position (x, y).
void | DrawAircraftDetails (const Vehicle *v, int x, int y)
| Draw the details for the given vehicle at the position (x, y).
static void | ShowVehicleDetailsWindow (const Vehicle *v)
| Shows the vehicle details window of the given vehicle.
| assert_compile (VEH_TRAIN==0)
| assert_compile (VEH_ROAD==1)
| assert_compile (VEH_SHIP==2)
| assert_compile (VEH_AIRCRAFT==3)
static bool | IsVehicleRefitable (const Vehicle *v)
| Checks whether the vehicle may be refitted at the moment.
void | ShowVehicleViewWindow (const Vehicle *v)
| Shows the vehicle view window of the given vehicle.
void | StopGlobalFollowVehicle (const Vehicle *v)
## Variables
Sorting | _sorting
static GUIVehicleList::SortFunction | VehicleNumberSorter
static GUIVehicleList::SortFunction | VehicleNameSorter
static GUIVehicleList::SortFunction | VehicleAgeSorter
static GUIVehicleList::SortFunction | VehicleProfitThisYearSorter
static GUIVehicleList::SortFunction | VehicleProfitLastYearSorter
static GUIVehicleList::SortFunction | VehicleCargoSorter
static GUIVehicleList::SortFunction | VehicleReliabilitySorter
static GUIVehicleList::SortFunction | VehicleMaxSpeedSorter
static GUIVehicleList::SortFunction | VehicleModelSorter
static GUIVehicleList::SortFunction | VehicleValueSorter
static GUIVehicleList::SortFunction | VehicleLengthSorter
static GUIVehicleList::SortFunction | VehicleTimeToLiveSorter
static const Vehicle * | _last_vehicle [2] = { NULL, NULL }
static const Widget | _vehicle_refit_widgets []
static const WindowDesc | _vehicle_refit_desc (WDP_AUTO, WDP_AUTO, 240, 174, 240, 174, WC_VEHICLE_REFIT, WC_VEHICLE_VIEW, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_RESIZABLE|WDF_CONSTRUCTION, _vehicle_refit_widgets)
static const Widget | _vehicle_list_widgets []
static WindowDesc | _vehicle_list_desc (WDP_AUTO, WDP_AUTO, 260, 194, 260, 246, WC_INVALID, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _vehicle_list_widgets)
static const Widget | _vehicle_details_widgets []
| Vehicle details widgets.
static const StringID | _vehicle_translation_table [][4]
| Command codes for the shared buttons indexed by VehicleCommandTranslation and vehicle type.
static const WindowDesc | _vehicle_details_desc (WDP_AUTO, WDP_AUTO, 405, 113, 405, 113, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _vehicle_details_widgets)
| Vehicle details window descriptor.
static const Widget | _vehicle_view_widgets []
| Vehicle view widgets.
static const WindowDesc | _vehicle_view_desc (WDP_AUTO, WDP_AUTO, 250, 116, 250, 116, WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _vehicle_view_widgets)
| Vehicle view window descriptor for all vehicles but trains.
static const WindowDesc | _train_view_desc (WDP_AUTO, WDP_AUTO, 250, 134, 250, 134, WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _vehicle_view_widgets)
| Vehicle view window descriptor for trains.
static const ZoomLevel | _vehicle_view_zoom_levels []
| Zoom levels for vehicle views indexed by vehicle type.
static const int | VV_VIEWPORT_X = 3
static const int | VV_VIEWPORT_Y = 17
static const int | VV_INITIAL_VIEWPORT_WIDTH = 226
static const int | VV_INITIAL_VIEWPORT_HEIGHT = 84
static const int | VV_INITIAL_VIEWPORT_HEIGHT_TRAIN = 102
static const uint32 | _vehicle_command_translation_table [][4]
| Command codes for the shared buttons indexed by VehicleCommandTranslation and vehicle type.

## Detailed Description

The base GUI for all vehicles.

Definition in file vehicle_gui.cpp.

## Enumeration Type Documentation

enum VehicleCommandTranslation

Command indices for the _vehicle_command_translation_table.

Definition at line 1632 of file vehicle_gui.cpp.

enum VehicleStringTranslation

Command indices for the _vehicle_command_translation_table.

Definition at line 1244 of file vehicle_gui.cpp.

## Function Documentation

void ChangeVehicleViewWindow | ( | VehicleID | from_index,
|  | VehicleID | to_index |
| ) |  |  |

Report a change in vehicle IDs (due to autoreplace) to affected vehicle windows.

Parameters:

  | from_index | the old vehicle ID
  | to_index | the new vehicle ID

Definition at line 675 of file vehicle_gui.cpp.

References ChangeVehicleWindow().

Referenced by CopyHeadSpecificThings().

static void ChangeVehicleWindow | ( | WindowClass | window_class,
|  | VehicleID | from_index,
|  | VehicleID | to_index |
| ) |  |  | `[inline, static]`

Assign a vehicle window a new vehicle.

Parameters:

  | window_class | WindowClass to search for
  | from_index | the old vehicle ID
  | to_index | the new vehicle ID

Definition at line 660 of file vehicle_gui.cpp.

References FindWindowById(), ViewportData::follow_vehicle, InvalidateThisWindowData(), Window::viewport, and Window::window_number.

Referenced by ChangeVehicleViewWindow().

void DrawAircraftDetails | ( | const Vehicle * | v,
|  | int | x,
|  | int | y |
| ) |  |  |

Draw the details for the given vehicle at the position (x, y).

Parameters:

  | v | current vehicle
  | x | The x coordinate
  | y | The y coordinate

Definition at line 24 of file aircraft_gui.cpp.

References DrawString(), GetCargoSubtypeText(), and IsNormalAircraft().

void DrawShipDetails | ( | const Vehicle * | v,
|  | int | x,
|  | int | y |
| ) |  |  |

Draw the details for the given vehicle at the position (x, y).

Parameters:

  | v | current vehicle
  | x | The x coordinate
  | y | The y coordinate

Definition at line 44 of file ship_gui.cpp.

References DrawString(), and GetCargoSubtypeText().

void DrawVehicleProfitButton | ( | const Vehicle * | v,
|  | int | x,
|  | int | y |
| ) |  |  |

draw the vehicle profit button in the vehicle list window.

Definition at line 112 of file vehicle_gui.cpp.

References DAYS_IN_YEAR, and DrawSprite().

static RefitOption* DrawVehicleRefitWindow | ( | const RefitList * | list,
|  | int | sel,
|  | uint | pos,
|  | uint | rows,
|  | uint | delta |
| ) |  |  | `[static]`

Draw the list of available refit options for a consist.

Draw the list and highlight the selected refit option (if any)

Parameters:

  | *list | first vehicle in consist to get the refit-options of
  | sel | selected refit cargo-type in the window
  | pos | position of the selected item in caller widow
  | rows | number of rows(capacity) in caller window
  | delta | step height in caller window

Returns:
  the refit option that is hightlighted, NULL if none

Definition at line 233 of file vehicle_gui.cpp.

References CALLBACK_FAILED, DrawString(), GetEngineGRFID(), GetGRFStringID(), and GetNewVehiclePosResult::y.

StringID GetCargoSubtypeText | ( | const Vehicle * | v | ) |

Get the cargo subtype text from NewGRF for the vehicle details window.

Definition at line 504 of file vehicle_gui.cpp.

References CALLBACK_FAILED, CBID_VEHICLE_CARGO_SUFFIX, CBM_VEHICLE_CARGO_SUFFIX, GetEngineGRFID(), GetGRFStringID(), GetVehicleCallback(), and HasBit().

Referenced by DrawAircraftDetails(), and DrawShipDetails().

static bool IsVehicleRefitable | ( | const Vehicle * | v | ) | `[static]`

Checks whether the vehicle may be refitted at the moment.

Definition at line 1669 of file vehicle_gui.cpp.

References IsEngineRefittable().

static void ShowVehicleDetailsWindow | ( | const Vehicle * | v | ) | `[static]`

Shows the vehicle details window of the given vehicle.

Definition at line 1558 of file vehicle_gui.cpp.

References _vehicle_details_desc, and DeleteWindowById().

void ShowVehicleRefitWindow | ( | const Vehicle * | v,
|  | VehicleOrderID | order,
|  | Window * | parent |
| ) |  |  |

Show the refit window for a vehicle.

Parameters:

  | *v | The vehicle to show the refit window for
  | order | of the vehicle ( ? )

Definition at line 431 of file vehicle_gui.cpp.

References DeleteWindowById().

void ShowVehicleViewWindow | ( | const Vehicle * | v | ) |

Shows the vehicle view window of the given vehicle.

Definition at line 2034 of file vehicle_gui.cpp.

References _train_view_desc, and _vehicle_view_desc.

Referenced by CcBuildAircraft(), CcCloneVehicle(), CmdSellRailWagon(), and VehicleListWindow::OnClick().

## Variable Documentation

const WindowDesc _train_view_desc(WDP_AUTO, WDP_AUTO, 250, 134, 250, 134, WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _vehicle_view_widgets)`[static]`

Vehicle view window descriptor for trains.

Only minimum_height and default_height are different for train view.

Referenced by ShowVehicleViewWindow().

const uint32 _vehicle_command_translation_table[][4]`[static]`

Initial value:

     {
      {
        CMD_START_STOP_VEHICLE | CMD_MSG(STR_883B_CAN_T_STOP_START_TRAIN),
        CMD_START_STOP_VEHICLE | CMD_MSG(STR_9015_CAN_T_STOP_START_ROAD_VEHICLE),
        CMD_START_STOP_VEHICLE | CMD_MSG(STR_9818_CAN_T_STOP_START_SHIP),
        CMD_START_STOP_VEHICLE | CMD_MSG(STR_A016_CAN_T_STOP_START_AIRCRAFT)
      },
      {

        CMD_SEND_TRAIN_TO_DEPOT | CMD_NO_TEST_IF_IN_NETWORK | CMD_MSG(STR_8830_CAN_T_SEND_TRAIN_TO_DEPOT),
        CMD_SEND_ROADVEH_TO_DEPOT | CMD_MSG(STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT),
        CMD_SEND_SHIP_TO_DEPOT | CMD_MSG(STR_9819_CAN_T_SEND_SHIP_TO_DEPOT),
        CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_MSG(STR_A012_CAN_T_SEND_AIRCRAFT_TO)
      },
      {
        CMD_CLONE_VEHICLE | CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE),
        CMD_CLONE_VEHICLE | CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE),
        CMD_CLONE_VEHICLE | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP),
        CMD_CLONE_VEHICLE | CMD_MSG(STR_A008_CAN_T_BUILD_AIRCRAFT)
      },
      {
        CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN),
        CMD_TURN_ROADVEH | CMD_MSG(STR_ERROR_CAN_T_MAKE_ROAD_VEHICLE_TURN),
        0xffffffff,
        0xffffffff
      },
    }

Command codes for the shared buttons indexed by VehicleCommandTranslation and vehicle type.

Definition at line 1640 of file vehicle_gui.cpp.

const WindowDesc _vehicle_details_desc(WDP_AUTO, WDP_AUTO, 405, 113, 405, 113, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _vehicle_details_widgets)`[static]`

Vehicle details window descriptor.

Referenced by ShowVehicleDetailsWindow().

const Widget _vehicle_details_widgets[]`[static]`

Initial value:

     {
      {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,   0,  10,   0,  13, STR_00C5,             STR_018B_CLOSE_WINDOW},
      {    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,  11, 352,   0,  13, 0x0,                  STR_018C_WINDOW_TITLE_DRAG_THIS},
      { WWT_PUSHTXTBTN,     RESIZE_LR,  COLOUR_GREY, 353, 392,   0,  13, STR_01AA_NAME,        STR_NULL },
      {  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_GREY, 393, 404,   0,  13, STR_NULL,             STR_STICKY_BUTTON},
      {      WWT_PANEL,  RESIZE_RIGHT,  COLOUR_GREY,   0, 404,  14,  55, 0x0,                  STR_NULL},
      { WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,   0,  10, 101, 106, STR_0188,             STR_884D_INCREASE_SERVICING_INTERVAL},
      { WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,   0,  10, 107, 112, STR_0189,             STR_884E_DECREASE_SERVICING_INTERVAL},
      {      WWT_PANEL,    RESIZE_RTB,  COLOUR_GREY,  11, 404, 101, 112, 0x0,                  STR_NULL},
      {     WWT_MATRIX,     RESIZE_RB,  COLOUR_GREY,   0, 392,  56, 100, 0x701,                STR_NULL},
      {  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_GREY, 393, 404,  56, 100, 0x0,                  STR_0190_SCROLL_BAR_SCROLLS_LIST},
      { WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,   0,  95, 113, 124, STR_013C_CARGO,       STR_884F_SHOW_DETAILS_OF_CARGO_CARRIED},
      { WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,  96, 194, 113, 124, STR_013D_INFORMATION, STR_8850_SHOW_DETAILS_OF_TRAIN_VEHICLES},
      { WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY, 195, 293, 113, 124, STR_013E_CAPACITIES,  STR_8851_SHOW_CAPACITIES_OF_EACH},
      { WWT_PUSHTXTBTN,    RESIZE_RTB,  COLOUR_GREY, 294, 392, 113, 124, STR_TOTAL_CARGO,      STR_SHOW_TOTAL_CARGO},
      {  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY, 393, 404, 113, 124, 0x0,                  STR_RESIZE_BUTTON},
      {   WIDGETS_END},
    }

Vehicle details widgets.

Definition at line 1223 of file vehicle_gui.cpp.

const Widget _vehicle_list_widgets[]`[static]`

Initial value:

     {
      {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,             STR_018B_CLOSE_WINDOW},
      {    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,    11,   247,     0,    13, 0x0,                  STR_018C_WINDOW_TITLE_DRAG_THIS},
      {  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_GREY,   248,   259,     0,    13, 0x0,                  STR_STICKY_BUTTON},
      { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,    80,    14,    25, STR_SORT_BY,          STR_SORT_ORDER_TIP},
      {   WWT_DROPDOWN,   RESIZE_NONE,  COLOUR_GREY,    81,   247,    14,    25, 0x0,                  STR_SORT_CRITERIA_TIP},
      {      WWT_PANEL,  RESIZE_RIGHT,  COLOUR_GREY,   248,   259,    14,    25, 0x0,                  STR_NULL},
      {     WWT_MATRIX,     RESIZE_RB,  COLOUR_GREY,     0,   247,    26,   181, 0x0,                  STR_NULL},
      {  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_GREY,   248,   259,    26,   181, 0x0,                  STR_0190_SCROLL_BAR_SCROLLS_LIST},

      {      WWT_PANEL,    RESIZE_RTB,  COLOUR_GREY,     0,   247,   182,   193, 0x0,                  STR_NULL},

      { WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,     0,   105,   182,   193, 0x0,                  STR_AVAILABLE_ENGINES_TIP},
      {   WWT_DROPDOWN,     RESIZE_TB,  COLOUR_GREY,   106,   223,   182,   193, STR_MANAGE_LIST,      STR_MANAGE_LIST_TIP},

      { WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,   224,   235,   182,   193, SPR_FLAG_VEH_STOPPED, STR_MASS_STOP_LIST_TIP},
      { WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,   236,   247,   182,   193, SPR_FLAG_VEH_RUNNING, STR_MASS_START_LIST_TIP},
      {      WWT_PANEL,    RESIZE_RTB,  COLOUR_GREY,   248,   247,   182,   193, 0x0,                  STR_NULL},
      {  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY,   248,   259,   182,   193, 0x0,                  STR_RESIZE_BUTTON},
      {   WIDGETS_END},
    }

Definition at line 702 of file vehicle_gui.cpp.

const Widget _vehicle_refit_widgets[]`[static]`

Initial value:

     {
      {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                            STR_018B_CLOSE_WINDOW},
      {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   239,     0,    13, STR_983B_REFIT,                      STR_018C_WINDOW_TITLE_DRAG_THIS},
      {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,   239,    14,    27, STR_983F_SELECT_CARGO_TYPE_TO_CARRY, STR_NULL},

      {     WWT_MATRIX, RESIZE_BOTTOM,  COLOUR_GREY,     0,   227,    28,   139, 0x801,                               STR_EMPTY},
      {  WWT_SCROLLBAR, RESIZE_BOTTOM,  COLOUR_GREY,   228,   239,    28,   139, 0x0,                                 STR_0190_SCROLL_BAR_SCROLLS_LIST},
      {      WWT_PANEL,     RESIZE_TB,  COLOUR_GREY,     0,   239,   140,   161, 0x0,                                 STR_NULL},
      { WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,     0,   227,   162,   173, 0x0,                                 STR_NULL},
      {  WWT_RESIZEBOX,     RESIZE_TB,  COLOUR_GREY,   228,   239,   162,   173, 0x0,                                 STR_RESIZE_BUTTON},
      {   WIDGETS_END},
    }

Definition at line 407 of file vehicle_gui.cpp.

const StringID _vehicle_translation_table[][4]`[static]`

Initial value:

     {
      {
        STR_885D_AGE_RUNNING_COST_YR,
        STR_900D_AGE_RUNNING_COST_YR,
        STR_9812_AGE_RUNNING_COST_YR,
        STR_A00D_AGE_RUNNING_COST_YR,
      },
      {
        STR_NULL,
        STR_900E_MAX_SPEED,
        STR_9813_MAX_SPEED,
        STR_A00E_MAX_SPEED,
      },
      {
        STR_885F_PROFIT_THIS_YEAR_LAST_YEAR,
        STR_900F_PROFIT_THIS_YEAR_LAST_YEAR,
        STR_9814_PROFIT_THIS_YEAR_LAST_YEAR,
        STR_A00F_PROFIT_THIS_YEAR_LAST_YEAR,
      },
      {
        STR_8860_RELIABILITY_BREAKDOWNS,
        STR_9010_RELIABILITY_BREAKDOWNS,
        STR_9815_RELIABILITY_BREAKDOWNS,
        STR_A010_RELIABILITY_BREAKDOWNS,
      },
    }

Command codes for the shared buttons indexed by VehicleCommandTranslation and vehicle type.

Definition at line 1252 of file vehicle_gui.cpp.

const WindowDesc _vehicle_view_desc(WDP_AUTO, WDP_AUTO, 250, 116, 250, 116, WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _vehicle_view_widgets)`[static]`

Vehicle view window descriptor for all vehicles but trains.

Referenced by ShowVehicleViewWindow().

const Widget _vehicle_view_widgets[]`[static]`

Initial value:

     {
      {   WWT_CLOSEBOX,  RESIZE_NONE,  COLOUR_GREY,   0,  10,   0,  13, STR_00C5,                 STR_018B_CLOSE_WINDOW },
      {    WWT_CAPTION, RESIZE_RIGHT,  COLOUR_GREY,  11, 237,   0,  13, 0x0 ,   STR_018C_WINDOW_TITLE_DRAG_THIS },
      {  WWT_STICKYBOX,    RESIZE_LR,  COLOUR_GREY, 238, 249,   0,  13, 0x0,                      STR_STICKY_BUTTON },
      {      WWT_PANEL,    RESIZE_RB,  COLOUR_GREY,   0, 231,  14, 103, 0x0,                      STR_NULL },
      {      WWT_INSET,    RESIZE_RB,  COLOUR_GREY,   2, 229,  16, 101, 0x0,                      STR_NULL },
      {    WWT_PUSHBTN,   RESIZE_RTB,  COLOUR_GREY,   0, 237, 104, 115, 0x0,                      0x0  },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  14,  31, SPR_CENTRE_VIEW_VEHICLE,  0x0  },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  32,  49, 0x0 ,   0x0  },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  50,  67, SPR_REFIT_VEHICLE,        0x0  },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  68,  85, SPR_SHOW_ORDERS,          0x0  },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  86, 103, SPR_SHOW_VEHICLE_DETAILS, 0x0  },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  32,  49, 0x0 ,   0x0  },
      {      WWT_PANEL,   RESIZE_LRB,  COLOUR_GREY, 232, 249, 104, 103, 0x0,                      STR_NULL },
      {  WWT_RESIZEBOX,  RESIZE_LRTB,  COLOUR_GREY, 238, 249, 104, 115, 0x0,                      STR_NULL },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  50,  67, SPR_FORCE_VEHICLE_TURN,   STR_9020_FORCE_VEHICLE_TO_TURN_AROUND },
      { WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  50,  67, SPR_IGNORE_SIGNALS,       STR_884A_FORCE_TRAIN_TO_PROCEED },
    {   WIDGETS_END},
    }

Vehicle view widgets.

Definition at line 1569 of file vehicle_gui.cpp.

const ZoomLevel _vehicle_view_zoom_levels[]`[static]`

Initial value:

     {
      ZOOM_LVL_TRAIN,
      ZOOM_LVL_ROADVEH,
      ZOOM_LVL_SHIP,
      ZOOM_LVL_AIRCRAFT,
    }

Zoom levels for vehicle views indexed by vehicle type.

Definition at line 1617 of file vehicle_gui.cpp.