Files
@ r28776:3c348ccd319d
Branch filter:
Location: cpp/openttd-patchpack/source/src/table/settings.h.preamble - annotation
r28776:3c348ccd319d
9.2 KiB
text/plain
Update: Number format configuration based on old digitsep and STR_CURRENCY_SHORT_* values
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17445:55ff6f782efc r17731:9e5a9a1dab5f r17413:8e9663035eb9 r28597:5b9c67fc9551 r28597:5b9c67fc9551 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r24238:457b975e47f6 r24238:457b975e47f6 r24238:457b975e47f6 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r20034:6a6104b5385b r20034:6a6104b5385b r17413:8e9663035eb9 r25526:33520e7899c5 r20034:6a6104b5385b r20034:6a6104b5385b r20034:6a6104b5385b r20034:6a6104b5385b r24237:6a70b05eeebb r20034:6a6104b5385b r20034:6a6104b5385b r23838:bfeaabaa7b1d r20034:6a6104b5385b r20034:6a6104b5385b r20034:6a6104b5385b r20034:6a6104b5385b r27737:728d55b97775 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r25754:d19207ab5c69 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r25731:35af609545cc r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r25601:747c128b2f85 r25791:c5c057e89e2a r17413:8e9663035eb9 r25601:747c128b2f85 r25791:c5c057e89e2a r24217:df2f5854f1e3 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r17413:8e9663035eb9 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r26919:4c5461cdf009 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r25601:747c128b2f85 r25791:c5c057e89e2a r17413:8e9663035eb9 r25601:747c128b2f85 r25791:c5c057e89e2a r25465:00b2c6cd44ad r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r28596:a255de59f788 r28596:a255de59f788 r17413:8e9663035eb9 r25601:747c128b2f85 r25601:747c128b2f85 r17413:8e9663035eb9 r25601:747c128b2f85 r25601:747c128b2f85 r25461:f4423b696b95 r28596:a255de59f788 r28596:a255de59f788 | /*
* 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/>.
*/
/** @file table/settings.h Settings to save in the savegame and config file. */
/* Callback function used in _settings[] as well as _company_settings[] */
static size_t ConvertLandscape(const char *value);
static StringID SettingTitleWallclock(const IntSettingDesc &sd);
static StringID SettingHelpWallclock(const IntSettingDesc &sd);
/****************************
* OTTD specific INI stuff
****************************
* DO NOT edit this file. This file is automatically generated from the contents of /src/table/
*/
/**
* Settings-macro usage:
* The list might look daunting at first, but is in general easy to understand.
* The macros can be grouped depending on where the config variable is
* stored:
* 1. SDTG_something
* These are for global variables. Here 'var' refers to a global variable.
* 2. SDTC_something
* These are for client-only variables. Here the 'var' refers to an
* entry inside _settings_client.
* 3. SDT_something
* These are for members in the struct described by the current
* #SettingDesc list / .ini file. Here, 'base' specifies type of the
* struct while 'var' points out the member of the struct (the actual
* struct to store it in is implicitly defined by the #SettingDesc
* list / .ini file preamble the entry is in).
*
* The something part defines the type of variable to store. There are a
* lot of types. Easy ones are:
* - VAR: any number type, 'type' field specifies what number. eg int8_t or uint32
* - BOOL: a boolean number type
* - STR: a string or character. 'type' field specifies what string. Normal, string, or quoted
* A bit more difficult to use are MMANY (meaning ManyOfMany) and OMANY (OneOfMany)
* These are actually normal numbers, only bitmasked. In MMANY several bits can
* be set, in the other only one.
* If nothing fits you, you can use the GENERAL macros, but it exposes the
* internal structure somewhat so it needs a little looking.
*
* While reading values from openttd.cfg, some values may not be converted
* properly, for any kind of reasons. In order to allow a process of self-cleaning
* mechanism, a callback procedure is made available. You will have to supply the function, which
* will work on a string, one function per setting. And of course, enable the callback param
* on the appropriate macro.
*/
#define NSD(type, ...) SettingVariant { std::in_place_type<type##SettingDesc>, __VA_ARGS__ }
/* Macros for various objects to go in the configuration file.
* This section is for global variables */
#define SDTG_VAR(name, type, flags, var, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Int, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDTG_BOOL(name, flags, var, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Bool, SLEG_GENERAL(name, SL_VAR, var, SLE_BOOL, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDTG_LIST(name, type, flags, var, def, length, from, to, cat, extra, startup)\
NSD(List, SLEG_GENERAL(name, SL_ARR, var, type, length, from, to, extra),flags, startup, def)
#define SDTG_SSTR(name, type, flags, var, def, max_length, pre_check, post_callback, from, to, cat, extra, startup)\
NSD(String, SLEG_GENERAL(name, SL_STDSTR, var, type, sizeof(var), from, to, extra), flags, startup, def, max_length, pre_check, post_callback)
#define SDTG_OMANY(name, type, flags, var, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(OneOfMany, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, max, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, nullptr)
#define SDTG_MMANY(name, type, flags, var, def, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(ManyOfMany, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, nullptr)
/* Macros for various objects to go in the configuration file.
* This section is for structures where their various members are saved */
#define SDT_VAR(base, var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Int, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDT_VAR_NAME(base, var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup, name)\
NSD(Int, SLE_GENERAL_NAME(SL_VAR, name, base, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDT_BOOL(base, var, flags, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Bool, SLE_GENERAL(SL_VAR, base, var, SLE_BOOL, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDT_LIST(base, var, type, flags, def, from, to, cat, extra, startup)\
NSD(List, SLE_GENERAL(SL_ARR, base, var, type, lengthof(((base*)8)->var), from, to, extra), flags, startup, def)
#define SDT_SSTR(base, var, type, flags, def, pre_check, post_callback, from, to, cat, extra, startup)\
NSD(String, SLE_GENERAL(SL_STDSTR, base, var, type, sizeof(((base*)8)->var), from, to, extra), flags, startup, def, 0, pre_check, post_callback)
#define SDT_OMANY(base, var, type, flags, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, load, cat, extra, startup)\
NSD(OneOfMany, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, max, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, load)
#define SDT_MMANY(base, var, type, flags, def, full, str, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, strhelp, strval, from, to, cat, extra, startup)\
NSD(ManyOfMany, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, nullptr)
#define SDTC_VAR(var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
SDTG_VAR(#var, type, flags, _settings_client.var, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)
#define SDTC_BOOL(var, flags, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
SDTG_BOOL(#var, flags, _settings_client.var, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)
#define SDTC_LIST(var, type, flags, def, from, to, cat, extra, startup)\
SDTG_LIST(#var, type, flags, _settings_client.var, def, lengthof(_settings_client.var), from, to, cat, extra, startup)
#define SDTC_SSTR(var, type, flags, def, max_length, pre_check, post_callback, from, to, cat, extra, startup)\
SDTG_SSTR(#var, type, flags, _settings_client.var, def, max_length, pre_check, post_callback, from, to, cat, extra, startup)\
#define SDTC_OMANY(var, type, flags, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
SDTG_OMANY(#var, type, flags, _settings_client.var, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)
|