From 9a1370c48c13a4163186f03670c5c49aac2866d3 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sat, 13 Jan 2024 19:13:17 -0500 Subject: [PATCH] Fix #10118: Always cycle through all visible signal types --- src/lang/english.txt | 6 ------ src/rail_gui.cpp | 4 ++-- src/rail_gui.h | 6 ------ src/settings_gui.cpp | 1 - src/settings_type.h | 1 - src/table/settings/gui_settings.ini | 13 ------------- 6 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index 4a07f6cf00..9741a4fc2d 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1873,12 +1873,6 @@ 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_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 built signal with the signal tool -###length 2 -STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Path signals only -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 diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 7ed5e2159c..2f11ffbca5 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -240,8 +240,8 @@ static void GenericPlaceSignals(TileIndex tile) if (_remove_button_clicked) { Command::Post(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, tile, track); } else { - /* Which signals should we cycle through? */ - SignalType cycle_start = _settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_ALL && _settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL ? SIGTYPE_BLOCK : SIGTYPE_PBS; + /* Only cycle through signals that are visible in the menu. */ + SignalType cycle_start = _settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL ? SIGTYPE_BLOCK : SIGTYPE_PBS; if (FindWindowById(WC_BUILD_SIGNAL, 0) != nullptr) { /* signal GUI is used */ diff --git a/src/rail_gui.h b/src/rail_gui.h index 9af41eb82e..defe11065d 100644 --- a/src/rail_gui.h +++ b/src/rail_gui.h @@ -25,10 +25,4 @@ enum SignalGUISettings : uint8_t { 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_t { - 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 944b3273ff..ef5f2afa1e 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1861,7 +1861,6 @@ static SettingsContainer &GetSettingsTree() construction->Add(new SettingEntry("gui.default_rail_type")); construction->Add(new SettingEntry("gui.semaphore_build_before")); construction->Add(new SettingEntry("gui.signal_gui_mode")); - construction->Add(new SettingEntry("gui.cycle_signal_types")); construction->Add(new SettingEntry("gui.drag_signals_fixed_distance")); construction->Add(new SettingEntry("gui.auto_remove_signals")); } diff --git a/src/settings_type.h b/src/settings_type.h index dcae83b814..2bd5be55d6 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -165,7 +165,6 @@ struct GUISettings { RightClickClose right_click_wnd_close; ///< close window with right click bool pause_on_newgame; ///< whether to start new games paused or not 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. SignalType default_signal_type; ///< The default signal type, which is set automatically by the last signal used. Not available in Settings. TimerGameCalendar::Year coloured_news_year; ///< when does newspaper become coloured? TimetableMode timetable_mode; ///< Time units for timetables: days, seconds, or ticks diff --git a/src/table/settings/gui_settings.ini b/src/table/settings/gui_settings.ini index fa3eef9a9f..e7889150f3 100644 --- a/src/table/settings/gui_settings.ini +++ b/src/table/settings/gui_settings.ini @@ -508,19 +508,6 @@ strhelp = STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT 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