diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-08-22 21:58:23 -0400 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-08-22 21:58:23 -0400 |
commit | 3c45452fae7f33d0534c144c5f588ef98f0a1346 (patch) | |
tree | 02ba43c8405ae2ca8b80940653cb558d0db6191a /src/yuzu/configuration/configure_input.cpp | |
parent | ab862207d7f2de712e1f711141d20921b414cdf7 (diff) |
general: Use console mode helper across project
Diffstat (limited to 'src/yuzu/configuration/configure_input.cpp')
-rw-r--r-- | src/yuzu/configuration/configure_input.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp index 78ed8c6107..e8f9ebfd81 100644 --- a/src/yuzu/configuration/configure_input.cpp +++ b/src/yuzu/configuration/configure_input.cpp @@ -4,6 +4,7 @@ #include <memory> #include <thread> +#include "common/settings.h" #include "common/settings_enums.h" #include "core/core.h" #include "core/hid/emulated_controller.h" @@ -198,14 +199,11 @@ void ConfigureInput::ApplyConfiguration() { advanced->ApplyConfiguration(); - const bool pre_docked_mode = - Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked; - Settings::values.use_docked_mode.SetValue(ui->radioDocked->isChecked() - ? Settings::ConsoleMode::Docked - : Settings::ConsoleMode::Handheld); - OnDockedModeChanged( - pre_docked_mode, - Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked, system); + const bool pre_docked_mode = Settings::IsDockedMode(); + const bool docked_mode_selected = ui->radioDocked->isChecked(); + Settings::values.use_docked_mode.SetValue( + docked_mode_selected ? Settings::ConsoleMode::Docked : Settings::ConsoleMode::Handheld); + OnDockedModeChanged(pre_docked_mode, docked_mode_selected, system); Settings::values.vibration_enabled.SetValue(ui->vibrationGroup->isChecked()); Settings::values.motion_enabled.SetValue(ui->motionGroup->isChecked()); @@ -273,10 +271,8 @@ void ConfigureInput::UpdateDockedState(bool is_handheld) { ui->radioDocked->setEnabled(!is_handheld); ui->radioUndocked->setEnabled(!is_handheld); - ui->radioDocked->setChecked(Settings::values.use_docked_mode.GetValue() == - Settings::ConsoleMode::Docked); - ui->radioUndocked->setChecked(Settings::values.use_docked_mode.GetValue() == - Settings::ConsoleMode::Handheld); + ui->radioDocked->setChecked(Settings::IsDockedMode()); + ui->radioUndocked->setChecked(!Settings::IsDockedMode()); // Also force into undocked mode if the controller type is handheld. if (is_handheld) { |