Changeset - r25975:101b063336cf
[Not reviewed]
master
0 8 0
Patric Stout - 3 years ago 2021-09-19 20:44:28
truebrain@openttd.org
Fix #9484: update locale currencies settings mapping (#9559)
8 files changed with 16 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/table/settings/game_settings.ini
Show inline comments
 
; This file is part of OpenTTD.
 
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
;
 

	
 
; Game settings as stored in the main configuration file ("openttd.cfg")
 
; and in the savegame PATS chunk.
 
; Game settings are everything related to vehicles, stations, orders, etc.
 

	
 
[pre-amble]
 
static std::initializer_list<const char*> _roadsides{"left", "right"};
 
static constexpr std::initializer_list<const char*> _roadsides{"left", "right"};
 

	
 
static void StationSpreadChanged(int32 new_value);
 
static void UpdateConsists(int32 new_value);
 
static void TrainAccelerationModelChanged(int32 new_value);
 
static void RoadVehAccelerationModelChanged(int32 new_value);
 
static void TrainSlopeSteepnessChanged(int32 new_value);
 
static void RoadVehSlopeSteepnessChanged(int32 new_value);
 
static bool CheckRoadSide(int32 &new_value);
 
static bool CheckDynamicEngines(int32 &new_value);
 
static void StationCatchmentChanged(int32 new_value);
 
static void MaxVehiclesChanged(int32 new_value);
 

	
src/table/settings/gui_settings.ini
Show inline comments
 
@@ -6,27 +6,27 @@
 

	
 
; GUI settings as stored in the main configuration file ("openttd.cfg").
 

	
 
[pre-amble]
 
static void v_PositionMainToolbar(int32 new_value);
 
static void v_PositionStatusbar(int32 new_value);
 
static void RedrawSmallmap(int32 new_value);
 
static void InvalidateCompanyLiveryWindow(int32 new_value);
 
static void InvalidateNewGRFChangeWindows(int32 new_value);
 
static void ZoomMinMaxChanged(int32 new_value);
 
static void SpriteZoomMinChanged(int32 new_value);
 

	
 
static std::initializer_list<const char*> _autosave_interval{"off", "monthly", "quarterly", "half year", "yearly"};
 
static std::initializer_list<const char*> _osk_activation{"disabled", "double", "single", "immediately"};
 
static std::initializer_list<const char*> _savegame_date{"long", "short", "iso"};
 
static constexpr std::initializer_list<const char*> _autosave_interval{"off", "monthly", "quarterly", "half year", "yearly"};
 
static constexpr std::initializer_list<const char*> _osk_activation{"disabled", "double", "single", "immediately"};
 
static constexpr std::initializer_list<const char*> _savegame_date{"long", "short", "iso"};
 

	
 
static const SettingVariant _gui_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
 
SDTC_BOOL  =  SDTC_BOOL(              $var,        $flags, $def,                              $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 
SDTC_OMANY = SDTC_OMANY(              $var, $type, $flags, $def,             $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 
SDTC_VAR   =   SDTC_VAR(              $var, $type, $flags, $def,       $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
 
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
 
SDTC_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
src/table/settings/locale_settings.ini
Show inline comments
 
; This file is part of OpenTTD.
 
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
;
 

	
 
; Locale settings as stored in the main configuration file ("openttd.cfg") and
 
; in the savegame PATS chunk. These settings are not sync'd over the network.
 

	
 
[pre-amble]
 
uint8 _old_units;                                      ///< Old units from old savegames
 

	
 
static std::initializer_list<const char*> _locale_currencies{"GBP", "USD", "EUR", "YEN", "ATS", "BEF", "CHF", "CZK", "DEM", "DKK", "ESP", "FIM", "FRF", "GRD", "HUF", "ISK", "ITL", "NLG", "NOK", "PLN", "RON", "RUR", "SIT", "SEK", "YTL", "SKK", "BRL", "EEK", "custom"};
 
static std::initializer_list<const char*> _locale_units{"imperial", "metric", "si", "gameunits"};
 
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 constexpr std::initializer_list<const char*> _locale_units{"imperial", "metric", "si", "gameunits"};
 

	
 
static_assert(_locale_currencies.size() == CURRENCY_END);
 

	
 
static const SettingVariant _locale_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
 
SDTG_OMANY = SDTG_OMANY($name,              $type, $flags, $var, $def,       $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 
SDT_OMANY  =  SDT_OMANY(GameSettings, $var, $type, $flags, $def,             $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $load, $cat, $extra, $startup),
 
SDT_SSTR   =   SDT_SSTR(GameSettings, $var, $type, $flags, $def,                                                       $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
 
SDTG_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
 
SDT_OMANY = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
src/table/settings/misc_settings.ini
Show inline comments
 
; This file is part of OpenTTD.
 
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
;
 

	
 
; Various of settings that are stored in global variables. They are all
 
; located under "misc" in the configuration files.
 

	
 
[pre-amble]
 
extern std::string _config_language_file;
 

	
 
static std::initializer_list<const char*> _support8bppmodes{"no", "system" , "hardware"};
 
static std::initializer_list<const char*> _display_opt_modes{"SHOW_TOWN_NAMES", "SHOW_STATION_NAMES", "SHOW_SIGNS", "FULL_ANIMATION", "", "FULL_DETAIL", "WAYPOINTS", "SHOW_COMPETITOR_SIGNS"};
 
static constexpr std::initializer_list<const char*> _support8bppmodes{"no", "system", "hardware"};
 
static constexpr std::initializer_list<const char*> _display_opt_modes{"SHOW_TOWN_NAMES", "SHOW_STATION_NAMES", "SHOW_SIGNS", "FULL_ANIMATION", "", "FULL_DETAIL", "WAYPOINTS", "SHOW_COMPETITOR_SIGNS"};
 

	
 
#ifdef WITH_COCOA
 
extern bool _allow_hidpi_window;
 
#endif
 
#ifndef WITH_COCOA
 
#define WITHOUT_COCOA
 
#endif
 

	
 
static const SettingVariant _misc_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
src/table/settings/network_settings.ini
Show inline comments
 
; This file is part of OpenTTD.
 
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
;
 

	
 
; Network settings as stored in the main configuration file ("openttd.cfg").
 

	
 
[pre-amble]
 
static void UpdateClientConfigValues();
 

	
 
static std::initializer_list<const char*> _server_game_type{"local", "public", "invite-only"};
 
static std::initializer_list<const char*> _use_relay_service{"never", "ask", "allow"};
 
static constexpr std::initializer_list<const char*> _server_game_type{"local", "public", "invite-only"};
 
static constexpr std::initializer_list<const char*> _use_relay_service{"never", "ask", "allow"};
 

	
 
static const SettingVariant _network_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
 
SDTC_BOOL  =  SDTC_BOOL(              $var,        $flags, $def,                              $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 
SDTC_OMANY = SDTC_OMANY(              $var, $type, $flags, $def,             $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 
SDTC_VAR   =   SDTC_VAR(              $var, $type, $flags, $def,       $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
 
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
 
SDTC_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
src/table/settings/news_display_settings.ini
Show inline comments
 
; This file is part of OpenTTD.
 
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
;
 

	
 
; News display settings as stored in the main configuration file ("openttd.cfg").
 

	
 
[pre-amble]
 
static std::initializer_list<const char*> _news_display{ "off", "summarized", "full"};
 
static constexpr std::initializer_list<const char*> _news_display{ "off", "summarized", "full"};
 

	
 
static const SettingVariant _news_display_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
 
SDTC_OMANY = SDTC_OMANY(              $var, $type, $flags, $def,             $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
 
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
 

	
 
[defaults]
 
flags    = SF_NONE
src/table/settings/old_gameopt_settings.ini
Show inline comments
 
@@ -5,26 +5,26 @@
 
;
 

	
 
; Settings that used to be saved in the savegame under the OPTS chunk and
 
; under "gameopts" in the configuration file, but no longer are. Most of these
 
; are now moved to other places.
 
;
 
; For backwards compatability, this file dictates how both were saved. When
 
; a configuration files contains these entries, they are read once, and removed
 
; from the configuration file afterwards. Those that are still supported will
 
; be saved in their new place.
 

	
 
[pre-amble]
 
static 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 std::initializer_list<const char*> _climates{"temperate", "arctic", "tropic", "toyland"};
 
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 const SettingVariant _old_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
 
 * same-sized members
 
 * 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 SlCopy() hack
 
 * for savegames version 0 - though it is an array, it has to go through the byteswap process */
 
[post-amble]
src/table/settings/script_settings.ini
Show inline comments
 
; This file is part of OpenTTD.
 
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
;
 

	
 
; Script settings as stored in the main configuration file ("openttd.cfg")
 
; and in the savegame PATS chunk.
 

	
 
[pre-amble]
 
static std::initializer_list<const char*> _settings_profiles{"easy", "medium", "hard"};
 
static constexpr std::initializer_list<const char*> _settings_profiles{"easy", "medium", "hard"};
 

	
 
static const SettingVariant _script_settings_table[] = {
 
[post-amble]
 
};
 
[templates]
 
SDT_BOOL   =   SDT_BOOL(GameSettings, $var,        $flags, $def,                              $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 
SDT_OMANY  =  SDT_OMANY(GameSettings, $var, $type, $flags, $def,             $max, $full,     $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $load, $cat, $extra, $startup),
 
SDT_VAR    =    SDT_VAR(GameSettings, $var, $type, $flags, $def,       $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
 

	
 
[validation]
 
SDT_OMANY = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
 
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
0 comments (0 inline, 0 general)