diff options
author | rubidium42 <rubidium@openttd.org> | 2021-07-05 17:46:38 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-07-06 21:32:47 +0200 |
commit | 25ca6a75bc83df7224f56fc1ab22c4491f77649e (patch) | |
tree | 1c99d6657789d9adecd7a3f1df7e41f7f8b8d633 /src/table/settings | |
parent | b4aedc8bee97218febda75889ff2ef50f70a2439 (diff) | |
download | openttd-25ca6a75bc83df7224f56fc1ab22c4491f77649e.tar.xz |
Codechange: split off the settings table and all the callbacks from the main settings handling logic
Diffstat (limited to 'src/table/settings')
-rw-r--r-- | src/table/settings/company_settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/currency_settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/gameopt_settings.ini | 7 | ||||
-rw-r--r-- | src/table/settings/misc_settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/network_private_settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/network_secrets_settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/network_settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/win32_settings.ini | 2 | ||||
-rw-r--r-- | src/table/settings/window_settings.ini | 2 |
10 files changed, 12 insertions, 13 deletions
diff --git a/src/table/settings/company_settings.ini b/src/table/settings/company_settings.ini index e5019305f..52920e6e6 100644 --- a/src/table/settings/company_settings.ini +++ b/src/table/settings/company_settings.ini @@ -12,7 +12,7 @@ static void UpdateAllServiceInterval(int32 new_value); static bool CanUpdateServiceInterval(VehicleType type, int32 &new_value); static void UpdateServiceInterval(VehicleType type, int32 new_value); -static const SettingVariant _company_settings[] = { +static const SettingVariant _company_settings_table[] = { [post-amble] }; [templates] diff --git a/src/table/settings/currency_settings.ini b/src/table/settings/currency_settings.ini index d0950db8e..03c6425b2 100644 --- a/src/table/settings/currency_settings.ini +++ b/src/table/settings/currency_settings.ini @@ -7,7 +7,7 @@ ; Settings for the in-game custom currency. [pre-amble] -static const SettingVariant _currency_settings[] = { +static const SettingVariant _currency_settings_table[] = { [post-amble] }; [templates] diff --git a/src/table/settings/gameopt_settings.ini b/src/table/settings/gameopt_settings.ini index a30400e85..83e7c6395 100644 --- a/src/table/settings/gameopt_settings.ini +++ b/src/table/settings/gameopt_settings.ini @@ -14,9 +14,8 @@ ; 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]; +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"}; +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 @@ -33,7 +32,7 @@ static std::initializer_list<const char*> _osk_activation{"disabled", "double", static std::initializer_list<const char*> _settings_profiles{"easy", "medium", "hard"}; static std::initializer_list<const char*> _news_display{ "off", "summarized", "full"}; -static const SettingVariant _gameopt_settings[] = { +static const SettingVariant _gameopt_settings_table[] = { /* In version 4 a new difficulty setting has been added to the difficulty settings, * town attitude towards demolishing. Needs special handling because some dimwit thought * it funny to have the GameDifficulty struct be an array while it is a struct of diff --git a/src/table/settings/misc_settings.ini b/src/table/settings/misc_settings.ini index 9f73573b2..daca4a817 100644 --- a/src/table/settings/misc_settings.ini +++ b/src/table/settings/misc_settings.ini @@ -20,7 +20,7 @@ extern bool _allow_hidpi_window; #define WITHOUT_COCOA #endif -static const SettingVariant _misc_settings[] = { +static const SettingVariant _misc_settings_table[] = { [post-amble] }; [templates] diff --git a/src/table/settings/network_private_settings.ini b/src/table/settings/network_private_settings.ini index 76fbd373a..cae43330f 100644 --- a/src/table/settings/network_private_settings.ini +++ b/src/table/settings/network_private_settings.ini @@ -7,7 +7,7 @@ ; Network settings as stored in the private configuration file ("private.cfg"). [pre-amble] -static const SettingVariant _network_private_settings[] = { +static const SettingVariant _network_private_settings_table[] = { [post-amble] }; [templates] diff --git a/src/table/settings/network_secrets_settings.ini b/src/table/settings/network_secrets_settings.ini index a408bad40..fced9240e 100644 --- a/src/table/settings/network_secrets_settings.ini +++ b/src/table/settings/network_secrets_settings.ini @@ -9,7 +9,7 @@ [pre-amble] static bool ReplaceAsteriskWithEmptyPassword(std::string &newval); -static const SettingVariant _network_secrets_settings[] = { +static const SettingVariant _network_secrets_settings_table[] = { [post-amble] }; [templates] diff --git a/src/table/settings/network_settings.ini b/src/table/settings/network_settings.ini index 1317edbc7..45459b6e1 100644 --- a/src/table/settings/network_settings.ini +++ b/src/table/settings/network_settings.ini @@ -9,7 +9,7 @@ [pre-amble] static void UpdateClientConfigValues(); -static const SettingVariant _network_settings[] = { +static const SettingVariant _network_settings_table[] = { [post-amble] }; [templates] diff --git a/src/table/settings/settings.ini b/src/table/settings/settings.ini index fae6e5636..984668e51 100644 --- a/src/table/settings/settings.ini +++ b/src/table/settings/settings.ini @@ -46,7 +46,7 @@ static void InvalidateShipPathCache(int32 new_value); * assigns its own value. If the setting was company-based, that would mean that * vehicles could decide on different moments that they are heading back to a * service depot, causing desyncs on a massive scale. */ -static const SettingVariant _settings[] = { +static const SettingVariant _settings_table[] = { [post-amble] }; [templates] diff --git a/src/table/settings/win32_settings.ini b/src/table/settings/win32_settings.ini index 51b579629..4256528dd 100644 --- a/src/table/settings/win32_settings.ini +++ b/src/table/settings/win32_settings.ini @@ -12,7 +12,7 @@ #if defined(_WIN32) && !defined(DEDICATED) extern bool _window_maximize; -static const SettingVariant _win32_settings[] = { +static const SettingVariant _win32_settings_table[] = { [post-amble] }; #endif /* _WIN32 */ diff --git a/src/table/settings/window_settings.ini b/src/table/settings/window_settings.ini index d9327aa92..aba8d3dba 100644 --- a/src/table/settings/window_settings.ini +++ b/src/table/settings/window_settings.ini @@ -9,7 +9,7 @@ [pre-amble] -static const SettingVariant _window_settings[] = { +static const SettingVariant _window_settings_table[] = { [post-amble] }; [templates] |