mirror of https://github.com/OpenTTD/OpenTTD
pull/13303/merge
parent
753905ae2d
commit
259830777c
|
@ -667,6 +667,15 @@ static void ChangeMinutesPerYear(int32_t new_value)
|
|||
}
|
||||
}
|
||||
|
||||
/* Get the valid range of the "minutes per calendar year" setting. */
|
||||
static std::tuple<int32_t, uint32_t> GetMinutesPerYearRange(const IntSettingDesc &)
|
||||
{
|
||||
/* Allow a non-default value only if using Wallclock timekeeping units. */
|
||||
if (_settings_newgame.economy.timekeeping_units == TKU_WALLCLOCK) return { CalendarTime::FROZEN_MINUTES_PER_YEAR, CalendarTime::MAX_MINUTES_PER_YEAR };
|
||||
|
||||
return { CalendarTime::DEF_MINUTES_PER_YEAR, CalendarTime::DEF_MINUTES_PER_YEAR };
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-callback check when trying to change the timetable mode. This is locked to Seconds when using wallclock units.
|
||||
* @param Unused.
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
static void TownFoundingChanged(int32_t new_value);
|
||||
static void ChangeTimekeepingUnits(int32_t new_value);
|
||||
static void ChangeMinutesPerYear(int32_t new_value);
|
||||
static std::tuple<int32_t, uint32_t> GetMinutesPerYearRange(const IntSettingDesc &sd);
|
||||
|
||||
static constexpr std::initializer_list<std::string_view> _place_houses{"forbidden"sv, "allowed"sv, "fully constructed"sv};
|
||||
|
||||
|
@ -332,6 +333,7 @@ strhelp = STR_CONFIG_SETTING_MINUTES_PER_YEAR_HELPTEXT
|
|||
strval = STR_CONFIG_SETTING_MINUTES_PER_YEAR_VALUE
|
||||
pre_cb = [](auto) { return _game_mode == GM_MENU || _settings_game.economy.timekeeping_units == 1; }
|
||||
post_cb = ChangeMinutesPerYear
|
||||
range_cb = GetMinutesPerYearRange
|
||||
cat = SC_BASIC
|
||||
|
||||
[SDT_VAR]
|
||||
|
|
Loading…
Reference in New Issue