Allow setting autosave interval to a custom number of real-time minutes

This commit is contained in:
Jonathan G Rennison
2021-12-14 18:48:57 +00:00
parent 583663bca1
commit 7953a1f8d1
6 changed files with 48 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ static_assert(_locale_currencies.size() == CURRENCY_END);
static constexpr std::initializer_list<const char*> _locale_units{"imperial", "metric", "si", "gameunits"};
static constexpr std::initializer_list<const char*> _town_names{"english", "french", "german", "american", "latin", "silly", "swedish", "dutch", "finnish", "polish", "slovak", "norwegian", "hungarian", "austrian", "romanian", "czech", "swiss", "danish", "turkish", "italian", "catalan"};
static constexpr std::initializer_list<const char*> _climates{"temperate", "arctic", "tropic", "toyland"};
static constexpr std::initializer_list<const char*> _autosave_interval{"off", "monthly", "quarterly", "half year", "yearly", "custom_days"};
static constexpr std::initializer_list<const char*> _autosave_interval{"off", "monthly", "quarterly", "half year", "yearly", "custom_days", "custom_realtime_minutes"};
static constexpr std::initializer_list<const char*> _roadsides{"left", "right"};
static constexpr std::initializer_list<const char*> _savegame_date{"long", "short", "iso"};
static constexpr std::initializer_list<const char*> _savegame_overwrite_confirm{"no", "different", "not same", "yes"};

View File

@@ -4085,7 +4085,7 @@ var = gui.autosave
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = 1
max = 5
max = 6
full = _autosave_interval
str = STR_CONFIG_SETTING_AUTOSAVE
strhelp = STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT
@@ -4106,6 +4106,19 @@ strhelp = STR_CONFIG_SETTING_AUTOSAVE_CUSTOM_DAYS_HELPTEXT
strval = STR_TIMETABLE_DAYS
cat = SC_BASIC
[SDTC_VAR]
var = gui.autosave_custom_minutes
type = SLE_UINT16
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
def = 30
min = 3
max = 8000
interval = 10
str = STR_CONFIG_SETTING_AUTOSAVE_CUSTOM_MINUTES
strhelp = STR_CONFIG_SETTING_AUTOSAVE_CUSTOM_MINUTES_HELPTEXT
strval = STR_TIMETABLE_MINUTES
cat = SC_BASIC
[SDTC_BOOL]
var = gui.threaded_saves
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC