summaryrefslogtreecommitdiff
path: root/src/yuzu/configuration/configuration_shared.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-07-16 15:32:52 -0700
committerGitHub <noreply@github.com>2022-07-16 15:32:52 -0700
commit7d66f8339e4243c74c54b43cfbc3e944fbecb3e8 (patch)
tree87768226bd5f30bc8b980eb07ef6f94b6878c5c5 /src/yuzu/configuration/configuration_shared.h
parentb8813edc51e6bffb8c7e724d848ab45887a93687 (diff)
parent99fbdaf75b18dd4cdaad1e93fa2a4ad82b0591aa (diff)
Merge pull request #8593 from merryhime/ranged-setting-T
common/setting: Make ranged a property of the type
Diffstat (limited to 'src/yuzu/configuration/configuration_shared.h')
-rw-r--r--src/yuzu/configuration/configuration_shared.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h
index 77802a367..56800b6ff 100644
--- a/src/yuzu/configuration/configuration_shared.h
+++ b/src/yuzu/configuration/configuration_shared.h
@@ -27,8 +27,9 @@ enum class CheckState {
// ApplyPerGameSetting, given a Settings::Setting and a Qt UI element, properly applies a Setting
void ApplyPerGameSetting(Settings::SwitchableSetting<bool>* setting, const QCheckBox* checkbox,
const CheckState& tracker);
-template <typename Type>
-void ApplyPerGameSetting(Settings::SwitchableSetting<Type>* setting, const QComboBox* combobox) {
+template <typename Type, bool ranged>
+void ApplyPerGameSetting(Settings::SwitchableSetting<Type, ranged>* setting,
+ const QComboBox* combobox) {
if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) {
setting->SetValue(static_cast<Type>(combobox->currentIndex()));
} else if (!Settings::IsConfiguringGlobal()) {
@@ -45,8 +46,9 @@ void ApplyPerGameSetting(Settings::SwitchableSetting<Type>* setting, const QComb
// Sets a Qt UI element given a Settings::Setting
void SetPerGameSetting(QCheckBox* checkbox, const Settings::SwitchableSetting<bool>* setting);
-template <typename Type>
-void SetPerGameSetting(QComboBox* combobox, const Settings::SwitchableSetting<Type>* setting) {
+template <typename Type, bool ranged>
+void SetPerGameSetting(QComboBox* combobox,
+ const Settings::SwitchableSetting<Type, ranged>* setting) {
combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX
: static_cast<int>(setting->GetValue()) +
ConfigurationShared::USE_GLOBAL_OFFSET);