summaryrefslogtreecommitdiffstats
path: root/src/yuzu/configuration/configuration_shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/yuzu/configuration/configuration_shared.cpp58
1 files changed, 17 insertions, 41 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp
index 89be4a62d..096e42e94 100644
--- a/src/yuzu/configuration/configuration_shared.cpp
+++ b/src/yuzu/configuration/configuration_shared.cpp
@@ -13,32 +13,29 @@
void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<bool>* setting,
const QCheckBox* checkbox,
const CheckState& tracker) {
- if (tracker == CheckState::Global) {
- setting->SetGlobal(true);
- } else {
- setting->SetGlobal(false);
+ if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) {
setting->SetValue(checkbox->checkState());
+ } else if (!Settings::IsConfiguringGlobal()) {
+ if (tracker == CheckState::Global) {
+ setting->SetGlobal(true);
+ } else {
+ setting->SetGlobal(false);
+ setting->SetValue(checkbox->checkState());
+ }
}
}
void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<int>* setting,
const QComboBox* combobox) {
- if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
- setting->SetGlobal(true);
- } else {
- setting->SetGlobal(false);
- setting->SetValue(combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET);
- }
-}
-
-void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting,
- const QComboBox* combobox) {
- if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
- setting->SetGlobal(true);
- } else {
- setting->SetGlobal(false);
- setting->SetValue(static_cast<Settings::RendererBackend>(
- combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET));
+ if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) {
+ setting->SetValue(combobox->currentIndex());
+ } else if (!Settings::IsConfiguringGlobal()) {
+ if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
+ setting->SetGlobal(true);
+ } else {
+ setting->SetGlobal(false);
+ setting->SetValue(combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET);
+ }
}
}
@@ -51,27 +48,6 @@ void ConfigurationShared::SetPerGameSetting(QCheckBox* checkbox,
}
}
-void ConfigurationShared::SetPerGameSetting(QComboBox* combobox,
- const Settings::Setting<int>* setting) {
- combobox->setCurrentIndex(setting->UsingGlobal()
- ? ConfigurationShared::USE_GLOBAL_INDEX
- : setting->GetValue() + ConfigurationShared::USE_GLOBAL_OFFSET);
-}
-
-void ConfigurationShared::SetPerGameSetting(
- QComboBox* combobox, const Settings::Setting<Settings::RendererBackend>* setting) {
- combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX
- : static_cast<int>(setting->GetValue()) +
- ConfigurationShared::USE_GLOBAL_OFFSET);
-}
-
-void ConfigurationShared::SetPerGameSetting(
- QComboBox* combobox, const Settings::Setting<Settings::GPUAccuracy>* setting) {
- combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX
- : static_cast<int>(setting->GetValue()) +
- ConfigurationShared::USE_GLOBAL_OFFSET);
-}
-
void ConfigurationShared::SetHighlight(QWidget* widget, bool highlighted) {
if (highlighted) {
widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,203,255,0.5) }")