OpenTTD Source: src/rail_gui.cpp File Reference

OpenTTD Source 13.1

Data Structures | Enumerations | Functions | Variables
rail_gui.cpp File Reference
`#include "stdafx.h"`
`#include "gui.h"`
`#include "window_gui.h"`
`#include "station_gui.h"`
`#include "terraform_gui.h"`
`#include "viewport_func.h"`
`#include "command_func.h"`
`#include "waypoint_func.h"`
`#include "newgrf_station.h"`
`#include "company_base.h"`
`#include "strings_func.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 "spritecache.h"`
`#include "core/geometry_func.hpp"`
`#include "hotkeys.h"`
`#include "engine_base.h"`
`#include "vehicle_func.h"`
`#include "zoom_func.h"`
`#include "rail_gui.h"`
`#include "querystring_gui.h"`
`#include "sortlist_type.h"`
`#include "stringfilter_type.h"`
`#include "string_func.h"`
`#include "station_cmd.h"`
`#include "tunnelbridge_cmd.h"`
`#include "waypoint_cmd.h"`
`#include "rail_cmd.h"`
`#include "station_map.h"`
`#include "tunnelbridge_map.h"`
`#include "widgets/rail_widget.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | RailStationGUISettings
struct | BuildRailToolbarWindow
| Rail toolbar management class. More...
struct | BuildRailStationWindow
struct | BuildSignalWindow
struct | BuildRailDepotWindow
struct | BuildRailWaypointWindow

## Enumerations
enum | BuildRalStationHotkeys { BRASHK_FOCUS_FILTER_BOX }
| Enum referring to the Hotkeys in the build rail station window. More...

## Functions
static void | HandleStationPlacement (TileIndex start, TileIndex end)
static void | ShowBuildTrainDepotPicker (Window *parent)
static void | ShowBuildWaypointPicker (Window *parent)
static Window * | ShowStationBuilder (Window *parent)
| Open station build window.
static void | ShowSignalBuilder (Window *parent)
| Open the signal selection window.
static bool | IsStationAvailable (const StationSpec *statspec)
| Check whether a station type can be build. More...
void | CcPlaySound_CONSTRUCTION_RAIL (Commands cmd, const CommandCost &result, TileIndex tile)
static void | GenericPlaceRail (TileIndex tile, Track track)
static void | PlaceExtraDepotRail (TileIndex tile, DiagDirection dir, Track track)
| Try to add an additional rail-track at the entrance of a depot. More...
void | CcRailDepot (Commands cmd, const CommandCost &result, TileIndex tile, RailType rt, DiagDirection dir)
static void | PlaceRail_Waypoint (TileIndex tile)
| Place a rail waypoint. More...
void | CcStation (Commands cmd, const CommandCost &result, TileIndex tile)
static void | PlaceRail_Station (TileIndex tile)
| Place a rail station. More...
static void | GenericPlaceSignals (TileIndex tile)
| Build a new signal or edit/remove a present signal, use CmdBuildSingleSignal() or CmdRemoveSingleSignal() in rail_cmd.cpp. More...
static void | PlaceRail_Bridge (TileIndex tile, Window *w)
| Start placing a rail bridge. More...
void | CcBuildRailTunnel (Commands cmd, const CommandCost &result, TileIndex tile)
| Command callback for building a tunnel.
static void | ToggleRailButton_Remove (Window *w)
| Toggles state of the Remove button of Build rail toolbar. More...
static bool | RailToolbar_CtrlChanged (Window *w)
| Updates the Remove button because of Ctrl state change. More...
static void | BuildRailClick_Remove (Window *w)
| The "remove"-button click proc of the build-rail toolbar. More...
static void | DoRailroadTrack (Track track)
static void | HandleAutodirPlacement ()
static void | HandleAutoSignalPlacement ()
| Build new signals or remove signals or (if only one tile marked) edit a signal. More...
static EventState | RailToolbarGlobalHotkeys (int hotkey)
| Handler for global hotkeys of the BuildRailToolbarWindow. More...
Window * | ShowBuildRailToolbar (RailType railtype)
| Open the build rail toolbar window for a specific rail type. More...
static EventState | BuildRailStationGlobalHotkeys (int hotkey)
| Handler for global hotkeys of the BuildRailStationWindow. More...
void | InitializeRailGui ()
| Initialize rail building GUI settings.
void | ReinitGuiAfterToggleElrail (bool disable)
| Re-initialize rail-build toolbar after toggling support for electric trains. More...
static void | SetDefaultRailGui ()
| Set the initial (default) railtype to use.
void | ResetSignalVariant (int32 new_value)
| Updates the current signal variant used in the signal GUI to the one adequate to current year. More...
void | InitializeRailGUI ()
| Resets the rail GUI - sets default railtype to build and resets the signal GUI.
DropDownList | GetRailTypeDropDownList (bool for_replacement, bool all_option)
| Create a drop down list for all the rail types of the local company. More...

## 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 RailStationGUISettings | _railstation
| Settings of the station builder GUI.
static const Track | _place_depot_extra_track [12]
| Additional pieces of track to add at the entrance of a depot. More...
static const DiagDirection | _place_depot_extra_dir [12]
| Direction to check for existing track pieces. More...
const uint16 | _railtoolbar_autorail_keys [] = {'5', 'A' | WKC_GLOBAL_HOTKEY, 0}
static Hotkey | railtoolbar_hotkeys []
static const NWidgetPart | _nested_build_rail_widgets []
static WindowDesc | _build_rail_desc (WDP_ALIGN_TOOLBAR, "toolbar_rail", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_build_rail_widgets, lengthof(_nested_build_rail_widgets), &BuildRailToolbarWindow::hotkeys)
static Hotkey | buildrailstation_hotkeys []
static const NWidgetPart | _nested_station_builder_widgets []
static WindowDesc | _station_builder_desc (WDP_AUTO, "build_station_rail", 350, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_station_builder_widgets, lengthof(_nested_station_builder_widgets), &BuildRailStationWindow::hotkeys)
| High level window description of the station-build window (default & newGRF)
static const NWidgetPart | _nested_signal_builder_widgets []
| Nested widget definition of the build signal window.
static WindowDesc | _signal_builder_desc (WDP_AUTO, "build_signal", 0, 0, WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_signal_builder_widgets, lengthof(_nested_signal_builder_widgets))
| Signal selection window description.
static const NWidgetPart | _nested_build_depot_widgets []
| Nested widget definition of the build rail depot window. More...
static WindowDesc | _build_depot_desc (WDP_AUTO, nullptr, 0, 0, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_depot_widgets, lengthof(_nested_build_depot_widgets))
static const NWidgetPart | _nested_build_waypoint_widgets []
| Nested widget definition for the build NewGRF rail waypoint window. More...
static WindowDesc | _build_waypoint_desc (WDP_AUTO, "build_waypoint", 0, 0, WC_BUILD_WAYPOINT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_waypoint_widgets, lengthof(_nested_build_waypoint_widgets))

## Detailed Description

File for dealing with rail construction user interface

Definition in file rail_gui.cpp.

## Enumeration Type Documentation

## ◆ BuildRalStationHotkeys

enum BuildRalStationHotkeys

Enum referring to the Hotkeys in the build rail station window.

Enumerator
BRASHK_FOCUS_FILTER_BOX | Focus the edit box for editing the filter string.

Definition at line 894 of file rail_gui.cpp.

## Function Documentation

## ◆ BuildRailClick_Remove()

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
  BuildRailToolbarWindow::OnClick()

Definition at line 325 of file rail_gui.cpp.

References _settings_client, SoundSettings::click_beep, Window::IsWidgetDisabled(), ClientSettings::sound, ToggleRailButton_Remove(), and WID_RAT_REMOVE.

## ◆ BuildRailStationGlobalHotkeys()

static EventState BuildRailStationGlobalHotkeys | ( | int | hotkey | ) |
| static

Handler for global hotkeys of the BuildRailStationWindow.

Parameters

  hotkey | Hotkey

Returns
  ES_HANDLED if hotkey was accepted.

Definition at line 1522 of file rail_gui.cpp.

## ◆ GenericPlaceSignals()

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 226 of file rail_gui.cpp.

References GetTileTrackStatus(), TRACK_BIT_VERT, TrackStatusToTrackBits(), and TRANSPORT_RAIL.

## ◆ GetRailTypeDropDownList()

DropDownList GetRailTypeDropDownList | ( | bool | for_replacement,
|  | bool | all_option
| ) |  |

Create a drop down list for all the rail types of the local company.

Parameters

  for_replacement | Whether this list is for the replacement window.
  all_option | Whether to add an 'all types' item.

Returns
  The populated and sorted DropDownList.

Definition at line 2233 of file rail_gui.cpp.

References _local_company, Company::avail_railtypes, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), GetCompanyRailtypes(), GetRailTypes(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, and INVALID_RAILTYPE.

Referenced by ReplaceVehicleWindow::OnClick().

## ◆ 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 383 of file rail_gui.cpp.

References GB().

## ◆ IsStationAvailable()

static bool IsStationAvailable | ( | const StationSpec * | statspec | ) |
| static

Check whether a station type can be build.

Returns
  true if building is allowed.

Definition at line 82 of file rail_gui.cpp.

References StationSpec::callback_mask, CBM_STATION_AVAIL, and HasBit().

Referenced by BuildRailWaypointWindow::OnClick().

## ◆ PlaceExtraDepotRail()

static void PlaceExtraDepotRail | ( | TileIndex | tile,
|  | DiagDirection | dir,
|  | Track | track
| ) |  |
| static

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

Parameters

  tile | Tile to use for adding the rail-track
  dir | Direction to check for already present tracks
  track | Track to add

See also
  CcRailDepot()

Definition at line 115 of file rail_gui.cpp.

References _cur_railtype, _settings_client, GUISettings::auto_remove_signals, DiagdirReachesTracks(), GetRailTileType(), GetTrackBits(), ClientSettings::gui, RAIL_TILE_DEPOT, and RAIL_TILE_SIGNALS.

## ◆ PlaceRail_Bridge()

static void PlaceRail_Bridge | ( | TileIndex | tile,
|  | Window * | w
| ) |  |
| static

Start placing a rail bridge.

Parameters

  tile | Position of the first tile of the bridge.
  w | Rail toolbar window.

Definition at line 264 of file rail_gui.cpp.

References DDSP_BUILD_BRIDGE, GetOtherTunnelBridgeEnd(), IsBridgeTile(), Window::OnPlaceMouseUp(), VPM_X_OR_Y, and VpStartPlaceSizing().

## ◆ PlaceRail_Station()

static void PlaceRail_Station | ( | TileIndex | tile | ) |
| static

Place a rail station.

Parameters

  tile | Position to place or start dragging a station.

Definition at line 190 of file rail_gui.cpp.

References _remove_button_clicked, DDSP_REMOVE_STATION, VPM_X_AND_Y_LIMITED, and VpStartPlaceSizing().

## ◆ PlaceRail_Waypoint()

static void PlaceRail_Waypoint | ( | TileIndex | tile | ) |
| static

Place a rail waypoint.

Parameters

  tile | Position to start dragging a waypoint.

Definition at line 158 of file rail_gui.cpp.

References _remove_button_clicked, AXIS_X, DDSP_BUILD_STATION, DDSP_REMOVE_STATION, GetAxisForNewWaypoint(), IsValidAxis(), VPM_X_AND_Y, VPM_X_LIMITED, VPM_Y_LIMITED, and VpStartPlaceSizing().

## ◆ RailToolbar_CtrlChanged()

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 button was changed

Definition at line 304 of file rail_gui.cpp.

References Window::IsWidgetDisabled(), Window::IsWidgetLowered(), ToggleRailButton_Remove(), WID_RAT_BUILD_NS, WID_RAT_BUILD_STATION, WID_RAT_BUILD_WAYPOINT, and WID_RAT_REMOVE.

Referenced by BuildRailToolbarWindow::OnCTRLStateChange().

## ◆ RailToolbarGlobalHotkeys()

static EventState RailToolbarGlobalHotkeys | ( | int | hotkey | ) |
| static

Handler for global hotkeys of the BuildRailToolbarWindow.

Parameters

  hotkey | Hotkey

Returns
  ES_HANDLED if hotkey was accepted.

Definition at line 768 of file rail_gui.cpp.

## ◆ ReinitGuiAfterToggleElrail()

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 2136 of file rail_gui.cpp.

Referenced by SettingsDisableElrail().

## ◆ ResetSignalVariant()

void ResetSignalVariant | ( | int32 | new_value | ) |

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

Parameters

  new_value | needed to be called when a setting changes

Definition at line 2200 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, SIG_SEMAPHORE, WC_BUILD_SIGNAL, WID_BS_ELECTRIC_NORM, and WID_BS_SEMAPHORE_NORM.

Referenced by ClickChangeDateCheat(), and InitializeRailGUI().

## ◆ ShowBuildRailToolbar()

Window* ShowBuildRailToolbar | ( | RailType | railtype | ) |

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

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

Parameters

  railtype | Rail type to open the window for

Returns
  newly opened rail toolbar, or nullptr if the toolbar could not be opened.

Definition at line 856 of file rail_gui.cpp.

References _cur_railtype, _local_company, _remove_button_clicked, CloseWindowByClass(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), ValParamRailtype(), and WC_BUILD_TOOLBAR.

## ◆ ToggleRailButton_Remove()

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 290 of file rail_gui.cpp.

References _remove_button_clicked, CloseWindowById(), Window::IsWidgetLowered(), Window::SetWidgetDirty(), Window::ToggleWidgetLoweredState(), WC_SELECT_STATION, and WID_RAT_REMOVE.

Referenced by BuildRailClick_Remove(), and RailToolbar_CtrlChanged().

## Variable Documentation

## ◆ _nested_build_depot_widgets

const NWidgetPart _nested_build_depot_widgets[]
| static

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_BUILD_DEPOT_TRAIN_ORIENTATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
NWidget(NWID_SPACER), SetMinimalSize(0, 3),
NWidget(NWID_HORIZONTAL_LTR),
NWidget(NWID_SPACER), SetMinimalSize(3, 0), SetFill(1, 0),
NWidget(NWID_VERTICAL),
NWidget(WWT_PANEL, COLOUR_GREY, WID_BRAD_DEPOT_NW), SetMinimalSize(66, 50), SetDataTip(0x0, STR_BUILD_DEPOT_TRAIN_ORIENTATION_TOOLTIP),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
NWidget(WWT_PANEL, COLOUR_GREY, WID_BRAD_DEPOT_SW), SetMinimalSize(66, 50), SetDataTip(0x0, STR_BUILD_DEPOT_TRAIN_ORIENTATION_TOOLTIP),
EndContainer(),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(2, 0),
NWidget(NWID_VERTICAL),
NWidget(WWT_PANEL, COLOUR_GREY, WID_BRAD_DEPOT_NE), SetMinimalSize(66, 50), SetDataTip(0x0, STR_BUILD_DEPOT_TRAIN_ORIENTATION_TOOLTIP),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
NWidget(WWT_PANEL, COLOUR_GREY, WID_BRAD_DEPOT_SE), SetMinimalSize(66, 50), SetDataTip(0x0, STR_BUILD_DEPOT_TRAIN_ORIENTATION_TOOLTIP),
EndContainer(),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(3, 0), SetFill(1, 0),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 3),
EndContainer(),
}

Nested widget definition of the build rail depot window.

Definition at line 1970 of file rail_gui.cpp.

## ◆ _nested_build_waypoint_widgets

const NWidgetPart _nested_build_waypoint_widgets[]
| static

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_WAYPOINT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, WID_BRW_WAYPOINT_MATRIX), SetPIP(0, 2, 0), SetPadding(3), SetScrollbar(WID_BRW_SCROLL),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BRW_WAYPOINT), SetMinimalSize(66, 60), SetDataTip(0x0, STR_WAYPOINT_GRAPHICS_TOOLTIP), SetScrollbar(WID_BRW_SCROLL), EndContainer(),
EndContainer(),
EndContainer(),
NWidget(NWID_VERTICAL),
NWidget(NWID_VSCROLLBAR, COLOUR_DARK_GREEN, WID_BRW_SCROLL),
NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),
EndContainer(),
}

Nested widget definition for the build NewGRF rail waypoint window.

Definition at line 2092 of file rail_gui.cpp.

## ◆ _place_depot_extra_dir

const DiagDirection _place_depot_extra_dir[12]
| static

Initial value:
= {
DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE, DIAGDIR_SW,
DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_SE,
DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_NE,
}

Direction to check for existing track pieces.

Definition at line 132 of file rail_gui.cpp.

## ◆ _place_depot_extra_track

const Track _place_depot_extra_track[12]
| static

Initial value:
= {
TRACK_LEFT, TRACK_UPPER, TRACK_UPPER, TRACK_RIGHT,
TRACK_X, TRACK_Y, TRACK_X, TRACK_Y,
TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT, TRACK_LOWER,
}

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

Definition at line 125 of file rail_gui.cpp.

## ◆ buildrailstation_hotkeys

Hotkey buildrailstation_hotkeys[]
| static

Initial value:
= {
Hotkey('F', "focus_filter_box", BRASHK_FOCUS_FILTER_BOX),
HOTKEY_LIST_END
}

Definition at line 1530 of file rail_gui.cpp.

## ◆ railtoolbar_hotkeys

Hotkey railtoolbar_hotkeys[]
| static

Initial value:
= {
Hotkey('1', "build_ns", WID_RAT_BUILD_NS),
Hotkey('2', "build_x", WID_RAT_BUILD_X),
Hotkey('3', "build_ew", WID_RAT_BUILD_EW),
Hotkey('4', "build_y", WID_RAT_BUILD_Y),
Hotkey(_railtoolbar_autorail_keys, "autorail", WID_RAT_AUTORAIL),
Hotkey('6', "demolish", WID_RAT_DEMOLISH),
Hotkey('7', "depot", WID_RAT_BUILD_DEPOT),
Hotkey('8', "waypoint", WID_RAT_BUILD_WAYPOINT),
Hotkey('9', "station", WID_RAT_BUILD_STATION),
Hotkey('S', "signal", WID_RAT_BUILD_SIGNALS),
Hotkey('B', "bridge", WID_RAT_BUILD_BRIDGE),
Hotkey('T', "tunnel", WID_RAT_BUILD_TUNNEL),
Hotkey('R', "remove", WID_RAT_REMOVE),
Hotkey('C', "convert", WID_RAT_CONVERT_RAIL),
HOTKEY_LIST_END
}

Definition at line 779 of file rail_gui.cpp.

DIAGDIR_SE
@ DIAGDIR_SE
Southeast.
Definition: direction_type.h:80
WID_RAT_DEMOLISH
@ WID_RAT_DEMOLISH
Destroy something with dynamite!
Definition: rail_widget.h:22
SetScrollbar
static NWidgetPart SetScrollbar(int index)
Attach a scrollbar to a widget.
Definition: widget_type.h:1208
WID_RAT_BUILD_SIGNALS
@ WID_RAT_BUILD_SIGNALS
Build signals.
Definition: rail_widget.h:26
WID_RAT_BUILD_Y
@ WID_RAT_BUILD_Y
Build rail along the game grid Y axis.
Definition: rail_widget.h:20
SetPadding
static NWidgetPart SetPadding(uint8 top, uint8 right, uint8 bottom, uint8 left)
Widget part function for setting additional space around a widget.
Definition: widget_type.h:1141
WID_BRAD_DEPOT_SE
@ WID_BRAD_DEPOT_SE
Build a depot with the entrance in the south east.
Definition: rail_widget.h:113
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:59
WID_BRAD_DEPOT_SW
@ WID_BRAD_DEPOT_SW
Build a depot with the entrance in the south west.
Definition: rail_widget.h:114
TRACK_LOWER
@ TRACK_LOWER
Track in the lower corner of the tile (south)
Definition: track_type.h:24
WWT_DEFSIZEBOX
@ WWT_DEFSIZEBOX
Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX)
Definition: widget_type.h:63
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:73
TRACK_X
@ TRACK_X
Track along the x-axis (north-east to south-west)
Definition: track_type.h:21
NWID_HORIZONTAL_LTR
@ NWID_HORIZONTAL_LTR
Horizontal container that doesn't change the order of the widgets for RTL languages.
Definition: widget_type.h:74
WID_RAT_AUTORAIL
@ WID_RAT_AUTORAIL
Autorail tool.
Definition: rail_widget.h:21
WID_BRAD_DEPOT_NE
@ WID_BRAD_DEPOT_NE
Build a depot with the entrance in the north east.
Definition: rail_widget.h:112
DIAGDIR_NW
@ DIAGDIR_NW
Northwest.
Definition: direction_type.h:82
WID_RAT_BUILD_STATION
@ WID_RAT_BUILD_STATION
Build a station.
Definition: rail_widget.h:25
NWID_MATRIX
@ NWID_MATRIX
Matrix container.
Definition: widget_type.h:76
TRACK_RIGHT
@ TRACK_RIGHT
Track in the right corner of the tile (east)
Definition: track_type.h:26
SetDataTip
static NWidgetPart SetDataTip(uint32 data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1109
WID_BRAD_DEPOT_NW
@ WID_BRAD_DEPOT_NW
Build a depot with the entrance in the north west.
Definition: rail_widget.h:115
WID_RAT_BUILD_X
@ WID_RAT_BUILD_X
Build rail along the game grid X axis.
Definition: rail_widget.h:18
DIAGDIR_SW
@ DIAGDIR_SW
Southwest.
Definition: direction_type.h:81
TRACK_Y
@ TRACK_Y
Track along the y-axis (north-west to south-east)
Definition: track_type.h:22
WID_RAT_BUILD_WAYPOINT
@ WID_RAT_BUILD_WAYPOINT
Build a waypoint.
Definition: rail_widget.h:24
TRACK_UPPER
@ TRACK_UPPER
Track in the upper corner of the tile (north)
Definition: track_type.h:23
BRASHK_FOCUS_FILTER_BOX
@ BRASHK_FOCUS_FILTER_BOX
Focus the edit box for editing the filter string.
Definition: rail_gui.cpp:895
WID_RAT_BUILD_BRIDGE
@ WID_RAT_BUILD_BRIDGE
Build a bridge.
Definition: rail_widget.h:27
TRACK_LEFT
@ TRACK_LEFT
Track in the left corner of the tile (west)
Definition: track_type.h:25
WID_RAT_CONVERT_RAIL
@ WID_RAT_CONVERT_RAIL
Convert other rail to this type.
Definition: rail_widget.h:30
WID_RAT_BUILD_TUNNEL
@ WID_RAT_BUILD_TUNNEL
Build a tunnel.
Definition: rail_widget.h:28
NWID_VERTICAL
@ NWID_VERTICAL
Vertical container.
Definition: widget_type.h:75
WID_RAT_BUILD_EW
@ WID_RAT_BUILD_EW
Build rail along the game view X axis.
Definition: rail_widget.h:19
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition: widget_type.h:67
WWT_RESIZEBOX
@ WWT_RESIZEBOX
Resize box (normally at bottom-right of a window)
Definition: widget_type.h:66
WID_BRW_WAYPOINT_MATRIX
@ WID_BRW_WAYPOINT_MATRIX
Matrix with waypoints.
Definition: rail_widget.h:120
WID_RAT_REMOVE
@ WID_RAT_REMOVE
Bulldozer to remove rail.
Definition: rail_widget.h:29
EndContainer
static NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1094
NWID_VSCROLLBAR
@ NWID_VSCROLLBAR
Vertical scrollbar.
Definition: widget_type.h:82
WID_BRW_SCROLL
@ WID_BRW_SCROLL
Scrollbar for the matrix.
Definition: rail_widget.h:122
NWidget
static NWidgetPart NWidget(WidgetType tp, Colours col, int16 idx=-1)
Widget part function for starting a new 'real' widget.
Definition: widget_type.h:1227
WID_BRW_WAYPOINT
@ WID_BRW_WAYPOINT
A single waypoint.
Definition: rail_widget.h:121
SetMinimalSize
static NWidgetPart SetMinimalSize(int16 x, int16 y)
Widget part function for setting the minimal size.
Definition: widget_type.h:1012
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:48
NWID_SPACER
@ NWID_SPACER
Invisible widget that takes some space.
Definition: widget_type.h:77
SetPIP
static NWidgetPart SetPIP(uint8 pre, uint8 inter, uint8 post)
Widget part function for setting a pre/inter/post spaces.
Definition: widget_type.h:1189
SetFill
static NWidgetPart SetFill(uint fill_x, uint fill_y)
Widget part function for setting filling.
Definition: widget_type.h:1078
WID_RAT_BUILD_NS
@ WID_RAT_BUILD_NS
Build rail along the game view Y axis.
Definition: rail_widget.h:17
WID_RAT_BUILD_DEPOT
@ WID_RAT_BUILD_DEPOT
Build a depot.
Definition: rail_widget.h:23
DIAGDIR_NE
@ DIAGDIR_NE
Northeast, upper right on your monitor.
Definition: direction_type.h:79
Hotkey
All data for a single hotkey.
Definition: hotkeys.h:22