summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lang/english.txt23
-rw-r--r--src/rail_gui.cpp82
-rw-r--r--src/rail_gui.h12
-rw-r--r--src/settings_gui.cpp3
-rw-r--r--src/settings_table.cpp7
-rw-r--r--src/settings_type.h6
-rw-r--r--src/table/settings/gui_settings.ini59
-rw-r--r--src/widgets/rail_widget.h25
8 files changed, 127 insertions, 90 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index d76f9caee..b6578ac8d 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1814,22 +1814,17 @@ STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Select the beha
STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Automatically build semaphores before: {STRING2}
STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Set the year when electric signals will be used for tracks. Before this year, non-electric signals will be used (which have the exact same function, but different looks)
-STR_CONFIG_SETTING_ENABLE_SIGNAL_GUI :Enable the signal GUI: {STRING2}
-STR_CONFIG_SETTING_ENABLE_SIGNAL_GUI_HELPTEXT :Display a window for choosing signal types to build, instead of only window-less signal-type rotation with Ctrl+clicking on built signals
-
-STR_CONFIG_SETTING_DEFAULT_SIGNAL_TYPE :Signal type to build by default: {STRING2}
-STR_CONFIG_SETTING_DEFAULT_SIGNAL_TYPE_HELPTEXT :Default signal type to use
-###length 3
-STR_CONFIG_SETTING_DEFAULT_SIGNAL_NORMAL :Block signals
-STR_CONFIG_SETTING_DEFAULT_SIGNAL_PBS :Path signals
-STR_CONFIG_SETTING_DEFAULT_SIGNAL_PBSOWAY :One-way path signals
-
STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Cycle through signal types: {STRING2}
-STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Select which signal types to cycle through, when Ctrl+clicking on a build signal with the signal tool
-###length 3
-STR_CONFIG_SETTING_CYCLE_SIGNAL_NORMAL :Block signals only
+STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Select which signal types to cycle through when Ctrl+clicking on a built signal with the signal tool
+###length 2
STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Path signals only
-STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :All
+STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :All visible
+
+STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Show signal types: {STRING2}
+STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Choose which signal types are shown in the signal toolbar
+###length 2
+STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Path signals only
+STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :All signals
STR_CONFIG_SETTING_TOWN_LAYOUT :Road layout for new towns: {STRING2}
STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Layout for the road network of towns
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 871938d20..7ce2f2784 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -54,9 +54,6 @@ static bool _convert_signal_button; ///< convert signal button in the s
static SignalVariant _cur_signal_variant; ///< set the signal variant (for signal GUI)
static SignalType _cur_signal_type; ///< set the signal type (for signal GUI)
-/* Map the setting: default_signal_type to the corresponding signal type */
-static const SignalType _default_signal_type[] = {SIGTYPE_NORMAL, SIGTYPE_PBS, SIGTYPE_PBS_ONEWAY};
-
struct RailStationGUISettings {
Axis orientation; ///< Currently selected rail station orientation
@@ -231,25 +228,31 @@ static void GenericPlaceSignals(TileIndex tile)
} else {
const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0);
- /* Map the setting cycle_signal_types to the lower and upper allowed signal type. */
- static const uint cycle_bounds[] = {SIGTYPE_NORMAL | (SIGTYPE_LAST_NOPBS << 3), SIGTYPE_PBS | (SIGTYPE_LAST << 3), SIGTYPE_NORMAL | (SIGTYPE_LAST << 3)};
-
/* various bitstuffed elements for CmdBuildSingleSignal() */
uint32 p1 = track;
+ /* Which signals should we cycle through? */
+ uint8 cycle_types;
+
+ if (_settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_ALL && _settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL) {
+ cycle_types = SIGTYPE_NORMAL | (SIGTYPE_LAST << 3);
+ } else {
+ cycle_types = SIGTYPE_PBS | (SIGTYPE_LAST << 3);
+ }
+
if (w != nullptr) {
/* signal GUI is used */
SB(p1, 3, 1, _ctrl_pressed);
SB(p1, 4, 1, _cur_signal_variant);
SB(p1, 5, 3, _cur_signal_type);
SB(p1, 8, 1, _convert_signal_button);
- SB(p1, 9, 6, cycle_bounds[_settings_client.gui.cycle_signal_types]);
+ SB(p1, 9, 6, cycle_types);
} else {
SB(p1, 3, 1, _ctrl_pressed);
SB(p1, 4, 1, (_cur_year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC));
- SB(p1, 5, 3, _default_signal_type[_settings_client.gui.default_signal_type]);
+ SB(p1, 5, 3, SIGTYPE_PBS_ONEWAY);
SB(p1, 8, 1, 0);
- SB(p1, 9, 6, cycle_bounds[_settings_client.gui.cycle_signal_types]);
+ SB(p1, 9, 6, cycle_types);
}
DoCommandP(tile, p1, 0, CMD_BUILD_SIGNALS |
@@ -404,7 +407,7 @@ static void HandleAutoSignalPlacement()
SB(p2, 3, 1, 0);
SB(p2, 4, 1, (_cur_year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC));
SB(p2, 6, 1, _ctrl_pressed);
- SB(p2, 7, 3, _default_signal_type[_settings_client.gui.default_signal_type]);
+ SB(p2, 7, 3, SIGTYPE_PBS_ONEWAY);
SB(p2, 24, 8, _settings_client.gui.drag_signals_density);
SB(p2, 10, 1, !_settings_client.gui.drag_signals_fixed_distance);
}
@@ -576,7 +579,7 @@ struct BuildRailToolbarWindow : Window {
case WID_RAT_BUILD_SIGNALS: {
this->last_user_action = widget;
bool started = HandlePlacePushButton(this, WID_RAT_BUILD_SIGNALS, ANIMCURSOR_BUILDSIGNALS, HT_RECT);
- if (started && _settings_client.gui.enable_signal_gui != _ctrl_pressed) {
+ if (started != _ctrl_pressed) {
ShowSignalBuilder(this);
}
break;
@@ -1690,10 +1693,27 @@ private:
y + this->IsWidgetLowered(widget_index));
}
+ /** Show or hide buttons for non-path signals in the signal GUI */
+ void SetSignalUIMode()
+ {
+ bool show_non_path_signals = (_settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL);
+
+ this->GetWidget<NWidgetStacked>(WID_BS_SEMAPHORE_NORM_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ this->GetWidget<NWidgetStacked>(WID_BS_ELECTRIC_NORM_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ this->GetWidget<NWidgetStacked>(WID_BS_SEMAPHORE_ENTRY_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ this->GetWidget<NWidgetStacked>(WID_BS_ELECTRIC_ENTRY_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ this->GetWidget<NWidgetStacked>(WID_BS_SEMAPHORE_EXIT_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ this->GetWidget<NWidgetStacked>(WID_BS_ELECTRIC_EXIT_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ this->GetWidget<NWidgetStacked>(WID_BS_SEMAPHORE_COMBO_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ this->GetWidget<NWidgetStacked>(WID_BS_ELECTRIC_COMBO_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
+ }
+
public:
BuildSignalWindow(WindowDesc *desc, Window *parent) : PickerWindowBase(desc, parent)
{
- this->InitNested(TRANSPORT_RAIL);
+ this->CreateNestedTree();
+ this->SetSignalUIMode();
+ this->FinishInitNested(TRANSPORT_RAIL);
this->OnInvalidateData();
}
@@ -1731,6 +1751,8 @@ public:
} else if (IsInsideMM(widget, WID_BS_SEMAPHORE_NORM, WID_BS_ELECTRIC_PBS_OWAY + 1)) {
size->width = std::max(size->width, this->sig_sprite_size.width + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT);
size->height = std::max(size->height, this->sig_sprite_size.height + WD_IMGBTN_TOP + WD_IMGBTN_BOTTOM);
+ } else if (widget == WID_BS_CAPTION) {
+ size->width += WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT;
}
}
@@ -1828,23 +1850,39 @@ public:
static const NWidgetPart _nested_signal_builder_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
- NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_BUILD_SIGNAL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_BS_CAPTION), SetDataTip(STR_BUILD_SIGNAL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
EndContainer(),
NWidget(NWID_VERTICAL, NC_EQUALSIZE),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_NORM), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP), EndContainer(), SetFill(1, 1),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_ENTRY), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP), EndContainer(), SetFill(1, 1),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_EXIT), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP), EndContainer(), SetFill(1, 1),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_COMBO), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP), EndContainer(), SetFill(1, 1),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_SEMAPHORE_NORM_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_NORM), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_SEMAPHORE_ENTRY_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_ENTRY), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_SEMAPHORE_EXIT_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_EXIT), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_SEMAPHORE_COMBO_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_COMBO), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_PBS), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_PBS_TOOLTIP), EndContainer(), SetFill(1, 1),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_SEMAPHORE_PBS_OWAY), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TOOLTIP), EndContainer(), SetFill(1, 1),
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_BS_CONVERT), SetDataTip(SPR_IMG_SIGNAL_CONVERT, STR_BUILD_SIGNAL_CONVERT_TOOLTIP), SetFill(1, 1),
EndContainer(),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_NORM), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP), EndContainer(), SetFill(1, 1),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_ENTRY), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP), EndContainer(), SetFill(1, 1),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_EXIT), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP), EndContainer(), SetFill(1, 1),
- NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_COMBO), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP), EndContainer(), SetFill(1, 1),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_ELECTRIC_NORM_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_NORM), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_ELECTRIC_ENTRY_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_ENTRY), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_ELECTRIC_EXIT_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_EXIT), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_ELECTRIC_COMBO_SEL),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_COMBO), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP), EndContainer(), SetFill(1, 1),
+ EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_PBS), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP), EndContainer(), SetFill(1, 1),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BS_ELECTRIC_PBS_OWAY), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP), EndContainer(), SetFill(1, 1),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetDataTip(STR_NULL, STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP), SetFill(1, 1),
@@ -2158,7 +2196,7 @@ void InitializeRailGUI()
SetDefaultRailGui();
_convert_signal_button = false;
- _cur_signal_type = _default_signal_type[_settings_client.gui.default_signal_type];
+ _cur_signal_type = SIGTYPE_PBS_ONEWAY;
ResetSignalVariant();
}
diff --git a/src/rail_gui.h b/src/rail_gui.h
index 81fb8f627..582176493 100644
--- a/src/rail_gui.h
+++ b/src/rail_gui.h
@@ -19,4 +19,16 @@ void ResetSignalVariant(int32 = 0);
void InitializeRailGUI();
DropDownList GetRailTypeDropDownList(bool for_replacement = false, bool all_option = false);
+/** Settings for which signals are shown by the signal GUI. */
+enum SignalGUISettings : uint8 {
+ SIGNAL_GUI_PATH = 0, ///< Show path signals only.
+ SIGNAL_GUI_ALL = 1, ///< Show all signals, including block and presignals.
+};
+
+/** Settings for which signals are cycled through by control-clicking on the signal with the signal tool. */
+enum SignalCycleSettings : uint8 {
+ SIGNAL_CYCLE_PATH = 0, ///< Cycle through path signals only.
+ SIGNAL_CYCLE_ALL = 1, ///< Cycle through all signals visible.
+};
+
#endif /* RAIL_GUI_H */
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 04deb93eb..ae894cd50 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1622,7 +1622,6 @@ static SettingsContainer &GetSettingsTree()
SettingsPage *construction = interface->Add(new SettingsPage(STR_CONFIG_SETTING_INTERFACE_CONSTRUCTION));
{
construction->Add(new SettingEntry("gui.link_terraform_toolbar"));
- construction->Add(new SettingEntry("gui.enable_signal_gui"));
construction->Add(new SettingEntry("gui.persistent_buildingtools"));
construction->Add(new SettingEntry("gui.quick_goto"));
construction->Add(new SettingEntry("gui.default_rail_type"));
@@ -1667,8 +1666,8 @@ static SettingsContainer &GetSettingsTree()
SettingsPage *company = main->Add(new SettingsPage(STR_CONFIG_SETTING_COMPANY));
{
company->Add(new SettingEntry("gui.semaphore_build_before"));
- company->Add(new SettingEntry("gui.default_signal_type"));
company->Add(new SettingEntry("gui.cycle_signal_types"));
+ company->Add(new SettingEntry("gui.signal_gui_mode"));
company->Add(new SettingEntry("gui.drag_signals_fixed_distance"));
company->Add(new SettingEntry("gui.auto_remove_signals"));
company->Add(new SettingEntry("gui.new_nonstop"));
diff --git a/src/settings_table.cpp b/src/settings_table.cpp
index 27fb4ef08..4b94a8be7 100644
--- a/src/settings_table.cpp
+++ b/src/settings_table.cpp
@@ -109,13 +109,6 @@ static void StationSpreadChanged(int32 p1)
InvalidateWindowData(WC_BUILD_STATION, 0);
}
-static void CloseSignalGUI(int32 new_value)
-{
- if (new_value == 0) {
- CloseWindowByClass(WC_BUILD_SIGNAL);
- }
-}
-
static void UpdateConsists(int32 new_value)
{
for (Train *t : Train::Iterate()) {
diff --git a/src/settings_type.h b/src/settings_type.h
index dd49d3982..3c2f2be7b 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -20,6 +20,7 @@
#include "linkgraph/linkgraph_type.h"
#include "zoom_type.h"
#include "openttd.h"
+#include "rail_gui.h"
/* Used to validate sizes of "max" value in settings. */
const size_t MAX_SLE_UINT8 = UINT8_MAX;
@@ -143,7 +144,8 @@ struct GUISettings {
bool timetable_arrival_departure; ///< show arrivals and departures in vehicle timetables
bool right_mouse_wnd_close; ///< close window with right click
bool pause_on_newgame; ///< whether to start new games paused or not
- bool enable_signal_gui; ///< show the signal GUI when the signal button is pressed
+ SignalGUISettings signal_gui_mode; ///< select which signal types are shown in the signal GUI
+ SignalCycleSettings cycle_signal_types; ///< Which signal types to cycle with the build signal tool.
Year coloured_news_year; ///< when does newspaper become coloured?
bool timetable_in_ticks; ///< whether to show the timetable in ticks rather than days
bool quick_goto; ///< Allow quick access to 'goto button' in vehicle orders window
@@ -153,8 +155,6 @@ struct GUISettings {
Year semaphore_build_before; ///< build semaphore signals automatically before this year
byte news_message_timeout; ///< how much longer than the news message "age" should we keep the message in the history
bool show_track_reservation; ///< highlight reserved tracks.
- uint8 default_signal_type; ///< the signal type to build by default.
- uint8 cycle_signal_types; ///< what signal types to cycle with the build signal tool.
byte station_numtracks; ///< the number of platforms to default on for rail stations
byte station_platlength; ///< the platform length, in tiles, for rail stations
bool station_dragdrop; ///< whether drag and drop is enabled for stations
diff --git a/src/table/settings/gui_settings.ini b/src/table/settings/gui_settings.ini
index f08c84981..277586f91 100644
--- a/src/table/settings/gui_settings.ini
+++ b/src/table/settings/gui_settings.ini
@@ -10,7 +10,6 @@
static void v_PositionMainToolbar(int32 new_value);
static void v_PositionStatusbar(int32 new_value);
static void RedrawSmallmap(int32 new_value);
-static void CloseSignalGUI(int32 new_value);
static void InvalidateCompanyLiveryWindow(int32 new_value);
static void InvalidateNewGRFChangeWindows(int32 new_value);
static void ZoomMinMaxChanged(int32 new_value);
@@ -446,14 +445,18 @@ strhelp = STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_HELPTEXT
strval = STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_FIRST
cat = SC_BASIC
-[SDTC_BOOL]
-var = gui.enable_signal_gui
-flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
-def = true
-str = STR_CONFIG_SETTING_ENABLE_SIGNAL_GUI
-strhelp = STR_CONFIG_SETTING_ENABLE_SIGNAL_GUI_HELPTEXT
-post_cb = CloseSignalGUI
-cat = SC_EXPERT
+[SDTC_VAR]
+var = gui.signal_gui_mode
+type = SLE_UINT8
+flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
+def = 0
+min = 0
+max = 1
+str = STR_CONFIG_SETTING_SIGNAL_GUI_MODE
+strhelp = STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT
+strval = STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH
+post_cb = [](auto) { CloseWindowByClass(WC_BUILD_SIGNAL); }
+cat = SC_ADVANCED
[SDTC_VAR]
var = gui.coloured_news_year
@@ -469,6 +472,19 @@ strval = STR_JUST_INT
cat = SC_EXPERT
[SDTC_VAR]
+var = gui.cycle_signal_types
+type = SLE_UINT8
+flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
+def = 0
+min = 0
+max = 1
+interval = 1
+str = STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES
+strhelp = STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT
+strval = STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS
+cat = SC_ADVANCED
+
+[SDTC_VAR]
var = gui.drag_signals_density
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
@@ -598,31 +614,6 @@ post_cb = [](auto) { MarkWholeScreenDirty(); }
cat = SC_BASIC
[SDTC_VAR]
-var = gui.default_signal_type
-type = SLE_UINT8
-flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
-def = 1
-min = 0
-max = 2
-interval = 1
-str = STR_CONFIG_SETTING_DEFAULT_SIGNAL_TYPE
-strhelp = STR_CONFIG_SETTING_DEFAULT_SIGNAL_TYPE_HELPTEXT
-strval = STR_CONFIG_SETTING_DEFAULT_SIGNAL_NORMAL
-cat = SC_BASIC
-
-[SDTC_VAR]
-var = gui.cycle_signal_types
-type = SLE_UINT8
-flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
-def = 2
-min = 0
-max = 2
-interval = 1
-str = STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES
-strhelp = STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT
-strval = STR_CONFIG_SETTING_CYCLE_SIGNAL_NORMAL
-
-[SDTC_VAR]
var = gui.station_numtracks
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
diff --git a/src/widgets/rail_widget.h b/src/widgets/rail_widget.h
index f10f9bee4..803599e3a 100644
--- a/src/widgets/rail_widget.h
+++ b/src/widgets/rail_widget.h
@@ -78,22 +78,31 @@ enum BuildRailStationWidgets {
/** Widgets of the #BuildSignalWindow class. */
enum BuildSignalWidgets {
- WID_BS_SEMAPHORE_NORM, ///< Build a semaphore normal block signal
- WID_BS_SEMAPHORE_ENTRY, ///< Build a semaphore entry block signal
- WID_BS_SEMAPHORE_EXIT, ///< Build a semaphore exit block signal
- WID_BS_SEMAPHORE_COMBO, ///< Build a semaphore combo block signal
+ WID_BS_CAPTION, ///< Caption for the Signal Selection window.
+ WID_BS_SEMAPHORE_NORM, ///< Build a semaphore normal block signal.
+ WID_BS_SEMAPHORE_ENTRY, ///< Build a semaphore entry block signal.
+ WID_BS_SEMAPHORE_EXIT, ///< Build a semaphore exit block signal.
+ WID_BS_SEMAPHORE_COMBO, ///< Build a semaphore combo block signal.
WID_BS_SEMAPHORE_PBS, ///< Build a semaphore path signal.
WID_BS_SEMAPHORE_PBS_OWAY, ///< Build a semaphore one way path signal.
- WID_BS_ELECTRIC_NORM, ///< Build an electric normal block signal
- WID_BS_ELECTRIC_ENTRY, ///< Build an electric entry block signal
- WID_BS_ELECTRIC_EXIT, ///< Build an electric exit block signal
- WID_BS_ELECTRIC_COMBO, ///< Build an electric combo block signal
+ WID_BS_ELECTRIC_NORM, ///< Build an electric normal block signal.
+ WID_BS_ELECTRIC_ENTRY, ///< Build an electric entry block signal.
+ WID_BS_ELECTRIC_EXIT, ///< Build an electric exit block signal.
+ WID_BS_ELECTRIC_COMBO, ///< Build an electric combo block signal.
WID_BS_ELECTRIC_PBS, ///< Build an electric path signal.
WID_BS_ELECTRIC_PBS_OWAY, ///< Build an electric one way path signal.
WID_BS_CONVERT, ///< Convert the signal.
WID_BS_DRAG_SIGNALS_DENSITY_LABEL, ///< The current signal density.
WID_BS_DRAG_SIGNALS_DENSITY_DECREASE, ///< Decrease the signal density.
WID_BS_DRAG_SIGNALS_DENSITY_INCREASE, ///< Increase the signal density.
+ WID_BS_SEMAPHORE_NORM_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_NORM.
+ WID_BS_ELECTRIC_NORM_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_NORM.
+ WID_BS_SEMAPHORE_ENTRY_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_ENTRY.
+ WID_BS_ELECTRIC_ENTRY_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_ENTRY.
+ WID_BS_SEMAPHORE_EXIT_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_EXIT.
+ WID_BS_ELECTRIC_EXIT_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_EXIT.
+ WID_BS_SEMAPHORE_COMBO_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_COMBO.
+ WID_BS_ELECTRIC_COMBO_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_COMBO.
};
/** Widgets of the #BuildRailDepotWindow class. */