diff options
author | german77 <juangerman-13@hotmail.com> | 2021-10-20 17:53:14 -0500 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2021-11-24 20:30:25 -0600 |
commit | af55dd193533be577d0a3d01f93a4a3a2c27cd5d (patch) | |
tree | c9fa35290dbf470a7940b3b22249c948970b714c /src/yuzu/main.cpp | |
parent | c3ff0a8ac0d1c3f9c0791b5263dae53c06ad6048 (diff) |
configuration: Migrate controller settings to emulated controller
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ae997ccfa3..46a5f62adf 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -832,15 +832,16 @@ void GMainWindow::InitializeWidgets() { dock_status_button->setFocusPolicy(Qt::NoFocus); connect(dock_status_button, &QPushButton::clicked, [&] { const bool is_docked = Settings::values.use_docked_mode.GetValue(); - auto& controller_type = Settings::values.players.GetValue()[0].controller_type; + auto* player_1 = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); + auto* handheld = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); - if (!is_docked && controller_type == Settings::ControllerType::Handheld) { + if (!is_docked && handheld->IsConnected()) { QMessageBox::warning(this, tr("Invalid config detected"), tr("Handheld controller can't be used on docked mode. Pro " "controller will be selected.")); - controller_type = Settings::ControllerType::ProController; - ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(), *system); - configure_dialog.ApplyConfiguration(); + handheld->Disconnect(); + player_1->SetNpadType(Core::HID::NpadType::ProController); + player_1->Connect(); } Settings::values.use_docked_mode.SetValue(!is_docked); |