aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/yuzu/configuration/configure_general.cpp
diff options
context:
space:
mode:
authorlat9nq <[email protected]>2021-05-15 22:59:38 -0400
committerlat9nq <[email protected]>2021-05-15 22:59:38 -0400
commit4aac1ae4b1c39a8341cad7134c4bd356aeb83a3f (patch)
tree84b211c9f51182b892935ddd06f55e6e6b35c444 /src/yuzu/configuration/configure_general.cpp
parent59236b7d0f46e7486bcac0ef884fff424fa603df (diff)
downloadyuzu-android-4aac1ae4b1c39a8341cad7134c4bd356aeb83a3f.tar.gz
yuzu-android-4aac1ae4b1c39a8341cad7134c4bd356aeb83a3f.zip
configuration: Simplify applying per-game settings
Originally, every time we add a per-game setting, we'd have to guard for it when setting it on the global config, and use a specific function to do it for the per-game config. This moves the global check into the ApplyPerGameSetting function so that we can use it for changing both the global and per-game states. Less work for the programmer.
Diffstat (limited to 'src/yuzu/configuration/configure_general.cpp')
-rw-r--r--src/yuzu/configuration/configure_general.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp
index 2fa88dcec..68c8aeb19 100644
--- a/src/yuzu/configuration/configure_general.cpp
+++ b/src/yuzu/configuration/configure_general.cpp
@@ -50,6 +50,9 @@ void ConfigureGeneral::SetConfiguration() {
}
void ConfigureGeneral::ApplyConfiguration() {
+ ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core,
+ ui->use_multi_core, use_multi_core);
+
if (Settings::IsConfiguringGlobal()) {
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked();
@@ -62,13 +65,7 @@ void ConfigureGeneral::ApplyConfiguration() {
Qt::Checked);
Settings::values.frame_limit.SetValue(ui->frame_limit->value());
}
- if (Settings::values.use_multi_core.UsingGlobal()) {
- Settings::values.use_multi_core.SetValue(ui->use_multi_core->isChecked());
- }
} else {
- ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core,
- ui->use_multi_core, use_multi_core);
-
bool global_frame_limit = use_frame_limit == ConfigurationShared::CheckState::Global;
Settings::values.use_frame_limit.SetGlobal(global_frame_limit);
Settings::values.frame_limit.SetGlobal(global_frame_limit);
@@ -94,6 +91,9 @@ void ConfigureGeneral::RetranslateUI() {
void ConfigureGeneral::SetupPerGameUI() {
if (Settings::IsConfiguringGlobal()) {
+ // Disables each setting if:
+ // - A game is running (thus settings in use), and
+ // - A non-global setting is applied.
ui->toggle_frame_limit->setEnabled(Settings::values.use_frame_limit.UsingGlobal());
ui->frame_limit->setEnabled(Settings::values.frame_limit.UsingGlobal());