Codechange: Make functions for click and confirm beeps. (#14484)
Avoids repetition.
This commit is contained in:
@@ -357,7 +357,7 @@ static void BuildRailClick_Remove(Window *w)
|
||||
{
|
||||
if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return;
|
||||
ToggleRailButton_Remove(w);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
|
||||
/* handle station builder */
|
||||
if (w->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
|
||||
@@ -1239,7 +1239,7 @@ public:
|
||||
this->RaiseWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
||||
_station_gui.axis = (Axis)(widget - WID_BRAS_PLATFORM_DIR_X);
|
||||
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
@@ -1271,7 +1271,7 @@ public:
|
||||
|
||||
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
||||
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
@@ -1304,7 +1304,7 @@ public:
|
||||
|
||||
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
||||
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
@@ -1338,7 +1338,7 @@ public:
|
||||
|
||||
this->SetWidgetLoweredState(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN, !_settings_client.gui.station_dragdrop);
|
||||
this->SetWidgetLoweredState(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN, !_settings_client.gui.station_dragdrop);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
@@ -1350,7 +1350,7 @@ public:
|
||||
|
||||
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_OFF, !_settings_client.gui.station_show_coverage);
|
||||
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_ON, _settings_client.gui.station_show_coverage);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
SetViewportCatchmentStation(nullptr, true);
|
||||
break;
|
||||
@@ -1743,7 +1743,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
||||
this->RaiseWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
||||
_build_depot_direction = (DiagDirection)(widget - WID_BRAD_DEPOT_NE);
|
||||
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user