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

Function ShowBuildRailToolbar

src/rail_gui.cpp:923–932  ·  view source on GitHub ↗

* 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. * * @param railtype Rail type to open the window for * @return newly opened rail toolbar, or nullptr if the toolbar could not be opened. */

Source from the content-addressed store, hash-verified

921 * @return newly opened rail toolbar, or nullptr if the toolbar could not be opened.
922 */
923Window *ShowBuildRailToolbar(RailType railtype)
924{
925 if (!Company::IsValidID(_local_company)) return nullptr;
926 if (!ValParamRailType(railtype)) return nullptr;
927
928 CloseWindowByClass(WC_BUILD_TOOLBAR);
929 _cur_railtype = railtype;
930 _remove_button_clicked = false;
931 return new BuildRailToolbarWindow(_build_rail_desc, railtype);
932}
933
934/* TODO: For custom stations, respect their allowed platforms/lengths bitmasks!
935 * --pasky */

Callers 3

MenuClickBuildRailFunction · 0.85
OnHotkeyMethod · 0.85

Calls 2

ValParamRailTypeFunction · 0.85
CloseWindowByClassFunction · 0.85

Tested by

no test coverage detected