Split save/load settings into separate INI files

Matching upstream for all settings
This commit is contained in:
Jonathan G Rennison
2023-11-18 19:26:08 +00:00
parent ccfdf626ad
commit 6e671ed6e2
23 changed files with 4406 additions and 4089 deletions

View File

@@ -14,21 +14,10 @@
; be saved in their new place.
[pre-amble]
static const uint GAME_DIFFICULTY_NUM = 18;
static const std::array<std::string, GAME_DIFFICULTY_NUM> _old_diff_settings{"max_no_competitors", "competitor_start_time", "number_towns", "industry_density", "max_loan", "initial_interest", "vehicle_costs", "competitor_speed", "competitor_intelligence", "vehicle_breakdowns", "subsidy_multiplier", "construction_cost", "terrain_type", "quantity_sea_lakes", "economy", "line_reverse_mode", "disasters", "town_council_tolerance"};
static uint16 _old_diff_custom[GAME_DIFFICULTY_NUM];
uint8 _old_diff_level; ///< Old difficulty level from old savegames
uint8 _old_units; ///< Old units from old savegames
/* Most of these strings are used both for gameopt-backward compatibility
* and the settings tables. The rest is here for consistency. */
static constexpr std::initializer_list<const char*> _locale_currencies{"GBP", "USD", "EUR", "JPY", "ATS", "BEF", "CHF", "CZK", "DEM", "DKK", "ESP", "FIM", "FRF", "GRD", "HUF", "ISK", "ITL", "NLG", "NOK", "PLN", "RON", "RUR", "SIT", "SEK", "TRY", "SKK", "BRL", "EEK", "LTL", "KRW", "ZAR", "custom", "GEL", "IRR", "RUB", "MXN", "NTD", "CNY", "HKD", "INR", "IDR", "MYR"};
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*> _roadsides{"left", "right"};
static constexpr std::initializer_list<const char*> _settings_profiles{"easy", "medium", "hard"};
static const SettingTable _old_gameopt_settings{
/* In version 4 a new difficulty setting has been added to the difficulty settings,
@@ -38,7 +27,7 @@ static const SettingTable _old_gameopt_settings{
* XXX - To save file-space and since values are never bigger than about 10? only
* save the first 16 bits in the savegame. Question is why the values are still int32
* and why not byte for example?
* 'SLE_FILE_I16 | SLE_VAR_U16' in "diff_custom" is needed to get around SlArray() hack
* 'SLE_FILE_I16 | SLE_VAR_U16' in "diff_custom" is needed to get around SlCopy() hack
* for savegames version 0 - though it is an array, it has to go through the byteswap process */
[post-amble]
};