mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-30 15:44:31 +01:00
Codechange: Make functions for click and confirm beeps. (#14484)
Avoids repetition.
This commit is contained in:
@@ -1717,7 +1717,7 @@ public:
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
|
||||
Point zoom_pt = { (int)wid->current_x / 2, (int)wid->current_y / 2};
|
||||
this->SetZoomLevel((widget == WID_SM_ZOOM_IN) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &zoom_pt);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1729,13 +1729,13 @@ public:
|
||||
case WID_SM_VEGETATION: // Show vegetation
|
||||
case WID_SM_OWNERS: // Show land owners
|
||||
this->SwitchMapType((SmallMapType)(widget - WID_SM_CONTOUR));
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
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);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_SM_TOGGLETOWNNAME: // Toggle town names
|
||||
@@ -1743,7 +1743,7 @@ public:
|
||||
this->SetWidgetLoweredState(WID_SM_TOGGLETOWNNAME, this->show_towns);
|
||||
|
||||
this->SetDirty();
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_SM_SHOW_IND_NAMES: // Toggle industry names
|
||||
@@ -1751,7 +1751,7 @@ public:
|
||||
this->SetWidgetLoweredState(WID_SM_SHOW_IND_NAMES, this->show_ind_names);
|
||||
|
||||
this->SetDirty();
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_SM_LEGEND: // Legend
|
||||
|
||||
Reference in New Issue
Block a user