1
0
Fork 0

Fix: Missing beeps for various buttons

pull/14470/head
Tyler Trahan 2025-07-20 22:00:08 -04:00
parent 621d7cc44d
commit ef4514862b
5 changed files with 19 additions and 0 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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:

View File

@ -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();