OpenTTD Source 20260711-master-g3fb3006dff
road_gui.h File Reference

Functions/types related to the road GUIs. More...

#include "road.h"
#include "road_type.h"
#include "tile_type.h"
#include "direction_type.h"
#include "dropdown_type.h"

Go to the source code of this file.

Functions

struct WindowShowBuildRoadToolbar (RoadType roadtype)
 Open the build road toolbar window.
struct WindowShowBuildRoadScenToolbar (RoadType roadtype)
 Show the road building toolbar in the scenario editor.
void ConnectRoadToStructure (TileIndex tile, DiagDirection direction)
 If required, connects a new structure to an existing road or tram by building the missing roadbit.
DropDownList GetRoadTypeDropDownList (RoadTramTypes rtts, bool for_replacement=false, bool all_option=false)
DropDownList GetScenRoadTypeDropDownList (RoadTramTypes rtts)
void SetDefaultRoadGui ()
 Set the initial (default) road & tram type to use.

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
tileTile containing the structure to connect.
directionDirection to check.

Definition at line 167 of file road_gui.cpp.

References Any, DiagDirToRoadBits(), GetRoadBits(), IsNormalRoadTile(), ReverseDiagDir(), and TileOffsByDiagDir().

Referenced by CcBuildBridge(), CcBuildRoadTunnel(), and CcRoadStop().

◆ GetRoadTypeDropDownList()

DropDownList GetRoadTypeDropDownList ( RoadTramTypes rtts,
bool for_replacement = false,
bool all_option = false )

Definition at line 1854 of file road_gui.cpp.

◆ GetScenRoadTypeDropDownList()

DropDownList GetScenRoadTypeDropDownList ( RoadTramTypes rtts)

Definition at line 1918 of file road_gui.cpp.

◆ SetDefaultRoadGui()

void SetDefaultRoadGui ( )

Set the initial (default) road & tram type to use.

Definition at line 1999 of file road_gui.cpp.

References _last_built_roadtype, _last_built_tramtype, _local_company, COMPANY_SPECTATOR, GetDefaultRoadType(), Road, and Tram.

Referenced by SetLocalCompany().

◆ ShowBuildRoadScenToolbar()

struct Window * ShowBuildRoadScenToolbar ( RoadType roadtype)

Show the road building toolbar in the scenario editor.

Parameters
roadtypeThe road type for the toolbar.
Returns
The just opened toolbar, or nullptr if the toolbar was already open.

Definition at line 1184 of file road_gui.cpp.

References _build_road_scen_desc, _build_tramway_scen_desc, AllocateWindowDescFront(), CloseWindowById(), and Road.

Referenced by ScenarioEditorToolbarWindow::OnHotkey(), BuildRoadToolbarWindow::RoadTramToolbarGlobalHotkeys(), ToolbarScenBuildRoad(), and ToolbarScenBuildTram().

◆ 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.

Parameters
roadtypeThe road type for the toolbar.
Returns
newly opened road toolbar, or nullptr if the toolbar could not be opened.

Definition at line 1081 of file road_gui.cpp.

References _build_road_desc, _build_tramway_desc, _local_company, AllocateWindowDescFront(), BringWindowToFrontById(), CloseWindowByClass(), Window::OnInvalidateData(), Road, and ValParamRoadType().

Referenced by MenuClickBuildRoad(), MenuClickBuildTram(), MainToolbarWindow::OnHotkey(), and BuildRoadToolbarWindow::RoadTramToolbarGlobalHotkeys().