# rail_gui.cpp File Reference

File for dealing with rail construction user interface. More...

`#include "stdafx.h"`
`#include "gui.h"`
`#include "window_gui.h"`
`#include "station_gui.h"`
`#include "terraform_gui.h"`
`#include "viewport_func.h"`
`#include "gfx_func.h"`
`#include "command_func.h"`
`#include "waypoint.h"`
`#include "newgrf_station.h"`
`#include "company_base.h"`
`#include "strings_func.h"`
`#include "functions.h"`
`#include "window_func.h"`
`#include "date_func.h"`
`#include "sound_func.h"`
`#include "company_func.h"`
`#include "widgets/dropdown_type.h"`
`#include "tunnelbridge.h"`
`#include "tilehighlight_func.h"`
`#include "settings_type.h"`
`#include "station_map.h"`
`#include "tunnelbridge_map.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Data Structures
struct | RailStationGUISettings
struct | RailBuildingGUIButtonData
| Data associated with a push button in the build rail toolbar window. More...
struct | BuildRailToolbarWindow
| Based on the widget clicked, update the status of the 'remove' button. More...
struct | BuildRailStationWindow
struct | BuildSignalWindow
struct | BuildRailDepotWindow
struct | BuildRailWaypointWindow
## Typedefs
typedef void | OnButtonClick (Window *w)
## Enumerations
enum | RailToolbarWidgets { RTW_CLOSEBOX = 0, RTW_CAPTION, RTW_STICKY, RTW_SPACER, RTW_BUILD_NS, RTW_BUILD_X, RTW_BUILD_EW, RTW_BUILD_Y, RTW_AUTORAIL, RTW_DEMOLISH, RTW_BUILD_DEPOT, RTW_BUILD_WAYPOINT, RTW_BUILD_STATION, RTW_BUILD_SIGNALS, RTW_BUILD_BRIDGE, RTW_BUILD_TUNNEL, RTW_REMOVE, RTW_CONVERT_RAIL }
| Enum referring to the widgets of the build rail toolbar.
enum | BuildSignalWidgets { BSW_CLOSEBOX = 0, BSW_CAPTION, BSW_SEMAPHORE_NORM, BSW_SEMAPHORE_ENTRY, BSW_SEMAPHORE_EXIT, BSW_SEMAPHORE_COMBO, BSW_SEMAPHORE_PBS, BSW_SEMAPHORE_PBS_OWAY, BSW_ELECTRIC_NORM, BSW_ELECTRIC_ENTRY, BSW_ELECTRIC_EXIT, BSW_ELECTRIC_COMBO, BSW_ELECTRIC_PBS, BSW_ELECTRIC_PBS_OWAY, BSW_CONVERT, BSW_DRAG_SIGNALS_DENSITY, BSW_DRAG_SIGNALS_DENSITY_DECREASE, BSW_DRAG_SIGNALS_DENSITY_INCREASE }
| Enum referring to the widgets of the signal window.
## Functions
static void | HandleStationPlacement (TileIndex start, TileIndex end)
static void | ShowBuildTrainDepotPicker (Window *parent)
static void | ShowBuildWaypointPicker (Window *parent)
static void | ShowStationBuilder (Window *parent)
| Open station build window.
static void | ShowSignalBuilder (Window *parent)
| Open the signal selection window.
void | CcPlaySound1E (bool success, TileIndex tile, uint32 p1, uint32 p2)
static void | GenericPlaceRail (TileIndex tile, int cmd)
static void | PlaceRail_N (TileIndex tile)
static void | PlaceRail_NE (TileIndex tile)
static void | PlaceRail_E (TileIndex tile)
static void | PlaceRail_NW (TileIndex tile)
static void | PlaceRail_AutoRail (TileIndex tile)
static void | PlaceExtraDepotRail (TileIndex tile, uint16 extra)
| Try to add an additional rail-track at the entrance of a depot.
void | CcRailDepot (bool success, TileIndex tile, uint32 p1, uint32 p2)
static void | PlaceRail_Depot (TileIndex tile)
static void | PlaceRail_Waypoint (TileIndex tile)
void | CcStation (bool success, TileIndex tile, uint32 p1, uint32 p2)
static void | PlaceRail_Station (TileIndex tile)
static void | GenericPlaceSignals (TileIndex tile)
| Build a new signal or edit/remove a present signal, use CmdBuildSingleSignal() or CmdRemoveSingleSignal() in rail_cmd.cpp.
static void | PlaceRail_Bridge (TileIndex tile)
void | CcBuildRailTunnel (bool success, TileIndex tile, uint32 p1, uint32 p2)
| Command callback for building a tunnel.
static void | PlaceRail_Tunnel (TileIndex tile)
static void | PlaceRail_ConvertRail (TileIndex tile)
static void | PlaceRail_AutoSignals (TileIndex tile)
static void | ToggleRailButton_Remove (Window *w)
| Toggles state of the Remove button of Build rail toolbar.
static bool | RailToolbar_CtrlChanged (Window *w)
| Updates the Remove button because of Ctrl state change.
static void | BuildRailClick_N (Window *w)
| The "rail N"-button click proc of the build-rail toolbar.
static void | BuildRailClick_NE (Window *w)
| The "rail NE"-button click proc of the build-rail toolbar.
static void | BuildRailClick_E (Window *w)
| The "rail E"-button click proc of the build-rail toolbar.
static void | BuildRailClick_NW (Window *w)
| The "rail NW"-button click proc of the build-rail toolbar.
static void | BuildRailClick_AutoRail (Window *w)
| The "auto-rail"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Demolish (Window *w)
| The "demolish"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Depot (Window *w)
| The "build depot"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Waypoint (Window *w)
| The "build waypoint"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Station (Window *w)
| The "build station"-button click proc of the build-rail toolbar.
static void | BuildRailClick_AutoSignals (Window *w)
| The "build signal"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Bridge (Window *w)
| The "build bridge"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Tunnel (Window *w)
| The "build tunnel"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Remove (Window *w)
| The "remove"-button click proc of the build-rail toolbar.
static void | BuildRailClick_Convert (Window *w)
| The "convert-rail"-button click proc of the build-rail toolbar.
static void | DoRailroadTrack (int mode)
static void | HandleAutodirPlacement ()
static void | HandleAutoSignalPlacement ()
| Build new signals or remove signals or (if only one tile marked) edit a signal.
static void | SetupRailToolbar (RailType railtype, Window *w)
| Configures the rail toolbar for railtype given.
void | ShowBuildRailToolbar (RailType railtype, int button)
| Open the build rail toolbar window for a specific rail type.
void | InitializeRailGui ()
| Initialize rail building GUI settings.
void | ReinitGuiAfterToggleElrail (bool disable)
| Re-initialize rail-build toolbar after toggling support for electric trains.
static void | SetDefaultRailGui ()
| Set the initial (default) railtype to use.
bool | ResetSignalVariant (int32=0)
| Updates the current signal variant used in the signal GUI to the one adequate to current year.
void | InitializeRailGUI ()
| Resets the rail GUI - sets default railtype to build and resets the signal GUI.
## Variables
static RailType | _cur_railtype
| Rail type of the current build-rail toolbar.
static bool | _remove_button_clicked
| Flag whether 'remove' toggle-button is currently enabled.
static DiagDirection | _build_depot_direction
| Currently selected depot direction.
static byte | _waypoint_count = 1
| Number of waypoint types.
static byte | _cur_waypoint_type
| Currently selected waypoint type.
static bool | _convert_signal_button
| convert signal button in the signal GUI pressed
static SignalVariant | _cur_signal_variant
| set the signal variant (for signal GUI)
static SignalType | _cur_signal_type
| set the signal type (for signal GUI)
static const SignalType | _default_signal_type [] = {SIGTYPE_NORMAL, SIGTYPE_PBS, SIGTYPE_PBS_ONEWAY}
static RailStationGUISettings | _railstation
| Settings of the station builder GUI.
static const uint16 | _place_depot_extra [12]
| Additional pieces of track to add at the entrance of a depot.
static const RailBuildingGUIButtonData | _rail_build_button_data []
| GUI rail-building button data constants.
static const Widget | _build_rail_widgets []
| Widget definition for the rail toolbar.
static const WindowDesc | _build_rail_desc (WDP_ALIGN_TBR, 22, 350, 36, 350, 36, WC_BUILD_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_STICKY_BUTTON|WDF_CONSTRUCTION, _build_rail_widgets)
static const Widget | _station_builder_widgets []
| Widget definition of the standard build rail station window.
static const Widget | _newstation_builder_widgets []
| Widget definition of the build NewGRF rail station window.
static const WindowDesc | _station_builder_desc (WDP_AUTO, WDP_AUTO, 148, 200, 148, 200, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_CONSTRUCTION, _station_builder_widgets)
| High level window description of the default station-build window.
static const WindowDesc | _newstation_builder_desc (WDP_AUTO, WDP_AUTO, 148, 290, 148, 290, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_CONSTRUCTION, _newstation_builder_widgets)
| High level window description of the newGRF station-build window.
static const Widget | _signal_builder_widgets []
| Widget definition of the build signal window.
static const WindowDesc | _signal_builder_desc (WDP_AUTO, WDP_AUTO, 154, 68, 154, 68, WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_CONSTRUCTION, _signal_builder_widgets)
| Signal selection window description.
static const Widget | _build_depot_widgets []
| Widget definition of the build rail depot window.
static const WindowDesc | _build_depot_desc (WDP_AUTO, WDP_AUTO, 140, 122, 140, 122, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_CONSTRUCTION, _build_depot_widgets)
static const Widget | _build_waypoint_widgets []
| Widget definition for the build NewGRF rail waypoint window.
static const WindowDesc | _build_waypoint_desc (WDP_AUTO, WDP_AUTO, 344, 92, 344, 92, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_CONSTRUCTION, _build_waypoint_widgets)

## Detailed Description

File for dealing with rail construction user interface.

Definition in file rail_gui.cpp.

## Function Documentation

static void BuildRailClick_AutoRail | ( | Window * | w | ) | `[static]`

The "auto-rail"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 373 of file rail_gui.cpp.

References _cur_railtype, RailtypeInfo::autorail, GetRailTypeInfo(), HandlePlacePushButton(), and VHM_RAIL.

static void BuildRailClick_AutoSignals | ( | Window * | w | ) | `[static]`

The "build signal"-button click proc of the build-rail toolbar.

Start ShowSignalBuilder() and/or HandleAutoSignalPlacement().

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 431 of file rail_gui.cpp.

References _ctrl_pressed, _settings_client, ANIMCURSOR_BUILDSIGNALS, GUISettings::enable_signal_gui, ClientSettings::gui, HandlePlacePushButton(), ShowSignalBuilder(), and VHM_RECT.

static void BuildRailClick_Bridge | ( | Window * | w | ) | `[static]`

The "build bridge"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 445 of file rail_gui.cpp.

References HandlePlacePushButton(), and VHM_RECT.

static void BuildRailClick_Convert | ( | Window * | w | ) | `[static]`

The "convert-rail"-button click proc of the build-rail toolbar.

Switches to 'convert-rail' mode

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 500 of file rail_gui.cpp.

References _cur_railtype, RailtypeInfo::convert, GetRailTypeInfo(), HandlePlacePushButton(), and VHM_RECT.

static void BuildRailClick_Demolish | ( | Window * | w | ) | `[static]`

The "demolish"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 383 of file rail_gui.cpp.

References ANIMCURSOR_DEMOLISH, HandlePlacePushButton(), and VHM_RECT.

static void BuildRailClick_Depot | ( | Window * | w | ) | `[static]`

The "build depot"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 393 of file rail_gui.cpp.

References _cur_railtype, RailtypeInfo::depot, GetRailTypeInfo(), HandlePlacePushButton(), and VHM_RECT.

static void BuildRailClick_E | ( | Window * | w | ) | `[static]`

The "rail E"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 353 of file rail_gui.cpp.

References _cur_railtype, GetRailTypeInfo(), HandlePlacePushButton(), RailtypeInfo::rail_ew, and VHM_RECT.

static void BuildRailClick_N | ( | Window * | w | ) | `[static]`

The "rail N"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 333 of file rail_gui.cpp.

References _cur_railtype, GetRailTypeInfo(), HandlePlacePushButton(), RailtypeInfo::rail_ns, and VHM_RECT.

static void BuildRailClick_NE | ( | Window * | w | ) | `[static]`

The "rail NE"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 343 of file rail_gui.cpp.

References _cur_railtype, GetRailTypeInfo(), HandlePlacePushButton(), RailtypeInfo::rail_swne, and VHM_RECT.

static void BuildRailClick_NW | ( | Window * | w | ) | `[static]`

The "rail NW"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 363 of file rail_gui.cpp.

References _cur_railtype, GetRailTypeInfo(), HandlePlacePushButton(), RailtypeInfo::rail_nwse, and VHM_RECT.

static void BuildRailClick_Remove | ( | Window * | w | ) | `[static]`

The "remove"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 465 of file rail_gui.cpp.

References _remove_button_clicked, _settings_client, _settings_game, ClientSettings::gui, Window::IsWidgetDisabled(), Window::IsWidgetLowered(), GameSettings::station, GUISettings::station_dragdrop, GUISettings::station_numtracks, GUISettings::station_platlength, StationSettings::station_spread, Swap(), and ToggleRailButton_Remove().

static void BuildRailClick_Station | ( | Window * | w | ) | `[static]`

The "build station"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 420 of file rail_gui.cpp.

References HandlePlacePushButton(), ShowStationBuilder(), and VHM_RECT.

static void BuildRailClick_Tunnel | ( | Window * | w | ) | `[static]`

The "build tunnel"-button click proc of the build-rail toolbar.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 455 of file rail_gui.cpp.

References _cur_railtype, GetRailTypeInfo(), HandlePlacePushButton(), RailtypeInfo::tunnel, and VHM_SPECIAL.

static void BuildRailClick_Waypoint | ( | Window * | w | ) | `[static]`

The "build waypoint"-button click proc of the build-rail toolbar.

If there are newGRF waypoints, also open a window to pick the waypoint type.

Parameters:

  | w | Build-rail toolbar window

See also:
  BuildRailToolbWndProc()

Definition at line 406 of file rail_gui.cpp.

References _waypoint_count, GetNumCustomStations(), HandlePlacePushButton(), STAT_CLASS_WAYP, and VHM_RECT.

static void GenericPlaceSignals | ( | TileIndex | tile | ) | `[static]`

Build a new signal or edit/remove a present signal, use CmdBuildSingleSignal() or CmdRemoveSingleSignal() in rail_cmd.cpp.

Parameters:

  | tile | The tile where the signal will build or edit

Definition at line 195 of file rail_gui.cpp.

References _convert_signal_button, _ctrl_pressed, _cur_signal_type, _cur_signal_variant, _cur_year, _remove_button_clicked, _settings_client, CMD_BUILD_SIGNALS, CMD_MSG, CMD_REMOVE_SIGNALS, GUISettings::cycle_signal_types, GUISettings::default_signal_type, DoCommandP(), FindFirstTrack(), FindWindowById(), GetTileTrackStatus(), ClientSettings::gui, SB(), GUISettings::semaphore_build_before, SIG_ELECTRIC, SIG_SEMAPHORE, SIGTYPE_NORMAL, SIGTYPE_PBS, TRACK_BIT_HORZ, TRACK_BIT_LEFT, TRACK_BIT_LOWER, TRACK_BIT_RIGHT, TRACK_BIT_UPPER, TRACK_BIT_VERT, TrackStatusToTrackBits(), TRANSPORT_RAIL, VPM_X_OR_Y, VpStartPlaceSizing(), Point::x, and Point::y.

Referenced by HandleAutoSignalPlacement().

static void HandleAutoSignalPlacement | ( |  | ) | `[static]`

Build new signals or remove signals or (if only one tile marked) edit a signal.

If one tile marked abort and use GenericPlaceSignals() else use CmdBuildSingleSignal() or CmdRemoveSingleSignal() in rail_cmd.cpp to build many signals

Definition at line 534 of file rail_gui.cpp.

References _ctrl_pressed, _cur_signal_type, _cur_signal_variant, _cur_year, _remove_button_clicked, _settings_client, CMD_BUILD_SIGNAL_TRACK, CMD_MSG, CMD_REMOVE_SIGNAL_TRACK, GUISettings::default_signal_type, DoCommandP(), GUISettings::drag_signals_density, FindWindowById(), GB(), GenericPlaceSignals(), ClientSettings::gui, SB(), GUISettings::semaphore_build_before, SIG_ELECTRIC, and SIG_SEMAPHORE.

Referenced by BuildRailToolbarWindow::OnPlaceMouseUp().

static void PlaceExtraDepotRail | ( | TileIndex | tile,
|  | uint16 | extra |
| ) |  |  | `[static]`

Try to add an additional rail-track at the entrance of a depot.

Parameters:

  | tile | Tile to use for adding the rail-track
  | extra | Track to add

See also:
  CcRailDepot()

Definition at line 110 of file rail_gui.cpp.

References _cur_railtype, CMD_BUILD_SINGLE_RAIL, DoCommandP(), GB(), GetRailTileType(), GetTrackBits(), and RAIL_TILE_NORMAL.

static bool RailToolbar_CtrlChanged | ( | Window * | w | ) | `[static]`

Updates the Remove button because of Ctrl state change.

Parameters:

  | w | window the button belongs to

Returns:
  true iff the remove buton was changed

Definition at line 312 of file rail_gui.cpp.

References Window::IsWidgetDisabled(), Window::IsWidgetLowered(), and ToggleRailButton_Remove().

Referenced by BuildRailToolbarWindow::OnClick(), BuildRailToolbarWindow::OnCTRLStateChange(), and BuildRailToolbarWindow::OnKeyPress().

void ReinitGuiAfterToggleElrail | ( | bool | disable | ) |

Re-initialize rail-build toolbar after toggling support for electric trains.

Parameters:

  | disable | Boolean whether electric trains are disabled (removed from the game)

Definition at line 1718 of file rail_gui.cpp.

References _cur_railtype, FindWindowById(), MarkWholeScreenDirty(), RAILTYPE_ELECTRIC, RAILTYPE_RAIL, Window::SetDirty(), SetupRailToolbar(), and TRANSPORT_RAIL.

Referenced by SettingsDisableElrail().

bool ResetSignalVariant | ( | int32 | = `0` | ) |

Updates the current signal variant used in the signal GUI to the one adequate to current year.

Parameters:

  | 0 | needed to be called when a setting changes

Returns:
  success, needed for settings

Definition at line 1789 of file rail_gui.cpp.

References _cur_signal_type, _cur_signal_variant, _cur_year, _settings_client, FindWindowById(), ClientSettings::gui, Window::RaiseWidget(), GUISettings::semaphore_build_before, Window::SetDirty(), SIG_ELECTRIC, and SIG_SEMAPHORE.

Referenced by ClickChangeDateCheat(), and InitializeRailGUI().

static void SetupRailToolbar | ( | RailType | railtype,
|  | Window * | w |
| ) |  |  | `[static]`

Configures the rail toolbar for railtype given.

Parameters:

  | railtype | the railtype to display
  | w | the window to modify

Definition at line 807 of file rail_gui.cpp.

References RailtypeInfo::auto_rail, RailtypeInfo::build_depot, RailtypeInfo::build_ew_rail, RailtypeInfo::build_ns_rail, RailtypeInfo::build_tunnel, RailtypeInfo::build_x_rail, RailtypeInfo::build_y_rail, RailtypeInfo::convert_rail, Widget::data, GetRailTypeInfo(), RailtypeInfo::gui_sprites, RAILTYPE_END, RailtypeInfo::strings, RailtypeInfo::toolbar_caption, and Window::widget.

Referenced by ReinitGuiAfterToggleElrail(), SetDefaultRailGui(), and ShowBuildRailToolbar().

void ShowBuildRailToolbar | ( | RailType | railtype,
|  | int | button |
| ) |  |  |

Open the build rail toolbar window for a specific rail type.

The window may be opened in the 'normal' way by clicking at the rail icon in the main toolbar, or by means of selecting one of the functions of the toolbar. In the latter case, the corresponding widget is also selected.

If the terraform toolbar is linked to the toolbar, that window is also opened.

Parameters:

  | railtype | Rail type to open the window for
  | button | Widget clicked (`-1` means no button clicked)

Definition at line 834 of file rail_gui.cpp.

References _cur_railtype, _remove_button_clicked, RailBuildingGUIButtonData::click_proc, DeleteWindowByClass(), FindWindowById(), SetupRailToolbar(), TRANSPORT_RAIL, BuildRailToolbarWindow::UpdateRemoveWidgetStatus(), and ValParamRailtype().

static void ToggleRailButton_Remove | ( | Window * | w | ) | `[static]`

Toggles state of the Remove button of Build rail toolbar.

Parameters:

  | w | window the button belongs to

Definition at line 299 of file rail_gui.cpp.

References _remove_button_clicked, DeleteWindowById(), Window::InvalidateWidget(), Window::IsWidgetLowered(), and Window::ToggleWidgetLoweredState().

Referenced by BuildRailClick_Remove(), and RailToolbar_CtrlChanged().

## Variable Documentation

const Widget _build_depot_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,    10,     0,    13, STR_00C5,                         STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,  11,   139,     0,    13, STR_1014_TRAIN_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,   139,    14,   121, 0x0,                              STR_NULL},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        71,   136,    17,    66, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        71,   136,    69,   118, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         3,    68,    69,   118, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         3,    68,    17,    66, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
    {   WIDGETS_END},
    }

Widget definition of the build rail depot window.

Definition at line 1582 of file rail_gui.cpp.

const Widget _build_rail_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   337,     0,    13, STR_100A_RAILROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   338,   349,     0,    13, 0x0,                            STR_STICKY_BUTTON},

    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   110,   113,    14,    35, 0x0,                            STR_NULL},

    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    21,    14,    35, SPR_IMG_RAIL_NS,                STR_1018_BUILD_RAILROAD_TRACK},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    22,    43,    14,    35, SPR_IMG_RAIL_NE,                STR_1018_BUILD_RAILROAD_TRACK},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    44,    65,    14,    35, SPR_IMG_RAIL_EW,                STR_1018_BUILD_RAILROAD_TRACK},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    66,    87,    14,    35, SPR_IMG_RAIL_NW,                STR_1018_BUILD_RAILROAD_TRACK},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    88,   109,    14,    35, SPR_IMG_AUTORAIL,               STR_BUILD_AUTORAIL_TIP},

    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   114,   135,    14,    35, SPR_IMG_DYNAMITE,               STR_018D_DEMOLISH_BUILDINGS_ETC},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   136,   157,    14,    35, SPR_IMG_DEPOT_RAIL,             STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   158,   179,    14,    35, SPR_IMG_WAYPOINT,               STR_CONVERT_RAIL_TO_WAYPOINT_TIP},

    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   180,   221,    14,    35, SPR_IMG_RAIL_STATION,           STR_101A_BUILD_RAILROAD_STATION},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   222,   243,    14,    35, SPR_IMG_RAIL_SIGNALS,           STR_101B_BUILD_RAILROAD_SIGNALS},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   244,   285,    14,    35, SPR_IMG_BRIDGE,                 STR_101C_BUILD_RAILROAD_BRIDGE},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   286,   305,    14,    35, SPR_IMG_TUNNEL_RAIL,            STR_101D_BUILD_RAILROAD_TUNNEL},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   306,   327,    14,    35, SPR_IMG_REMOVE,                 STR_101E_TOGGLE_BUILD_REMOVE_FOR},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   328,   349,    14,    35, SPR_IMG_CONVERT_RAIL,           STR_CONVERT_RAIL_TIP},

    {   WIDGETS_END},
    }

Widget definition for the rail toolbar.

Definition at line 768 of file rail_gui.cpp.

const Widget _build_waypoint_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,     STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   343,     0,    13, STR_WAYPOINT, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   343,    14,    91, 0x0,          STR_NULL},

    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     3,    68,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,    71,   136,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   139,   204,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   207,   272,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   275,   340,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},

    { WWT_HSCROLLBAR,   RESIZE_NONE,  COLOUR_DARK_GREEN,     1,   343,     80,    91, 0x0,          STR_HSCROLL_BAR_SCROLLS_LIST},
    {    WIDGETS_END},
    }

Widget definition for the build NewGRF rail waypoint window.

Definition at line 1679 of file rail_gui.cpp.

const uint16 _place_depot_extra[12]`[static]`

Initial value:

     {
      0x0604, 0x2102, 0x1202, 0x0505,
      0x2400, 0x2801, 0x1800, 0x1401,
      0x2203, 0x0904, 0x0A05, 0x1103,
    }

Additional pieces of track to add at the entrance of a depot.

Definition at line 119 of file rail_gui.cpp.

const RailBuildingGUIButtonData _rail_build_button_data[]`[static]`

Initial value:

     {
      {'1', BuildRailClick_N          },
      {'2', BuildRailClick_NE         },
      {'3', BuildRailClick_E          },
      {'4', BuildRailClick_NW         },
      {'5', BuildRailClick_AutoRail   },
      {'6', BuildRailClick_Demolish   },
      {'7', BuildRailClick_Depot      },
      {'8', BuildRailClick_Waypoint   },
      {'9', BuildRailClick_Station    },
      {'S', BuildRailClick_AutoSignals},
      {'B', BuildRailClick_Bridge     },
      {'T', BuildRailClick_Tunnel     },
      {'R', BuildRailClick_Remove     },
      {'C', BuildRailClick_Convert    }
    }

GUI rail-building button data constants.

Offsets match widget order, starting at RTW_BUILD_NS

Definition at line 586 of file rail_gui.cpp.

const Widget _signal_builder_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,  10,   0,  13, STR_00C5,               STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,  11, 153,   0,  13, STR_SIGNAL_SELECTION,   STR_018C_WINDOW_TITLE_DRAG_THIS},

    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,  21,  14,  40, STR_NULL,               STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  22,  43,  14,  40, STR_NULL,               STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  44,  65,  14,  40, STR_NULL,               STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  66,  87,  14,  40, STR_NULL,               STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  88, 109,  14,  40, STR_NULL,               STR_BUILD_SIGNAL_SEMAPHORE_PBS_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN, 110, 131,  14,  40, STR_NULL,               STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TIP},

    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,  21,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  22,  43,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  44,  65,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  66,  87,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  88, 109,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_PBS_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN, 110, 131,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TIP},

    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 132, 153,  14,  40, SPR_IMG_SIGNAL_CONVERT, STR_SIGNAL_CONVERT_TIP},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN, 132, 153,  41,  67, STR_NULL,               STR_DRAG_SIGNALS_DENSITY_TIP},
    { WWT_PUSHIMGBTN,   RESIZE_NONE,  COLOUR_GREY,       134, 142,  54,  65, SPR_ARROW_LEFT,         STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP},
    { WWT_PUSHIMGBTN,   RESIZE_NONE,  COLOUR_GREY,       143, 151,  54,  65, SPR_ARROW_RIGHT,        STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP},

    {   WIDGETS_END},
    }

Widget definition of the build signal window.

Definition at line 1492 of file rail_gui.cpp.

const Widget _station_builder_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,  11,   147,     0,    13, STR_3000_RAIL_STATION_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,   147,    14,   199, 0x0,                             STR_NULL},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         7,    72,    26,    73, 0x0,                             STR_304E_SELECT_RAILROAD_STATION},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        75,   140,    26,    73, 0x0,                             STR_304E_SELECT_RAILROAD_STATION},

    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        22,    36,    87,    98, STR_00CB_1,                      STR_304F_SELECT_NUMBER_OF_PLATFORMS},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        37,    51,    87,    98, STR_00CC_2,                      STR_304F_SELECT_NUMBER_OF_PLATFORMS},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        52,    66,    87,    98, STR_00CD_3,                      STR_304F_SELECT_NUMBER_OF_PLATFORMS},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        67,    81,    87,    98, STR_00CE_4,                      STR_304F_SELECT_NUMBER_OF_PLATFORMS},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        82,    96,    87,    98, STR_00CF_5,                      STR_304F_SELECT_NUMBER_OF_PLATFORMS},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        97,   111,    87,    98, STR_6,                           STR_304F_SELECT_NUMBER_OF_PLATFORMS},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,       112,   126,    87,    98, STR_7,                           STR_304F_SELECT_NUMBER_OF_PLATFORMS},

    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        22,    36,   112,   123, STR_00CB_1,                      STR_3050_SELECT_LENGTH_OF_RAILROAD},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        37,    51,   112,   123, STR_00CC_2,                      STR_3050_SELECT_LENGTH_OF_RAILROAD},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        52,    66,   112,   123, STR_00CD_3,                      STR_3050_SELECT_LENGTH_OF_RAILROAD},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        67,    81,   112,   123, STR_00CE_4,                      STR_3050_SELECT_LENGTH_OF_RAILROAD},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        82,    96,   112,   123, STR_00CF_5,                      STR_3050_SELECT_LENGTH_OF_RAILROAD},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        97,   111,   112,   123, STR_6,                           STR_3050_SELECT_LENGTH_OF_RAILROAD},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,       112,   126,   112,   123, STR_7,                           STR_3050_SELECT_LENGTH_OF_RAILROAD},

    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        37,   111,   126,   137, STR_DRAG_DROP,                   STR_STATION_DRAG_DROP},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        14,    73,   152,   163, STR_02DB_OFF,                    STR_3065_DON_T_HIGHLIGHT_COVERAGE},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        74,   133,   152,   163, STR_02DA_ON,                     STR_3064_HIGHLIGHT_COVERAGE_AREA},
    {   WIDGETS_END},
    }

Widget definition of the standard build rail station window.

Definition at line 1277 of file rail_gui.cpp.