1
0
Fork 0

Codechange: Handle "beep" sound within Window::HandleButtonClick()

Tyler Trahan 2025-07-20 20:50:20 -04:00
parent b82ffa3542
commit ce6bc21641
4 changed files with 2 additions and 9 deletions

View File

@ -1735,7 +1735,6 @@ public:
case WID_SM_CENTERMAP: // Center the smallmap again case WID_SM_CENTERMAP: // Center the smallmap again
this->SmallMapCenterOnCurrentPos(); this->SmallMapCenterOnCurrentPos();
this->HandleButtonClick(WID_SM_CENTERMAP); this->HandleButtonClick(WID_SM_CENTERMAP);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
break; break;
case WID_SM_TOGGLETOWNNAME: // Toggle town names case WID_SM_TOGGLETOWNNAME: // Toggle town names

View File

@ -621,7 +621,6 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
if (!IsInsideMM(size, 1, 8 + 1)) return; if (!IsInsideMM(size, 1, 8 + 1)) return;
_terraform_size = size; _terraform_size = size;
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
this->SetDirty(); this->SetDirty();
break; break;
} }

View File

@ -857,7 +857,6 @@ static CallBackFunction ToolbarZoomInClick(Window *w)
{ {
if (DoZoomInOutWindow(ZOOM_IN, GetMainWindow())) { if (DoZoomInOutWindow(ZOOM_IN, GetMainWindow())) {
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_IN : (WidgetID)WID_TN_ZOOM_IN); w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_IN : (WidgetID)WID_TN_ZOOM_IN);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
} }
return CBF_NONE; return CBF_NONE;
} }
@ -868,7 +867,6 @@ static CallBackFunction ToolbarZoomOutClick(Window *w)
{ {
if (DoZoomInOutWindow(ZOOM_OUT, GetMainWindow())) { if (DoZoomInOutWindow(ZOOM_OUT, GetMainWindow())) {
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_OUT : (WidgetID)WID_TN_ZOOM_OUT); w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_OUT : (WidgetID)WID_TN_ZOOM_OUT);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
} }
return CBF_NONE; return CBF_NONE;
} }
@ -1232,7 +1230,6 @@ static CallBackFunction ToolbarScenDateForward(Window *w)
static CallBackFunction ToolbarScenGenLand(Window *w) static CallBackFunction ToolbarScenGenLand(Window *w)
{ {
w->HandleButtonClick(WID_TE_LAND_GENERATE); w->HandleButtonClick(WID_TE_LAND_GENERATE);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
ShowEditorTerraformToolbar(); ShowEditorTerraformToolbar();
return CBF_NONE; return CBF_NONE;
@ -1256,7 +1253,6 @@ static CallBackFunction ToolbarScenGenTown(int index)
static CallBackFunction ToolbarScenGenIndustry(Window *w) static CallBackFunction ToolbarScenGenIndustry(Window *w)
{ {
w->HandleButtonClick(WID_TE_INDUSTRY); w->HandleButtonClick(WID_TE_INDUSTRY);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
ShowBuildIndustryWindow(); ShowBuildIndustryWindow();
return CBF_NONE; return CBF_NONE;
} }
@ -1304,7 +1300,6 @@ static CallBackFunction ToolbarScenBuildTram(int index)
static CallBackFunction ToolbarScenBuildDocks(Window *w) static CallBackFunction ToolbarScenBuildDocks(Window *w)
{ {
w->HandleButtonClick(WID_TE_WATER); w->HandleButtonClick(WID_TE_WATER);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
ShowBuildDocksScenToolbar(); ShowBuildDocksScenToolbar();
return CBF_NONE; return CBF_NONE;
} }
@ -1312,7 +1307,6 @@ static CallBackFunction ToolbarScenBuildDocks(Window *w)
static CallBackFunction ToolbarScenPlantTrees(Window *w) static CallBackFunction ToolbarScenPlantTrees(Window *w)
{ {
w->HandleButtonClick(WID_TE_TREES); w->HandleButtonClick(WID_TE_TREES);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
ShowBuildTreesToolbar(); ShowBuildTreesToolbar();
return CBF_NONE; return CBF_NONE;
} }
@ -1320,7 +1314,6 @@ static CallBackFunction ToolbarScenPlantTrees(Window *w)
static CallBackFunction ToolbarScenPlaceSign(Window *w) static CallBackFunction ToolbarScenPlaceSign(Window *w)
{ {
w->HandleButtonClick(WID_TE_SIGNS); w->HandleButtonClick(WID_TE_SIGNS);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
return SelectSignTool(); return SelectSignTool();
} }

View File

@ -36,6 +36,7 @@
#include "framerate_type.h" #include "framerate_type.h"
#include "network/network_func.h" #include "network/network_func.h"
#include "news_func.h" #include "news_func.h"
#include "sound_func.h"
#include "timer/timer.h" #include "timer/timer.h"
#include "timer/timer_window.h" #include "timer/timer_window.h"
@ -596,6 +597,7 @@ void Window::HandleButtonClick(WidgetID widget)
this->LowerWidget(widget); this->LowerWidget(widget);
this->SetTimeout(); this->SetTimeout();
this->SetWidgetDirty(widget); this->SetWidgetDirty(widget);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
} }
static void StartWindowDrag(Window *w); static void StartWindowDrag(Window *w);