From ef4514862bb8e0d29fe4a1f80c77b1cdfe524d88 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 20 Jul 2025 22:00:08 -0400 Subject: [PATCH] Fix: Missing beeps for various buttons --- src/depot_gui.cpp | 3 +++ src/genworld_gui.cpp | 9 +++++++++ src/picker_gui.cpp | 2 ++ src/rail_gui.cpp | 3 +++ src/town_gui.cpp | 2 ++ 5 files changed, 19 insertions(+) diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index c1f5963542..fbf1ef17a9 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -19,6 +19,7 @@ #include "depot_base.h" #include "spritecache.h" #include "strings_func.h" +#include "sound_func.h" #include "vehicle_func.h" #include "company_func.h" #include "tilehighlight_func.h" @@ -815,6 +816,8 @@ struct DepotWindow : Window { } else { ResetObjectToPlace(); } + + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_D_LOCATION: diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 94caa25914..67ae01a3fd 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -654,6 +654,7 @@ struct GenerateLandscapeWindow : public Window { case WID_GL_TROPICAL: case WID_GL_TOYLAND: SetNewLandscapeType(LandscapeType(widget - WID_GL_TEMPERATE)); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_GL_MAPSIZE_X_PULLDOWN: // Mapsize X @@ -718,6 +719,7 @@ struct GenerateLandscapeWindow : public Window { case WID_GL_HEIGHTMAP_HEIGHT_TEXT: // Height level text this->widget_id = WID_GL_HEIGHTMAP_HEIGHT_TEXT; ShowQueryString(GetString(STR_JUST_INT, _settings_newgame.game_creation.heightmap_height), STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT, 4, this, CS_NUMERAL, QueryStringFlag::EnableDefault); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; @@ -753,6 +755,7 @@ struct GenerateLandscapeWindow : public Window { case WID_GL_SNOW_COVERAGE_TEXT: // Snow coverage text this->widget_id = WID_GL_SNOW_COVERAGE_TEXT; ShowQueryString(GetString(STR_JUST_INT, _settings_newgame.game_creation.snow_coverage), STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT, 4, this, CS_NUMERAL, QueryStringFlag::EnableDefault); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_GL_DESERT_COVERAGE_DOWN: @@ -770,6 +773,7 @@ struct GenerateLandscapeWindow : public Window { case WID_GL_DESERT_COVERAGE_TEXT: // Desert line text this->widget_id = WID_GL_DESERT_COVERAGE_TEXT; ShowQueryString(GetString(STR_JUST_INT, _settings_newgame.game_creation.desert_coverage), STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT, 4, this, CS_NUMERAL, QueryStringFlag::EnableDefault); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_GL_HEIGHTMAP_ROTATION_PULLDOWN: // Heightmap rotation @@ -806,26 +810,31 @@ struct GenerateLandscapeWindow : public Window { /* Freetype map borders */ case WID_GL_WATER_NW: _settings_newgame.game_creation.water_borders.Flip(BorderFlag::NorthWest); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->InvalidateData(); break; case WID_GL_WATER_NE: _settings_newgame.game_creation.water_borders.Flip(BorderFlag::NorthEast); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->InvalidateData(); break; case WID_GL_WATER_SE: _settings_newgame.game_creation.water_borders.Flip(BorderFlag::SouthEast); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->InvalidateData(); break; case WID_GL_WATER_SW: _settings_newgame.game_creation.water_borders.Flip(BorderFlag::SouthWest); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->InvalidateData(); break; case WID_GL_BORDERS_RANDOM: _settings_newgame.game_creation.water_borders = (_settings_newgame.game_creation.water_borders == BorderFlag::Random) ? BorderFlag{} : BorderFlag::Random; + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->InvalidateData(); break; diff --git a/src/picker_gui.cpp b/src/picker_gui.cpp index ca6f5b2d02..2fe9471404 100644 --- a/src/picker_gui.cpp +++ b/src/picker_gui.cpp @@ -398,6 +398,8 @@ void PickerWindow::OnClick(Point pt, WidgetID widget, int) SetBit(this->callbacks.mode, PFM_ALL); } this->InvalidateData({PickerInvalidation::Class, PickerInvalidation::Type, PickerInvalidation::Position}); + + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_PW_SHRINK: diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 291039204a..4005d12f7f 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1580,10 +1580,13 @@ public: if (w != nullptr) ToggleRailButton_Remove(w); } + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); + break; case WID_BS_CONVERT: _convert_signal_button = !_convert_signal_button; + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_BS_DRAG_SIGNALS_DENSITY_DECREASE: diff --git a/src/town_gui.cpp b/src/town_gui.cpp index ccf6d51472..b68c22e37f 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -286,6 +286,8 @@ public: new_show_state ? _town_local_authority_kdtree.Insert(index) : _town_local_authority_kdtree.Remove(index); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); + this->town->show_zone = new_show_state; this->SetWidgetLoweredState(widget, new_show_state); MarkWholeScreenDirty();