diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-06-21 10:32:13 +0200 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-07-21 16:56:55 +0200 |
commit | 7f708e8d77fb6237407f49246622dbe1b445d536 (patch) | |
tree | 454602f59a51763b12e4952046fbd0bdf47bd4ec /src/common/settings_setting.h | |
parent | shared_widget: Internalize component restoring (diff) | |
download | yuzu-7f708e8d77fb6237407f49246622dbe1b445d536.tar yuzu-7f708e8d77fb6237407f49246622dbe1b445d536.tar.gz yuzu-7f708e8d77fb6237407f49246622dbe1b445d536.tar.bz2 yuzu-7f708e8d77fb6237407f49246622dbe1b445d536.tar.lz yuzu-7f708e8d77fb6237407f49246622dbe1b445d536.tar.xz yuzu-7f708e8d77fb6237407f49246622dbe1b445d536.tar.zst yuzu-7f708e8d77fb6237407f49246622dbe1b445d536.zip |
Diffstat (limited to 'src/common/settings_setting.h')
-rw-r--r-- | src/common/settings_setting.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h index 9805a5b5d..dd91250a1 100644 --- a/src/common/settings_setting.h +++ b/src/common/settings_setting.h @@ -37,9 +37,11 @@ public: explicit Setting(Linkage& linkage, const Type& default_val, const std::string& name, enum Category category_, enum Specialization specialization = Specialization::Default, - bool save_ = true, bool runtime_modifiable_ = false) + bool save_ = true, bool runtime_modifiable_ = false, + BasicSetting* other_setting = nullptr) requires(!ranged) - : BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization), + : BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization, + other_setting), value{default_val}, default_value{default_val} {} virtual ~Setting() = default; @@ -56,9 +58,11 @@ public: explicit Setting(Linkage& linkage, const Type& default_val, const Type& min_val, const Type& max_val, const std::string& name, enum Category category_, enum Specialization specialization = Specialization::Default, - bool save_ = true, bool runtime_modifiable_ = false) + bool save_ = true, bool runtime_modifiable_ = false, + BasicSetting* other_setting = nullptr) requires(ranged) - : BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization), + : BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization, + other_setting), value{default_val}, default_value{default_val}, maximum{max_val}, minimum{min_val} {} /** @@ -235,10 +239,12 @@ public: explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, Category category_, enum Specialization specialization = Specialization::Default, - bool save_ = true, bool runtime_modifiable_ = false) + bool save_ = true, bool runtime_modifiable_ = false, + BasicSetting* other_setting = nullptr) requires(!ranged) - : Setting<Type, false>{linkage, default_val, name, category_, specialization, - save_, runtime_modifiable_} { + : Setting<Type, false>{ + linkage, default_val, name, category_, specialization, + save_, runtime_modifiable_, other_setting} { linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); } virtual ~SwitchableSetting() = default; @@ -256,11 +262,12 @@ public: explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, const Type& max_val, const std::string& name, Category category_, enum Specialization specialization = Specialization::Default, - bool save_ = true, bool runtime_modifiable_ = false) + bool save_ = true, bool runtime_modifiable_ = false, + BasicSetting* other_setting = nullptr) requires(ranged) - : Setting<Type, true>{linkage, default_val, min_val, - max_val, name, category_, - specialization, save_, runtime_modifiable_} { + : Setting<Type, true>{ + linkage, default_val, min_val, max_val, name, category_, specialization, + save_, runtime_modifiable_, other_setting} { linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); } |