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 | 6774c7988b5a6973cad09b18b2e7bcd0a66f1f8a (patch) | |
| tree | c9fa35290dbf470a7940b3b22249c948970b714c /src/yuzu/configuration/configure_input.cpp | |
| parent | 6c7814bc9cac4decd42f7ae4bf2eb6ea9b227dbd (diff) | |
configuration: Migrate controller settings to emulated controller
Diffstat (limited to 'src/yuzu/configuration/configure_input.cpp')
| -rw-r--r-- | src/yuzu/configuration/configure_input.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp index 67faa8be8a..dece27fdeb 100644 --- a/src/yuzu/configuration/configure_input.cpp +++ b/src/yuzu/configuration/configure_input.cpp @@ -211,8 +211,10 @@ void ConfigureInput::RetranslateUI() { } void ConfigureInput::LoadConfiguration() { + const auto* handheld = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); + LoadPlayerControllerIndices(); - UpdateDockedState(Settings::values.players.GetValue()[8].connected); + UpdateDockedState(handheld->IsConnected()); ui->vibrationGroup->setChecked(Settings::values.vibration_enabled.GetValue()); ui->motionGroup->setChecked(Settings::values.motion_enabled.GetValue()); @@ -220,9 +222,16 @@ void ConfigureInput::LoadConfiguration() { void ConfigureInput::LoadPlayerControllerIndices() { for (std::size_t i = 0; i < player_connected.size(); ++i) { - const auto connected = Settings::values.players.GetValue()[i].connected || - (i == 0 && Settings::values.players.GetValue()[8].connected); - player_connected[i]->setChecked(connected); + if (i == 0) { + auto* handheld = + system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); + if (handheld->IsConnected()) { + player_connected[i]->setChecked(true); + continue; + } + } + const auto* controller = system.HIDCore().GetEmulatedControllerByIndex(i); + player_connected[i]->setChecked(controller->IsConnected()); } } |
