diff options
| author | 2020-08-27 23:38:26 -0400 | |
|---|---|---|
| committer | 2020-09-04 12:23:25 -0400 | |
| commit | 371226448a93d0553ded77750eaccbffa4a799e4 (patch) | |
| tree | 85d13b6716e43d0bae463a6aff409a5ea5b50b5d /src/core/frontend/applets/controller.cpp | |
| parent | main: Apply settings after applet configuration is complete. (diff) | |
| download | yuzu-371226448a93d0553ded77750eaccbffa4a799e4.tar.gz yuzu-371226448a93d0553ded77750eaccbffa4a799e4.tar.xz yuzu-371226448a93d0553ded77750eaccbffa4a799e4.zip | |
applets/controller: Modify heuristic to account for certain games
Now left and right joycons have the same priority (meaning both needs to be supported by the game).
Explanation of the new heuristic:
Assign left joycons to even player indices and right joycons to odd player indices.
We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and a right Joycon for Player 2 in 2 Player Assist mode.
Diffstat (limited to 'src/core/frontend/applets/controller.cpp')
| -rw-r--r-- | src/core/frontend/applets/controller.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp index 34eacbb45..715d9fffd 100644 --- a/src/core/frontend/applets/controller.cpp +++ b/src/core/frontend/applets/controller.cpp | |||
| @@ -44,19 +44,24 @@ void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callb | |||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | // Connect controllers based on the following priority list from highest to lowest priority: | 46 | // Connect controllers based on the following priority list from highest to lowest priority: |
| 47 | // Pro Controller -> Dual Joycons -> Left Joycon -> Right Joycon -> Handheld | 47 | // Pro Controller -> Dual Joycons -> Left Joycon/Right Joycon -> Handheld |
| 48 | if (parameters.allow_pro_controller) { | 48 | if (parameters.allow_pro_controller) { |
| 49 | npad.AddNewControllerAt( | 49 | npad.AddNewControllerAt( |
| 50 | npad.MapSettingsTypeToNPad(Settings::ControllerType::ProController), index); | 50 | npad.MapSettingsTypeToNPad(Settings::ControllerType::ProController), index); |
| 51 | } else if (parameters.allow_dual_joycons) { | 51 | } else if (parameters.allow_dual_joycons) { |
| 52 | npad.AddNewControllerAt( | 52 | npad.AddNewControllerAt( |
| 53 | npad.MapSettingsTypeToNPad(Settings::ControllerType::DualJoyconDetached), index); | 53 | npad.MapSettingsTypeToNPad(Settings::ControllerType::DualJoyconDetached), index); |
| 54 | } else if (parameters.allow_left_joycon) { | 54 | } else if (parameters.allow_left_joycon && parameters.allow_right_joycon) { |
| 55 | npad.AddNewControllerAt( | 55 | // Assign left joycons to even player indices and right joycons to odd player indices. |
| 56 | npad.MapSettingsTypeToNPad(Settings::ControllerType::LeftJoycon), index); | 56 | // We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and |
| 57 | } else if (parameters.allow_right_joycon) { | 57 | // a right Joycon for Player 2 in 2 Player Assist mode. |
| 58 | npad.AddNewControllerAt( | 58 | if (index % 2 == 0) { |
| 59 | npad.MapSettingsTypeToNPad(Settings::ControllerType::RightJoycon), index); | 59 | npad.AddNewControllerAt( |
| 60 | npad.MapSettingsTypeToNPad(Settings::ControllerType::LeftJoycon), index); | ||
| 61 | } else { | ||
| 62 | npad.AddNewControllerAt( | ||
| 63 | npad.MapSettingsTypeToNPad(Settings::ControllerType::RightJoycon), index); | ||
| 64 | } | ||
| 60 | } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld && | 65 | } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld && |
| 61 | !Settings::values.use_docked_mode) { | 66 | !Settings::values.use_docked_mode) { |
| 62 | // We should *never* reach here under any normal circumstances. | 67 | // We should *never* reach here under any normal circumstances. |