OpenTTD Source: src/road_gui.h File Reference

OpenTTD Source 14.0-RC3

Functions
road_gui.h File Reference
`#include "road_type.h"`
`#include "tile_type.h"`
`#include "direction_type.h"`
`#include "widgets/dropdown_type.h"`

Go to the source code of this file.

## Functions
struct Window * | ShowBuildRoadToolbar (RoadType roadtype)
| Open the build road toolbar window. More...
struct Window * | ShowBuildRoadScenToolbar (RoadType roadtype)
| Show the road building toolbar in the scenario editor. More...
void | ConnectRoadToStructure (TileIndex tile, DiagDirection direction)
| If required, connects a new structure to an existing road or tram by building the missing roadbit. More...
DropDownList | GetRoadTypeDropDownList (RoadTramTypes rtts, bool for_replacement=false, bool all_option=false)
DropDownList | GetScenRoadTypeDropDownList (RoadTramTypes rtts)
void | InitializeRoadGUI ()
| I really don't know why rail_gui.cpp has this too, shouldn't be included in the other one?

## Detailed Description

Functions/types related to the road GUIs.

Definition in file road_gui.h.

## Function Documentation

## ◆ ConnectRoadToStructure()

void ConnectRoadToStructure | ( | TileIndex | tile,
|  | DiagDirection | direction
| ) |  |

If required, connects a new structure to an existing road or tram by building the missing roadbit.

Parameters

  tile | Tile containing the structure to connect.
  direction | Direction to check.

Definition at line 149 of file road_gui.cpp.

References GetRoadBits(), IsNormalRoadTile(), and TileOffsByDiagDir().

## ◆ ShowBuildRoadScenToolbar()

struct Window* ShowBuildRoadScenToolbar | ( | RoadType | roadtype | ) |

Show the road building toolbar in the scenario editor.

Returns
  The just opened toolbar, or `nullptr` if the toolbar was already open.

Definition at line 997 of file road_gui.cpp.

References CloseWindowById(), TRANSPORT_ROAD, and WC_SCEN_BUILD_TOOLBAR.

## ◆ ShowBuildRoadToolbar()

struct Window* ShowBuildRoadToolbar | ( | RoadType | roadtype | ) |

Open the build road toolbar window.

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

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

Definition at line 910 of file road_gui.cpp.

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