(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

@@ -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 {