Codechange: allow certain enumeration to be added

Otherwise C++20 doesn't like it.
This commit is contained in:
Rubidium
2024-01-16 22:01:28 +01:00
committed by rubidium42
parent 7737aa6640
commit aa5ba5bd7f
21 changed files with 83 additions and 63 deletions

View File

@@ -998,12 +998,12 @@ public:
this->FinishInitNested(TRANSPORT_RAIL);
this->LowerWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X);
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _railstation.orientation);
if (_settings_client.gui.station_dragdrop) {
this->LowerWidget(WID_BRAS_PLATFORM_DRAG_N_DROP);
} else {
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
this->LowerWidget(WID_BRAS_PLATFORM_NUM_BEGIN + _settings_client.gui.station_numtracks);
this->LowerWidget(WID_BRAS_PLATFORM_LEN_BEGIN + _settings_client.gui.station_platlength);
}
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_OFF, !_settings_client.gui.station_show_coverage);
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_ON, _settings_client.gui.station_show_coverage);
@@ -1328,9 +1328,9 @@ public:
switch (widget) {
case WID_BRAS_PLATFORM_DIR_X:
case WID_BRAS_PLATFORM_DIR_Y:
this->RaiseWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X);
this->RaiseWidget(WID_BRAS_PLATFORM_DIR_X + _railstation.orientation);
_railstation.orientation = (Axis)(widget - WID_BRAS_PLATFORM_DIR_X);
this->LowerWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X);
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _railstation.orientation);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
this->SetDirty();
CloseWindowById(WC_SELECT_STATION, 0);
@@ -1343,7 +1343,7 @@ public:
case WID_BRAS_PLATFORM_NUM_5:
case WID_BRAS_PLATFORM_NUM_6:
case WID_BRAS_PLATFORM_NUM_7: {
this->RaiseWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
this->RaiseWidget(WID_BRAS_PLATFORM_NUM_BEGIN + _settings_client.gui.station_numtracks);
this->RaiseWidget(WID_BRAS_PLATFORM_DRAG_N_DROP);
_settings_client.gui.station_numtracks = widget - WID_BRAS_PLATFORM_NUM_BEGIN;
@@ -1894,7 +1894,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
BuildRailDepotWindow(WindowDesc *desc, Window *parent) : PickerWindowBase(desc, parent)
{
this->InitNested(TRANSPORT_RAIL);
this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
}
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
@@ -1926,9 +1926,9 @@ struct BuildRailDepotWindow : public PickerWindowBase {
case WID_BRAD_DEPOT_SE:
case WID_BRAD_DEPOT_SW:
case WID_BRAD_DEPOT_NW:
this->RaiseWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
this->RaiseWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
_build_depot_direction = (DiagDirection)(widget - WID_BRAD_DEPOT_NE);
this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
this->SetDirty();
break;