(svn r24671) -Feature [FS#5355]: Add basic/advanced/expert filters to adv. settings GUI. (Eagle_rainbow)

This commit is contained in:
frosch 2012-11-08 10:04:00 +00:00
parent 79a1e6450b
commit 69a62452be
10 changed files with 369 additions and 75 deletions

View File

@ -1117,7 +1117,9 @@ STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Company setting
STR_CONFIG_SETTING_RESTRICT_LABEL :{BLACK}Show:
STR_CONFIG_SETTING_RESTRICT_DROPDOWN_HELPTEXT :{BLACK}Restricts the list below showing only changed settings
STR_CONFIG_SETTING_RESTRICT_ALL :All settings
STR_CONFIG_SETTING_RESTRICT_BASIC :Basic settings
STR_CONFIG_SETTING_RESTRICT_ADVANCED :Advanced settings
STR_CONFIG_SETTING_RESTRICT_ALL :Expert settings / all settings
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_DEFAULT :Settings with a different value than the default
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_DEFAULT_WO_LOCAL :Non-client settings with a different value than the default
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_NEW :Settings with a different value than your new-game settings

View File

@ -997,6 +997,8 @@ struct SettingEntrySetting {
/** How the list of advanced settings is filtered. */
enum RestrictionMode {
RM_BASIC, ///< Display settings associated to the "basic" list.
RM_ADVANCED, ///< Display settings associated to the "advanced" list.
RM_ALL, ///< List all settings regardless of the default/newgame/... values.
RM_CHANGED_AGAINST_DEFAULT, ///< Show only settings which are different compared to default values.
RM_CHANGED_AGAINST_DEFAULT_WO_LOCAL, ///< Show only non-local settings which are different compared to default values.
@ -1302,6 +1304,9 @@ bool SettingEntry::IsVisibleByRestrictionMode(RestrictionMode mode) const
return false;
}
if (mode == RM_BASIC) return (this->d.entry.setting->desc.cat & SC_BASIC_LIST) != 0;
if (mode == RM_ADVANCED) return (this->d.entry.setting->desc.cat & SC_ADVANCED_LIST) != 0;
/* Read the current value. */
const void *var = ResolveVariableAddress(settings_ptr, sd);
int64 current_value = ReadValue(var, sd->save.conv);
@ -1942,6 +1947,8 @@ static SettingEntry _settings_main[] = {
static SettingsPage _settings_main_page = {_settings_main, lengthof(_settings_main)};
static const StringID _game_settings_restrict_dropdown[] = {
STR_CONFIG_SETTING_RESTRICT_BASIC, // RM_BASIC
STR_CONFIG_SETTING_RESTRICT_ADVANCED, // RM_ADVANCED
STR_CONFIG_SETTING_RESTRICT_ALL, // RM_ALL
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_DEFAULT, // RM_CHANGED_AGAINST_DEFAULT
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_DEFAULT_WO_LOCAL, // RM_CHANGED_AGAINST_DEFAULT_WO_LOCAL
@ -1970,7 +1977,7 @@ struct GameSettingsWindow : QueryStringBaseWindow {
Scrollbar *vscroll;
GameSettingsWindow(const WindowDesc *desc) : QueryStringBaseWindow(50), cur_restriction_mode(RM_ALL)
GameSettingsWindow(const WindowDesc *desc) : QueryStringBaseWindow(50), cur_restriction_mode(RM_BASIC)
{
static bool first_time = true;

View File

@ -52,6 +52,30 @@ enum SettingGuiFlagLong {
DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong)
typedef SimpleTinyEnumT<SettingGuiFlagLong, uint16> SettingGuiFlag;
/**
* A SettingCategory defines a grouping of the settings.
* The group #SC_BASIC is intended for settings which also a novice player would like to change and is able to understand.
* The group #SC_ADVANCED is intended for settings which an experienced player would like to use. This is the case for most settings.
* Finally #SC_EXPERT settings only few people want to see in rare cases.
* The grouping is meant to be inclusive, i.e. all settings in #SC_BASIC also will be included
* in the set of settings in #SC_ADVANCED. The group #SC_EXPERT contains all settings.
*/
enum SettingCategory {
SC_NONE = 0,
/* Filters for the list */
SC_BASIC_LIST = 1 << 0, ///< Settings displayed in the list of basic settings.
SC_ADVANCED_LIST = 1 << 1, ///< Settings displayed in the list of advanced settings.
SC_EXPERT_LIST = 1 << 2, ///< Settings displayed in the list of expert settings.
/* Setting classification */
SC_BASIC = SC_BASIC_LIST | SC_ADVANCED_LIST | SC_EXPERT_LIST, ///< Basic settings are part of all lists.
SC_ADVANCED = SC_ADVANCED_LIST | SC_EXPERT_LIST, ///< Advanced settings are part of advanced and expert list.
SC_EXPERT = SC_EXPERT_LIST, ///< Expert settings can only be seen in the expert list.
SC_END,
};
typedef bool OnChange(int32 var); ///< callback prototype on data modification
typedef size_t OnConvert(const char *value); ///< callback prototype for convertion error
@ -71,6 +95,7 @@ struct SettingDescBase {
StringID str_val; ///< (Translated) first string describing the value.
OnChange *proc; ///< callback procedure for when the value is changed
OnConvert *proc_cnvt; ///< callback procedure when loading value mechanism fails
SettingCategory cat; ///< assigned categories of the setting
};
struct SettingDesc {

View File

@ -14,8 +14,8 @@ static const SettingDesc _company_settings[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL($base, $var, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to),
SDT_BOOL = SDT_BOOL($base, $var, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_END = SDT_END()
[defaults]
@ -29,6 +29,7 @@ proc = NULL
load = NULL
from = 0
to = SL_MAX_VERSION
cat = SC_ADVANCED

View File

@ -11,9 +11,9 @@ static const SettingDesc _currency_settings[] = {
[post-amble]
};
[templates]
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to),
SDT_CHR = SDT_CHR($base, $var, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to),
SDT_STR = SDT_STR($base, $var, $type, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_CHR = SDT_CHR($base, $var, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_STR = SDT_STR($base, $var, $type, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_END = SDT_END()
[defaults]
@ -27,6 +27,7 @@ proc = NULL
load = NULL
from = 0
to = SL_MAX_VERSION
cat = SC_ADVANCED
@ -42,6 +43,7 @@ max = UINT16_MAX
base = CurrencySpec
var = separator
def = "".""
cat = SC_BASIC
[SDT_VAR]
base = CurrencySpec

View File

@ -36,11 +36,11 @@ static const SettingDesc _gameopt_settings[] = {
[post-amble]
};
[templates]
SDTG_GENERAL = SDTG_GENERAL($name, $sdt_cmd, $sle_cmd, $type, $flags, $guiflags, $var, $length, $def, $min, $max, $interval, $full, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_GENERAL = SDTG_GENERAL($name, $sdt_cmd, $sle_cmd, $type, $flags, $guiflags, $var, $length, $def, $min, $max, $interval, $full, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_NULL = SDT_NULL($length, $from, $to),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to),
SDT_OMANY = SDT_OMANY($base, $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $load),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_OMANY = SDT_OMANY($base, $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $load, $cat),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDT_END = SDT_END()
[defaults]
@ -54,6 +54,7 @@ proc = NULL
load = NULL
from = 0
to = SL_MAX_VERSION
cat = SC_ADVANCED
@ -93,6 +94,7 @@ type = SLE_UINT8
def = 3
min = 0
max = 3
cat = SC_BASIC
[SDT_OMANY]
base = GameSettings
@ -102,6 +104,7 @@ flags = SLF_NO_NETWORK_SYNC
def = 0
max = CUSTOM_CURRENCY_ID
full = _locale_currencies
cat = SC_BASIC
[SDT_OMANY]
base = GameSettings
@ -111,6 +114,7 @@ flags = SLF_NO_NETWORK_SYNC
def = 1
max = 2
full = _locale_units
cat = SC_BASIC
# There are only 21 predefined town_name values (0-20), but you can have more with newgrf action F so allow
# these bigger values (21-255). Invalid values will fallback to english on use and (undefined string) in GUI.
@ -121,6 +125,7 @@ type = SLE_UINT8
def = 0
max = 255
full = _town_names
cat = SC_BASIC
[SDT_OMANY]
base = GameSettings
@ -130,6 +135,7 @@ def = 0
max = 3
full = _climates
load = ConvertLandscape
cat = SC_BASIC
[SDT_VAR]
base = GameSettings
@ -157,6 +163,7 @@ flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
def = 1
max = 4
full = _autosave_interval
cat = SC_BASIC
[SDT_OMANY]
base = GameSettings
@ -165,6 +172,7 @@ type = SLE_UINT8
def = 1
max = 1
full = _roadsides
cat = SC_BASIC
[SDT_END]

View File

@ -13,11 +13,11 @@ static const SettingDescGlobVarList _misc_settings[] = {
[post-amble]
};
[templates]
SDTG_LIST = SDTG_LIST($name, $type, $length, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_MMANY = SDTG_MMANY($name, $type, $flags, $guiflags, $var, $def, $full, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_STR = SDTG_STR($name, $type, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_LIST = SDTG_LIST($name, $type, $length, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDTG_MMANY = SDTG_MMANY($name, $type, $flags, $guiflags, $var, $def, $full, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDTG_STR = SDTG_STR($name, $type, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDTG_END = SDTG_END()
[defaults]
@ -31,6 +31,7 @@ proc = NULL
load = NULL
from = 0
to = SL_MAX_VERSION
cat = SC_ADVANCED
@ -50,42 +51,49 @@ def = true
name = ""fullscreen""
var = _fullscreen
def = false
cat = SC_BASIC
[SDTG_STR]
name = ""graphicsset""
type = SLE_STRQ
var = BaseGraphics::ini_set
def = NULL
cat = SC_BASIC
[SDTG_STR]
name = ""soundsset""
type = SLE_STRQ
var = BaseSounds::ini_set
def = NULL
cat = SC_BASIC
[SDTG_STR]
name = ""musicset""
type = SLE_STRQ
var = BaseMusic::ini_set
def = NULL
cat = SC_BASIC
[SDTG_STR]
name = ""videodriver""
type = SLE_STRQ
var = _ini_videodriver
def = NULL
cat = SC_EXPERT
[SDTG_STR]
name = ""musicdriver""
type = SLE_STRQ
var = _ini_musicdriver
def = NULL
cat = SC_EXPERT
[SDTG_STR]
name = ""sounddriver""
type = SLE_STRQ
var = _ini_sounddriver
def = NULL
cat = SC_EXPERT
[SDTG_STR]
name = ""blitter""
@ -98,6 +106,7 @@ name = ""language""
type = SLE_STRB
var = _config_language_file
def = NULL
cat = SC_BASIC
; workaround for implicit lengthof() in SDTG_LIST
[SDTG_LIST]
@ -106,18 +115,21 @@ type = SLE_INT
length = 2
var = _cur_resolution
def = ""640,480""
cat = SC_BASIC
[SDTG_STR]
name = ""screenshot_format""
type = SLE_STRB
var = _screenshot_format_name
def = NULL
cat = SC_EXPERT
[SDTG_STR]
name = ""savegame_format""
type = SLE_STRB
var = _savegame_format
def = NULL
cat = SC_EXPERT
[SDTG_BOOL]
name = ""rightclick_emulate""
@ -219,6 +231,7 @@ var = _sprite_cache_size
def = 128
min = 1
max = 512
cat = SC_EXPERT
[SDTG_VAR]
name = ""player_face""
@ -227,6 +240,7 @@ var = _company_manager_face
def = 0
min = 0
max = 0xFFFFFFFF
cat = SC_BASIC
[SDTG_VAR]
name = ""transparency_options""
@ -235,6 +249,7 @@ var = _transparency_opt
def = 0
min = 0
max = 0x1FF
cat = SC_BASIC
[SDTG_VAR]
name = ""transparency_locks""
@ -243,6 +258,7 @@ var = _transparency_lock
def = 0
min = 0
max = 0x1FF
cat = SC_BASIC
[SDTG_VAR]
name = ""invisibility_options""
@ -251,18 +267,21 @@ var = _invisibility_opt
def = 0
min = 0
max = 0xFF
cat = SC_BASIC
[SDTG_STR]
name = ""keyboard""
type = SLE_STRB
var = _keyboard_opt[0]
def = NULL
cat = SC_EXPERT
[SDTG_STR]
name = ""keyboard_caps""
type = SLE_STRB
var = _keyboard_opt[1]
def = NULL
cat = SC_EXPERT
[SDTG_VAR]
name = ""last_newgrf_count""
@ -271,6 +290,7 @@ var = _settings_client.gui.last_newgrf_count
def = 100
min = 0
max = UINT32_MAX
cat = SC_EXPERT
[SDTG_END]

View File

@ -46,81 +46,81 @@ static size_t ConvertLandscape(const char *value);
* on the appropriate macro.
*/
#define NSD_GENERAL(name, def, cmd, guiflags, min, max, interval, many, str, strhelp, strval, proc, load)\
{name, (const void*)(size_t)(def), {(byte)cmd}, {(uint16)guiflags}, min, max, interval, many, str, strhelp, strval, proc, load}
#define NSD_GENERAL(name, def, cmd, guiflags, min, max, interval, many, str, strhelp, strval, proc, load, cat)\
{name, (const void*)(size_t)(def), {(byte)cmd}, {(uint16)guiflags}, min, max, interval, many, str, strhelp, strval, proc, load, cat}
/* Macros for various objects to go in the configuration file.
* This section is for global variables */
#define SDTG_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, var, length, def, min, max, interval, full, str, strhelp, strval, proc, from, to)\
{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, strhelp, strval, proc, NULL), SLEG_GENERAL(sle_cmd, var, type | flags, length, from, to)}
#define SDTG_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, var, length, def, min, max, interval, full, str, strhelp, strval, proc, from, to, cat)\
{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, strhelp, strval, proc, NULL, cat), SLEG_GENERAL(sle_cmd, var, type | flags, length, from, to)}
#define SDTG_VAR(name, type, flags, guiflags, var, def, min, max, interval, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(name, SDT_NUMX, SL_VAR, type, flags, guiflags, var, 0, def, min, max, interval, NULL, str, strhelp, strval, proc, from, to)
#define SDTG_VAR(name, type, flags, guiflags, var, def, min, max, interval, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(name, SDT_NUMX, SL_VAR, type, flags, guiflags, var, 0, def, min, max, interval, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTG_BOOL(name, flags, guiflags, var, def, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(name, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, var, 0, def, 0, 1, 0, NULL, str, strhelp, strval, proc, from, to)
#define SDTG_BOOL(name, flags, guiflags, var, def, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(name, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, var, 0, def, 0, 1, 0, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTG_LIST(name, type, length, flags, guiflags, var, def, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(name, SDT_INTLIST, SL_ARR, type, flags, guiflags, var, length, def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to)
#define SDTG_LIST(name, type, length, flags, guiflags, var, def, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(name, SDT_INTLIST, SL_ARR, type, flags, guiflags, var, length, def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTG_STR(name, type, flags, guiflags, var, def, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(name, SDT_STRING, SL_STR, type, flags, guiflags, var, lengthof(var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to)
#define SDTG_STR(name, type, flags, guiflags, var, def, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(name, SDT_STRING, SL_STR, type, flags, guiflags, var, lengthof(var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTG_OMANY(name, type, flags, guiflags, var, def, max, full, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(name, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, max, 0, full, str, strhelp, strval, proc, from, to)
#define SDTG_OMANY(name, type, flags, guiflags, var, def, max, full, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(name, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, max, 0, full, str, strhelp, strval, proc, from, to, cat)
#define SDTG_MMANY(name, type, flags, guiflags, var, def, full, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, 0, full, str, strhelp, strval, proc, from, to)
#define SDTG_MMANY(name, type, flags, guiflags, var, def, full, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, 0, full, str, strhelp, strval, proc, from, to, cat)
#define SDTG_NULL(length, from, to)\
{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL}, SLEG_NULL(length, from, to)}
{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL, SC_NONE}, SLEG_NULL(length, from, to)}
#define SDTG_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL}, SLEG_END()}
#define SDTG_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL, SC_NONE}, SLEG_END()}
/* Macros for various objects to go in the configuration file.
* This section is for structures where their various members are saved */
#define SDT_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, base, var, length, def, min, max, interval, full, str, strhelp, strval, proc, load, from, to)\
{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, strhelp, strval, proc, load), SLE_GENERAL(sle_cmd, base, var, type | flags, length, from, to)}
#define SDT_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, base, var, length, def, min, max, interval, full, str, strhelp, strval, proc, load, from, to, cat)\
{NSD_GENERAL(name, def, sdt_cmd, guiflags, min, max, interval, full, str, strhelp, strval, proc, load, cat), SLE_GENERAL(sle_cmd, base, var, type | flags, length, from, to)}
#define SDT_VAR(base, var, type, flags, guiflags, def, min, max, interval, str, strhelp, strval, proc, from, to)\
SDT_GENERAL(#var, SDT_NUMX, SL_VAR, type, flags, guiflags, base, var, 1, def, min, max, interval, NULL, str, strhelp, strval, proc, NULL, from, to)
#define SDT_VAR(base, var, type, flags, guiflags, def, min, max, interval, str, strhelp, strval, proc, from, to, cat)\
SDT_GENERAL(#var, SDT_NUMX, SL_VAR, type, flags, guiflags, base, var, 1, def, min, max, interval, NULL, str, strhelp, strval, proc, NULL, from, to, cat)
#define SDT_BOOL(base, var, flags, guiflags, def, str, strhelp, strval, proc, from, to)\
SDT_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, base, var, 1, def, 0, 1, 0, NULL, str, strhelp, strval, proc, NULL, from, to)
#define SDT_BOOL(base, var, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat)\
SDT_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, base, var, 1, def, 0, 1, 0, NULL, str, strhelp, strval, proc, NULL, from, to, cat)
#define SDT_LIST(base, var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to)\
SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, NULL, from, to)
#define SDT_LIST(base, var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat)\
SDT_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, NULL, from, to, cat)
#define SDT_STR(base, var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to)\
SDT_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, NULL, from, to)
#define SDT_STR(base, var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat)\
SDT_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, base, var, lengthof(((base*)8)->var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, NULL, from, to, cat)
#define SDT_CHR(base, var, flags, guiflags, def, str, strhelp, strval, proc, from, to)\
SDT_GENERAL(#var, SDT_STRING, SL_VAR, SLE_CHAR, flags, guiflags, base, var, 1, def, 0, 0, 0, NULL, str, strhelp, strval, proc, NULL, from, to)
#define SDT_CHR(base, var, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat)\
SDT_GENERAL(#var, SDT_STRING, SL_VAR, SLE_CHAR, flags, guiflags, base, var, 1, def, 0, 0, 0, NULL, str, strhelp, strval, proc, NULL, from, to, cat)
#define SDT_OMANY(base, var, type, flags, guiflags, def, max, full, str, strhelp, strval, proc, from, to, load)\
SDT_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, max, 0, full, str, strhelp, strval, proc, load, from, to)
#define SDT_OMANY(base, var, type, flags, guiflags, def, max, full, str, strhelp, strval, proc, from, to, load, cat)\
SDT_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, max, 0, full, str, strhelp, strval, proc, load, from, to, cat)
#define SDT_MMANY(base, var, type, flags, guiflags, def, full, str, proc, strhelp, strval, from, to)\
SDT_GENERAL(#var, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, 0, 0, full, str, strhelp, strval, proc, NULL, from, to)
#define SDT_MMANY(base, var, type, flags, guiflags, def, full, str, proc, strhelp, strval, from, to, cat)\
SDT_GENERAL(#var, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, 0, 0, full, str, strhelp, strval, proc, NULL, from, to, cat)
#define SDT_NULL(length, from, to)\
{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL}, SLE_CONDNULL(length, from, to)}
{{"", NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL, SC_NONE}, SLE_CONDNULL(length, from, to)}
#define SDTC_VAR(var, type, flags, guiflags, def, min, max, interval, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(#var, SDT_NUMX, SL_VAR, type, flags, guiflags, _settings_client.var, 1, def, min, max, interval, NULL, str, strhelp, strval, proc, from, to)
#define SDTC_VAR(var, type, flags, guiflags, def, min, max, interval, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(#var, SDT_NUMX, SL_VAR, type, flags, guiflags, _settings_client.var, 1, def, min, max, interval, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTC_BOOL(var, flags, guiflags, def, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, _settings_client.var, 1, def, 0, 1, 0, NULL, str, strhelp, strval, proc, from, to)
#define SDTC_BOOL(var, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, _settings_client.var, 1, def, 0, 1, 0, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTC_LIST(var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to)
#define SDTC_LIST(var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTC_STR(var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to)
#define SDTC_STR(var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, strhelp, strval, proc, from, to, cat)
#define SDTC_OMANY(var, type, flags, guiflags, def, max, full, str, strhelp, strval, proc, from, to)\
SDTG_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, _settings_client.var, 1, def, 0, max, 0, full, str, strhelp, strval, proc, from, to)
#define SDTC_OMANY(var, type, flags, guiflags, def, max, full, str, strhelp, strval, proc, from, to, cat)\
SDTG_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, _settings_client.var, 1, def, 0, max, 0, full, str, strhelp, strval, proc, from, to, cat)
#define SDT_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL}, SLE_END()}
#define SDT_END() {{NULL, NULL, {0}, {0}, 0, 0, 0, NULL, STR_NULL, STR_NULL, STR_NULL, NULL, NULL, SC_NONE}, SLE_END()}

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,8 @@ static const SettingDescGlobVarList _win32_settings[] = {
};
#endif /* WIN32 */
[templates]
SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to),
SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat),
SDTG_END = SDTG_END()
[defaults]
@ -32,6 +32,7 @@ proc = NULL
load = NULL
from = 0
to = SL_MAX_VERSION
cat = SC_ADVANCED
@ -42,11 +43,13 @@ var = _display_hz
def = 0
min = 0
max = 120
cat = SC_EXPERT
[SDTG_BOOL]
name = ""force_full_redraw""
var = _force_full_redraw
def = false
cat = SC_EXPERT
[SDTG_VAR]
name = ""fullscreen_bpp""
@ -55,11 +58,13 @@ var = _fullscreen_bpp
def = 8
min = 8
max = 32
cat = SC_EXPERT
[SDTG_BOOL]
name = ""window_maximize""
var = _window_maximize
def = false
cat = SC_BASIC
[SDTG_END]