OpenTTD Source 20241224-master-gee860a5c8e
|
Functions/types etc. More...
Go to the source code of this file.
Enumerations | |
enum | SignalGUISettings : uint8_t { SIGNAL_GUI_PATH = 0 , SIGNAL_GUI_ALL = 1 } |
Settings for which signals are shown by the signal GUI. More... | |
enum | SignalCycleSettings : uint8_t { SIGNAL_CYCLE_GROUP = 0 , SIGNAL_CYCLE_ALL = 1 } |
Settings for which signals are cycled through by control-clicking on the signal with the signal tool. More... | |
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. | |
void | ResetSignalVariant (int32_t=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, bool all_option=false) |
Create a drop down list for all the rail types of the local company. | |
enum SignalCycleSettings : uint8_t |
Settings for which signals are cycled through by control-clicking on the signal with the signal tool.
Enumerator | |
---|---|
SIGNAL_CYCLE_GROUP | Cycle through current signal group (block or path) only. |
SIGNAL_CYCLE_ALL | Cycle through all signals visible to the player. |
Definition at line 29 of file rail_gui.h.
enum SignalGUISettings : uint8_t |
Settings for which signals are shown by the signal GUI.
Enumerator | |
---|---|
SIGNAL_GUI_PATH | Show path signals only. |
SIGNAL_GUI_ALL | Show all signals, including block and presignals. |
Definition at line 23 of file rail_gui.h.
DropDownList GetRailTypeDropDownList | ( | bool | for_replacement, |
bool | all_option | ||
) |
Create a drop down list for all the rail types of the local company.
for_replacement | Whether this list is for the replacement window. |
all_option | Whether to add an 'all types' item. |
Definition at line 2011 of file rail_gui.cpp.
References _local_company, Company::avail_railtypes, RailTypeInfo::build_x_rail, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), GetCompanyRailTypes(), GetRailTypeInfo(), GetRailTypes(), GetSpriteSize(), RailTypeInfo::gui_sprites, HasBit(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_RAILTYPE, RailTypeInfo::max_speed, maxdim(), RailTypeInfo::menu_text, RailTypeInfo::replace_text, SetDParam(), and RailTypeInfo::strings.
Referenced by ReplaceVehicleWindow::OnClick().
void InitializeRailGUI | ( | ) |
Resets the rail GUI - sets default railtype to build and resets the signal GUI.
Definition at line 1996 of file rail_gui.cpp.
References _convert_signal_button, _cur_signal_type, _settings_client, GUISettings::default_signal_type, ClientSettings::gui, ResetSignalVariant(), and SetDefaultRailGui().
Referenced by AfterLoadGame().
void ReinitGuiAfterToggleElrail | ( | bool | disable | ) |
Re-initialize rail-build toolbar after toggling support for electric trains.
disable | Boolean whether electric trains are disabled (removed from the game) |
Definition at line 1908 of file rail_gui.cpp.
References _cur_railtype, FindWindowById(), MarkWholeScreenDirty(), BuildRailToolbarWindow::ModifyRailType(), RAILTYPE_ELECTRIC, RAILTYPE_RAIL, TRANSPORT_RAIL, and WC_BUILD_TOOLBAR.
void ResetSignalVariant | ( | int32_t | = 0 | ) |
Updates the current signal variant used in the signal GUI to the one adequate to current year.
Definition at line 1971 of file rail_gui.cpp.
References _cur_signal_type, _cur_signal_variant, _settings_client, FindWindowById(), ClientSettings::gui, Window::RaiseWidget(), GUISettings::semaphore_build_before, Window::SetDirty(), SIG_ELECTRIC, SIG_SEMAPHORE, WC_BUILD_SIGNAL, WID_BS_ELECTRIC_NORM, WID_BS_SEMAPHORE_NORM, and TimerGameCalendar::year.
Referenced by ClickChangeDateCheat(), and InitializeRailGUI().
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.
railtype | Rail type to open the window for |
Definition at line 918 of file rail_gui.cpp.
References _cur_railtype, _local_company, _remove_button_clicked, CloseWindowByClass(), 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 BuildRailToolbarWindow::RailToolbarGlobalHotkeys().