mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-22 04:32:47 +01:00
Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. (#13436)
This commit is contained in:
@@ -267,10 +267,10 @@ struct SelectGameWindow : public Window {
|
||||
void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
this->SetWidgetLoweredState(WID_SGI_TEMPERATE_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TEMPERATE);
|
||||
this->SetWidgetLoweredState(WID_SGI_ARCTIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_ARCTIC);
|
||||
this->SetWidgetLoweredState(WID_SGI_TROPIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TROPIC);
|
||||
this->SetWidgetLoweredState(WID_SGI_TOYLAND_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TOYLAND);
|
||||
this->SetWidgetLoweredState(WID_SGI_TEMPERATE_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Temperate);
|
||||
this->SetWidgetLoweredState(WID_SGI_ARCTIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Arctic);
|
||||
this->SetWidgetLoweredState(WID_SGI_TROPIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Tropic);
|
||||
this->SetWidgetLoweredState(WID_SGI_TOYLAND_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Toyland);
|
||||
}
|
||||
|
||||
void OnInit() override
|
||||
@@ -355,7 +355,7 @@ struct SelectGameWindow : public Window {
|
||||
|
||||
case WID_SGI_TEMPERATE_LANDSCAPE: case WID_SGI_ARCTIC_LANDSCAPE:
|
||||
case WID_SGI_TROPIC_LANDSCAPE: case WID_SGI_TOYLAND_LANDSCAPE:
|
||||
SetNewLandscapeType(widget - WID_SGI_TEMPERATE_LANDSCAPE);
|
||||
SetNewLandscapeType(LandscapeType(widget - WID_SGI_TEMPERATE_LANDSCAPE));
|
||||
break;
|
||||
|
||||
case WID_SGI_OPTIONS: ShowGameOptions(); break;
|
||||
|
||||
Reference in New Issue
Block a user