OpenTTD: src/rail_gui.h File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Functions
rail_gui.h File Reference

Functions/types etc. More...

`#include "rail_type.h"`
`#include "widgets/dropdown_type.h"`

Go to the source code of this file.

## Functions
struct Window * | ShowBuildRailToolbar (RailType railtype)
| 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.
void | InitializeRailGUI ()
| Resets the rail GUI - sets default railtype to build and resets the signal GUI.
DropDownList * | GetRailTypeDropDownList (bool for_replacement=false)
| Create a drop down list for all the rail types of the local company.

## Detailed Description

Functions/types etc.

related to the rail GUI.

Definition in file rail_gui.h.

## Function Documentation

DropDownList* GetRailTypeDropDownList | ( | bool | for_replacement | ) |

Create a drop down list for all the rail types of the local company.

Parameters

  for_replacement | Whether this list is for the replacement window.

Returns
  The populated and sorted DropDownList.

Definition at line 1985 of file rail_gui.cpp.

References _local_company, _settings_game, AddDateIntroducedRailTypes(), SmallVector< T, S >::Append(), CompanyProperties::avail_railtypes, SmallVector< T, S >::Begin(), EngineInfo::climates, CompareRailTypes(), GameSettings::game_creation, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), GetRailTypeInfo(), HasBit(), RailtypeInfo::introduces_railtypes, RailtypeInfo::label, GameCreationSettings::landscape, SmallVector< T, S >::Length(), MAX_DAY, RailtypeInfo::max_speed, RailtypeInfo::menu_text, QSortT(), RAILTYPE_BEGIN, RAILTYPE_END, RAILTYPES_NONE, RailtypeInfo::replace_text, RailtypeInfo::strings, and VEH_TRAIN.

Referenced by ReplaceVehicleWindow::OnClick().

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 1878 of file rail_gui.cpp.

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

Referenced by SettingsDisableElrail().

bool ResetSignalVariant | ( | int32 | p | ) |

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 1940 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, SIG_SEMAPHORE, WC_BUILD_SIGNAL, WID_BS_ELECTRIC_NORM, and WID_BS_SEMAPHORE_NORM.

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

struct Window* ShowBuildRailToolbar | ( | RailType | railtype | ) |
| read

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.

Parameters

  railtype | Rail type to open the window for

Returns
  newly opened rail toolbar, or NULL if the toolbar could not be opened.

Definition at line 854 of file rail_gui.cpp.

References _cur_railtype, _local_company, _remove_button_clicked, DeleteWindowByClass(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), ValParamRailtype(), and WC_BUILD_TOOLBAR.

Referenced by MenuClickBuildRail(), MainToolbarWindow::OnHotkey(), and RailToolbarGlobalHotkeys().