1
0
Fork 0

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

pull/14470/head
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
this->SmallMapCenterOnCurrentPos();
this->HandleButtonClick(WID_SM_CENTERMAP);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
break;
case WID_SM_TOGGLETOWNNAME: // Toggle town names

View File

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

View File

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

View File

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