mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-13 07:10:57 +00:00
Hide unused climate threshold settings depending on climate threshold mode
This commit is contained in:
parent
40203b090f
commit
34e9c22c3d
@ -1495,6 +1495,7 @@ static bool InvalidateAllVehicleImageCaches(int32 p1)
|
||||
static bool ClimateThresholdModeChanged(int32 p1)
|
||||
{
|
||||
InvalidateWindowClassesData(WC_GENERATE_LANDSCAPE);
|
||||
InvalidateWindowClassesData(WC_GAME_OPTIONS);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1922,10 +1922,13 @@ static SettingsContainer &GetSettingsTree()
|
||||
genworld->Add(new SettingEntry("game_creation.tgen_smoothness"));
|
||||
genworld->Add(new SettingEntry("game_creation.variety"));
|
||||
genworld->Add(new SettingEntry("game_creation.climate_threshold_mode"));
|
||||
genworld->Add(new SettingEntry("game_creation.snow_coverage"));
|
||||
genworld->Add(new SettingEntry("game_creation.snow_line_height"));
|
||||
genworld->Add(new SettingEntry("game_creation.desert_coverage"));
|
||||
genworld->Add(new SettingEntry("game_creation.rainforest_line_height"));
|
||||
auto coverage_hide = []() -> bool { return GetGameSettings().game_creation.climate_threshold_mode != 0; };
|
||||
auto snow_line_height_hide = []() -> bool { return GetGameSettings().game_creation.climate_threshold_mode != 1 && _game_mode == GM_MENU; };
|
||||
auto rainforest_line_height_hide = []() -> bool { return GetGameSettings().game_creation.climate_threshold_mode != 1; };
|
||||
genworld->Add(new ConditionallyHiddenSettingEntry("game_creation.snow_coverage", coverage_hide));
|
||||
genworld->Add(new ConditionallyHiddenSettingEntry("game_creation.snow_line_height", snow_line_height_hide));
|
||||
genworld->Add(new ConditionallyHiddenSettingEntry("game_creation.desert_coverage", coverage_hide));
|
||||
genworld->Add(new ConditionallyHiddenSettingEntry("game_creation.rainforest_line_height", rainforest_line_height_hide));
|
||||
genworld->Add(new SettingEntry("game_creation.amount_of_rivers"));
|
||||
SettingsPage *rivers = genworld->Add(new SettingsPage(STR_CONFIG_SETTING_GENWORLD_RIVERS_LAKES));
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user