diff options
author | frosch <frosch@openttd.org> | 2012-11-08 10:04:00 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-11-08 10:04:00 +0000 |
commit | 69a62452beab943a4f95d0aead7207d3f9de0a44 (patch) | |
tree | 4977654ebce513c7e02f77bce2a2f60dc5429692 /src/settings_gui.cpp | |
parent | 79a1e6450b2fdf38c2e044d306bac2fa630db814 (diff) | |
download | openttd-69a62452beab943a4f95d0aead7207d3f9de0a44.tar.xz |
(svn r24671) -Feature [FS#5355]: Add basic/advanced/expert filters to adv. settings GUI. (Eagle_rainbow)
Diffstat (limited to 'src/settings_gui.cpp')
-rw-r--r-- | src/settings_gui.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 95df9fd4b..33ca7a109 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -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; |