summaryrefslogtreecommitdiff
path: root/src/yuzu/applets/controller.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-11-25 11:20:46 -0800
committerGitHub <noreply@github.com>2020-11-25 11:20:46 -0800
commitdcfa1992ea5fa450b64a75503ba487fba401e757 (patch)
tree68adf47f034e256d19985aed5e578fb0b91d27d9 /src/yuzu/applets/controller.h
parentb7f1095980d614842f6264667d9ddd38186d57ff (diff)
parent8758378dc40e65239db9a1212e123c86200a3bdc (diff)
Merge pull request #4959 from Morph1984/emulated-controller-styleset
configure_input_player: Use the NpadStyleSet to limit the available controllers shown
Diffstat (limited to 'src/yuzu/applets/controller.h')
-rw-r--r--src/yuzu/applets/controller.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h
index 4344e1dd0..7a421d856 100644
--- a/src/yuzu/applets/controller.h
+++ b/src/yuzu/applets/controller.h
@@ -22,6 +22,10 @@ namespace InputCommon {
class InputSubsystem;
}
+namespace Settings {
+enum class ControllerType;
+}
+
namespace Ui {
class QtControllerSelectorDialog;
}
@@ -57,6 +61,15 @@ private:
// Sets the controller icons for "Supported Controller Types".
void SetSupportedControllers();
+ // Sets the emulated controllers per player.
+ void SetEmulatedControllers(std::size_t player_index);
+
+ // Gets the Controller Type for a given controller combobox index per player.
+ Settings::ControllerType GetControllerTypeFromIndex(int index, std::size_t player_index) const;
+
+ // Gets the controller combobox index for a given Controller Type per player.
+ int GetIndexFromControllerType(Settings::ControllerType type, std::size_t player_index) const;
+
// Updates the controller icons per player.
void UpdateControllerIcon(std::size_t player_index);
@@ -114,6 +127,10 @@ private:
// Comboboxes with a list of emulated controllers per player.
std::array<QComboBox*, NUM_PLAYERS> emulated_controllers;
+ /// Pairs of emulated controller index and Controller Type enum per player.
+ std::array<std::vector<std::pair<int, Settings::ControllerType>>, NUM_PLAYERS>
+ index_controller_type_pairs;
+
// Labels representing the number of connected controllers
// above the "Connected Controllers" checkboxes.
std::array<QLabel*, NUM_PLAYERS> connected_controller_labels;