# rail_gui.h File Reference

Functions/types etc. More...

`#include "rail_type.h"`

Go to the source code of this file.

## Functions
void | ShowBuildRailToolbar (RailType railtype, int button)
| Open the build rail toolbar window for a specific rail type.
void | ReinitGuiAfterToggleElrail (bool disable)
| Re-initialize rail-build toolbar after toggling support for electric trains.
bool | ResetSignalVariant (int32=0)
| Updates the current signal variant used in the signal GUI to the one adequate to current year.

## Detailed Description

Functions/types etc.

related to the rail GUI.

Definition in file rail_gui.h.

## Function Documentation

void ReinitGuiAfterToggleElrail | ( | bool | disable | ) |

Re-initialize rail-build toolbar after toggling support for electric trains.

Parameters:

  | disable | Boolean whether electric trains are disabled (removed from the game)

Definition at line 1898 of file rail_gui.cpp.

References _cur_railtype, FindWindowById(), MarkWholeScreenDirty(), BuildRailToolbarWindow::ModifyRailType(), RAILTYPE_ELECTRIC, RAILTYPE_RAIL, and TRANSPORT_RAIL.

Referenced by SettingsDisableElrail().

bool ResetSignalVariant | ( | int32 | p = `0` | ) |

Updates the current signal variant used in the signal GUI to the one adequate to current year.

Parameters:

  | p | needed to be called when a setting changes

Returns:
  success, needed for settings

Definition at line 1960 of file rail_gui.cpp.

References _cur_signal_type, _cur_signal_variant, _cur_year, _settings_client, FindWindowById(), ClientSettings::gui, Window::RaiseWidget(), GUISettings::semaphore_build_before, Window::SetDirty(), SIG_ELECTRIC, and SIG_SEMAPHORE.

Referenced by ClickChangeDateCheat(), InitializeRailGUI(), and OnNewYear().

void ShowBuildRailToolbar | ( | RailType | railtype,
|  | int | button |
| ) |  |  |

Open the build rail toolbar window for a specific rail type.

The window may be opened in the 'normal' way by clicking at the rail icon in the main toolbar, or by means of selecting one of the functions of the toolbar. In the latter case, the corresponding widget is also selected.

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

Parameters:

  | railtype | Rail type to open the window for
  | button | Widget clicked (`-1` means no button clicked)

Definition at line 877 of file rail_gui.cpp.

References _cur_railtype, _remove_button_clicked, RailBuildingGUIButtonData::click_proc, DeleteWindowByClass(), FindWindowById(), TRANSPORT_RAIL, BuildRailToolbarWindow::UpdateRemoveWidgetStatus(), and ValParamRailtype().