diff options
author | Kewlan <[email protected]> | 2021-11-21 16:57:00 +0100 |
---|---|---|
committer | Kewlan <[email protected]> | 2021-11-21 16:57:00 +0100 |
commit | 8e3371a5c5aa26e1f3d0c1f944b65ee6b65c3f34 (patch) | |
tree | e68cbcdee5e9f9e1b484aad562825568e796d88b /src/yuzu/configuration/configure_general.cpp | |
parent | d20f91da11fe7c5d5f1bd4f63cc3b4d221be67a4 (diff) | |
download | yuzu-android-8e3371a5c5aa26e1f3d0c1f944b65ee6b65c3f34.tar.gz yuzu-android-8e3371a5c5aa26e1f3d0c1f944b65ee6b65c3f34.zip |
configure_general: Allow framerate cap to be used in custom game configs
Diffstat (limited to 'src/yuzu/configuration/configure_general.cpp')
-rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 7af3ea97e..566879317 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -30,6 +30,9 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent) connect(ui->button_reset_defaults, &QPushButton::clicked, this, &ConfigureGeneral::ResetDefaults); + + ui->fps_cap_label->setVisible(Settings::IsConfiguringGlobal()); + ui->fps_cap_combobox->setVisible(!Settings::IsConfiguringGlobal()); } ConfigureGeneral::~ConfigureGeneral() = default; @@ -57,6 +60,11 @@ void ConfigureGeneral::SetConfiguration() { } else { ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue() && use_speed_limit != ConfigurationShared::CheckState::Global); + + ui->fps_cap_combobox->setCurrentIndex(Settings::values.fps_cap.UsingGlobal() ? 0 : 1); + ui->fps_cap->setEnabled(!Settings::values.fps_cap.UsingGlobal()); + ConfigurationShared::SetHighlight(ui->fps_cap_layout, + !Settings::values.fps_cap.UsingGlobal()); } } @@ -106,6 +114,13 @@ void ConfigureGeneral::ApplyConfiguration() { Qt::Checked); Settings::values.speed_limit.SetValue(ui->speed_limit->value()); } + + if (ui->fps_cap_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { + Settings::values.fps_cap.SetGlobal(true); + } else { + Settings::values.fps_cap.SetGlobal(false); + Settings::values.fps_cap.SetValue(ui->fps_cap->value()); + } } } @@ -148,4 +163,9 @@ void ConfigureGeneral::SetupPerGameUI() { ui->speed_limit->setEnabled(ui->toggle_speed_limit->isChecked() && (use_speed_limit != ConfigurationShared::CheckState::Global)); }); + + connect(ui->fps_cap_combobox, qOverload<int>(&QComboBox::activated), this, [this](int index) { + ui->fps_cap->setEnabled(index == 1); + ConfigurationShared::SetHighlight(ui->fps_cap_layout, index == 1); + }); } |