summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-10-17 19:24:50 +0100
committerGitHub <noreply@github.com>2021-10-17 19:24:50 +0100
commit0853c1979ba3c778f0d1628276ed8cbe968b328e (patch)
treed4f41ceb6439658788293555b7a8247c228f2115
parent3b7daca83207636d84bd0232ce91ed8e9616b12f (diff)
downloadopenttd-0853c1979ba3c778f0d1628276ed8cbe968b328e.tar.xz
Feature: Button to toggle showing advanced signal types (#9617)
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/rail_gui.cpp7
-rw-r--r--src/widgets/rail_widget.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index a944e9b74..83ff02698 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2674,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Waypoints
# Signal window
STR_BUILD_SIGNAL_CAPTION :{WHITE}Signal Selection
+STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Toggle showing advanced signal types
STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Block Signal (semaphore){}This is the most basic type of signal, allowing only one train to be in the same block at the same time
STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Entry Signal (semaphore){}Green as long as there is one or more green exit-signal from the following section of track. Otherwise it shows red
STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Exit Signal (semaphore){}Behaves in the same way as a block signal but is necessary to trigger the correct colour on entry & combo pre-signals
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 7ce2f2784..c54e172a0 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1823,6 +1823,12 @@ public:
}
break;
+ case WID_BS_TOGGLE_SIZE:
+ _settings_client.gui.signal_gui_mode = (_settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL) ? SIGNAL_GUI_PATH : SIGNAL_GUI_ALL;
+ this->SetSignalUIMode();
+ this->ReInit();
+ break;
+
default: break;
}
@@ -1851,6 +1857,7 @@ static const NWidgetPart _nested_signal_builder_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_BS_CAPTION), SetDataTip(STR_BUILD_SIGNAL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_BS_TOGGLE_SIZE), SetDataTip(SPR_LARGE_SMALL_WINDOW, STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP),
EndContainer(),
NWidget(NWID_VERTICAL, NC_EQUALSIZE),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
diff --git a/src/widgets/rail_widget.h b/src/widgets/rail_widget.h
index 803599e3a..2874bac45 100644
--- a/src/widgets/rail_widget.h
+++ b/src/widgets/rail_widget.h
@@ -79,6 +79,7 @@ enum BuildRailStationWidgets {
/** Widgets of the #BuildSignalWindow class. */
enum BuildSignalWidgets {
WID_BS_CAPTION, ///< Caption for the Signal Selection window.
+ WID_BS_TOGGLE_SIZE, ///< Toggle showing advanced signal types.
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.