* 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. */
| 1004 | * @return newly opened road toolbar, or nullptr if the toolbar could not be opened. |
| 1005 | */ |
| 1006 | Window *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 | |
| 1017 | static constexpr std::initializer_list<NWidgetPart> _nested_build_road_scen_widgets = { |
| 1018 | NWidget(NWID_HORIZONTAL), |
no test coverage detected