summaryrefslogtreecommitdiff
path: root/src/common/settings_setting.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/settings_setting.h')
-rw-r--r--src/common/settings_setting.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h
index a0a05da54..9805a5b5d 100644
--- a/src/common/settings_setting.h
+++ b/src/common/settings_setting.h
@@ -35,10 +35,12 @@ public:
35 * @param category_ Category of the setting AKA INI group 35 * @param category_ Category of the setting AKA INI group
36 */ 36 */
37 explicit Setting(Linkage& linkage, const Type& default_val, const std::string& name, 37 explicit Setting(Linkage& linkage, const Type& default_val, const std::string& name,
38 enum Category category_, bool save_ = true, bool runtime_modifiable_ = false) 38 enum Category category_,
39 enum Specialization specialization = Specialization::Default,
40 bool save_ = true, bool runtime_modifiable_ = false)
39 requires(!ranged) 41 requires(!ranged)
40 : BasicSetting(linkage, name, category_, save_, runtime_modifiable_), value{default_val}, 42 : BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization),
41 default_value{default_val} {} 43 value{default_val}, default_value{default_val} {}
42 virtual ~Setting() = default; 44 virtual ~Setting() = default;
43 45
44 /** 46 /**
@@ -53,10 +55,11 @@ public:
53 */ 55 */
54 explicit Setting(Linkage& linkage, const Type& default_val, const Type& min_val, 56 explicit Setting(Linkage& linkage, const Type& default_val, const Type& min_val,
55 const Type& max_val, const std::string& name, enum Category category_, 57 const Type& max_val, const std::string& name, enum Category category_,
58 enum Specialization specialization = Specialization::Default,
56 bool save_ = true, bool runtime_modifiable_ = false) 59 bool save_ = true, bool runtime_modifiable_ = false)
57 requires(ranged) 60 requires(ranged)
58 : BasicSetting(linkage, name, category_, save_, runtime_modifiable_), value{default_val}, 61 : BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization),
59 default_value{default_val}, maximum{max_val}, minimum{min_val} {} 62 value{default_val}, default_value{default_val}, maximum{max_val}, minimum{min_val} {}
60 63
61 /** 64 /**
62 * Returns a reference to the setting's value. 65 * Returns a reference to the setting's value.
@@ -230,10 +233,12 @@ public:
230 * @param category_ Category of the setting AKA INI group 233 * @param category_ Category of the setting AKA INI group
231 */ 234 */
232 explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, 235 explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name,
233 Category category_, bool save_ = true, 236 Category category_,
234 bool runtime_modifiable_ = false) 237 enum Specialization specialization = Specialization::Default,
238 bool save_ = true, bool runtime_modifiable_ = false)
235 requires(!ranged) 239 requires(!ranged)
236 : Setting<Type, false>{linkage, default_val, name, category_, save_, runtime_modifiable_} { 240 : Setting<Type, false>{linkage, default_val, name, category_, specialization,
241 save_, runtime_modifiable_} {
237 linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); 242 linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); });
238 } 243 }
239 virtual ~SwitchableSetting() = default; 244 virtual ~SwitchableSetting() = default;
@@ -250,10 +255,12 @@ public:
250 */ 255 */
251 explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, 256 explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val,
252 const Type& max_val, const std::string& name, Category category_, 257 const Type& max_val, const std::string& name, Category category_,
258 enum Specialization specialization = Specialization::Default,
253 bool save_ = true, bool runtime_modifiable_ = false) 259 bool save_ = true, bool runtime_modifiable_ = false)
254 requires(ranged) 260 requires(ranged)
255 : Setting<Type, true>{linkage, default_val, min_val, max_val, 261 : Setting<Type, true>{linkage, default_val, min_val,
256 name, category_, save_, runtime_modifiable_} { 262 max_val, name, category_,
263 specialization, save_, runtime_modifiable_} {
257 linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); 264 linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); });
258 } 265 }
259 266