MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ShowBuildRoadToolbar

Function ShowBuildRoadToolbar

src/road_gui.cpp:1006–1015  ·  view source on GitHub ↗

* Open the build road toolbar window * * If the terraform toolbar is linked to the toolbar, that window is also opened. * * @return newly opened road toolbar, or nullptr if the toolbar could not be opened. */

Source from the content-addressed store, hash-verified

1004 * @return newly opened road toolbar, or nullptr if the toolbar could not be opened.
1005 */
1006Window *ShowBuildRoadToolbar(RoadType roadtype)
1007{
1008 if (!Company::IsValidID(_local_company)) return nullptr;
1009 if (!ValParamRoadType(roadtype)) return nullptr;
1010
1011 CloseWindowByClass(WC_BUILD_TOOLBAR);
1012 _cur_roadtype = roadtype;
1013
1014 return AllocateWindowDescFront<BuildRoadToolbarWindow>(RoadTypeIsRoad(_cur_roadtype) ? _build_road_desc : _build_tramway_desc, TRANSPORT_ROAD);
1015}
1016
1017static constexpr std::initializer_list<NWidgetPart> _nested_build_road_scen_widgets = {
1018 NWidget(NWID_HORIZONTAL),

Callers 4

MenuClickBuildRoadFunction · 0.85
MenuClickBuildTramFunction · 0.85
OnHotkeyMethod · 0.85

Calls 3

ValParamRoadTypeFunction · 0.85
CloseWindowByClassFunction · 0.85
RoadTypeIsRoadFunction · 0.85

Tested by

no test coverage detected