diff options
Diffstat (limited to 'src/core/frontend/applets/controller.cpp')
| -rw-r--r-- | src/core/frontend/applets/controller.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp index 03bbedf8b..ca1edce15 100644 --- a/src/core/frontend/applets/controller.cpp +++ b/src/core/frontend/applets/controller.cpp | |||
| @@ -49,26 +49,31 @@ void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callb | |||
| 49 | // Connect controllers based on the following priority list from highest to lowest priority: | 49 | // Connect controllers based on the following priority list from highest to lowest priority: |
| 50 | // Pro Controller -> Dual Joycons -> Left Joycon/Right Joycon -> Handheld | 50 | // Pro Controller -> Dual Joycons -> Left Joycon/Right Joycon -> Handheld |
| 51 | if (parameters.allow_pro_controller) { | 51 | if (parameters.allow_pro_controller) { |
| 52 | npad.AddNewControllerAt( | 52 | npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad( |
| 53 | npad.MapSettingsTypeToNPad(Settings::ControllerType::ProController), index); | 53 | Settings::ControllerType::ProController), |
| 54 | index); | ||
| 54 | } else if (parameters.allow_dual_joycons) { | 55 | } else if (parameters.allow_dual_joycons) { |
| 55 | npad.AddNewControllerAt( | 56 | npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad( |
| 56 | npad.MapSettingsTypeToNPad(Settings::ControllerType::DualJoyconDetached), index); | 57 | Settings::ControllerType::DualJoyconDetached), |
| 58 | index); | ||
| 57 | } else if (parameters.allow_left_joycon && parameters.allow_right_joycon) { | 59 | } else if (parameters.allow_left_joycon && parameters.allow_right_joycon) { |
| 58 | // Assign left joycons to even player indices and right joycons to odd player indices. | 60 | // Assign left joycons to even player indices and right joycons to odd player indices. |
| 59 | // We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and | 61 | // We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and |
| 60 | // a right Joycon for Player 2 in 2 Player Assist mode. | 62 | // a right Joycon for Player 2 in 2 Player Assist mode. |
| 61 | if (index % 2 == 0) { | 63 | if (index % 2 == 0) { |
| 62 | npad.AddNewControllerAt( | 64 | npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad( |
| 63 | npad.MapSettingsTypeToNPad(Settings::ControllerType::LeftJoycon), index); | 65 | Settings::ControllerType::LeftJoycon), |
| 66 | index); | ||
| 64 | } else { | 67 | } else { |
| 65 | npad.AddNewControllerAt( | 68 | npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad( |
| 66 | npad.MapSettingsTypeToNPad(Settings::ControllerType::RightJoycon), index); | 69 | Settings::ControllerType::RightJoycon), |
| 70 | index); | ||
| 67 | } | 71 | } |
| 68 | } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld && | 72 | } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld && |
| 69 | !Settings::values.use_docked_mode.GetValue()) { | 73 | !Settings::values.use_docked_mode.GetValue()) { |
| 70 | // We should *never* reach here under any normal circumstances. | 74 | // We should *never* reach here under any normal circumstances. |
| 71 | npad.AddNewControllerAt(npad.MapSettingsTypeToNPad(Settings::ControllerType::Handheld), | 75 | npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad( |
| 76 | Settings::ControllerType::Handheld), | ||
| 72 | index); | 77 | index); |
| 73 | } else { | 78 | } else { |
| 74 | UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!"); | 79 | UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!"); |