From 6b5f56532451631b63a57ca858dabc111b05711b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 26 Oct 2020 19:36:58 -0400 Subject: controller: Pass ControllerParameters by reference in ReconfigureControllers() Prevents unnecessary copies and heap reallocations from occurring. --- src/yuzu/applets/controller.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/yuzu/applets/controller.h') diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h index 2d6d588c6..729ecc831 100644 --- a/src/yuzu/applets/controller.h +++ b/src/yuzu/applets/controller.h @@ -120,11 +120,13 @@ public: explicit QtControllerSelector(GMainWindow& parent); ~QtControllerSelector() override; - void ReconfigureControllers(std::function callback, - Core::Frontend::ControllerParameters parameters) const override; + void ReconfigureControllers( + std::function callback, + const Core::Frontend::ControllerParameters& parameters) const override; signals: - void MainWindowReconfigureControllers(Core::Frontend::ControllerParameters parameters) const; + void MainWindowReconfigureControllers( + const Core::Frontend::ControllerParameters& parameters) const; private: void MainWindowReconfigureFinished(); -- cgit v1.2.3 From 5cafa70d3b7f24881b578d2d473dc993fc47364b Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 27 Sep 2020 11:18:07 -0400 Subject: applets/controller: Auto accept a valid single player configuration --- src/yuzu/applets/controller.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/yuzu/applets/controller.h') diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h index 729ecc831..8fefecf05 100644 --- a/src/yuzu/applets/controller.h +++ b/src/yuzu/applets/controller.h @@ -33,6 +33,8 @@ public: InputCommon::InputSubsystem* input_subsystem_); ~QtControllerSelectorDialog() override; + int exec() override; + private: // Applies the current configuration. void ApplyConfiguration(); @@ -43,9 +45,9 @@ private: // Initializes the "Configure Input" Dialog. void CallConfigureInputDialog(); - // Checks the current configuration against the given parameters and - // sets the value of parameters_met. - void CheckIfParametersMet(); + // Checks the current configuration against the given parameters. + // This sets and returns the value of parameters_met. + bool CheckIfParametersMet(); // Sets the controller icons for "Supported Controller Types". void SetSupportedControllers(); -- cgit v1.2.3 From 38110dd485e329fa39e2e4c02b91a89dfebcbc88 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sat, 17 Oct 2020 09:38:12 -0400 Subject: configure_input: Add per-player vibration Allows for enabling and modifying vibration and vibration strength per player. Also adds a toggle for enabling/disabling accurate vibrations. Co-authored-by: Its-Rei --- src/yuzu/applets/controller.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/yuzu/applets/controller.h') diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h index 8fefecf05..a2ce03c8f 100644 --- a/src/yuzu/applets/controller.h +++ b/src/yuzu/applets/controller.h @@ -42,6 +42,9 @@ private: // Loads the current input configuration into the frontend applet. void LoadConfiguration(); + // Initializes the "Configure Vibration" Dialog. + void CallConfigureVibrationDialog(); + // Initializes the "Configure Input" Dialog. void CallConfigureInputDialog(); -- cgit v1.2.3 From 760a9e869322cbda51416f7001842557b90754af Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Mon, 26 Oct 2020 03:28:03 -0400 Subject: applets/controller: Change the input button to create input profiles Co-authored-by: Its-Rei --- src/yuzu/applets/controller.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/yuzu/applets/controller.h') diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h index a2ce03c8f..4344e1dd0 100644 --- a/src/yuzu/applets/controller.h +++ b/src/yuzu/applets/controller.h @@ -16,6 +16,8 @@ class QDialogButtonBox; class QGroupBox; class QLabel; +class InputProfiles; + namespace InputCommon { class InputSubsystem; } @@ -45,8 +47,8 @@ private: // Initializes the "Configure Vibration" Dialog. void CallConfigureVibrationDialog(); - // Initializes the "Configure Input" Dialog. - void CallConfigureInputDialog(); + // Initializes the "Create Input Profile" Dialog. + void CallConfigureInputProfileDialog(); // Checks the current configuration against the given parameters. // This sets and returns the value of parameters_met. @@ -83,6 +85,8 @@ private: InputCommon::InputSubsystem* input_subsystem; + std::unique_ptr input_profiles; + // This is true if and only if all parameters are met. Otherwise, this is false. // This determines whether the "OK" button can be clicked to exit the applet. bool parameters_met{false}; -- cgit v1.2.3 From 8758378dc40e65239db9a1212e123c86200a3bdc Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Fri, 20 Nov 2020 11:04:27 -0500 Subject: applets/controller: Use a pair of emulated controller index to controller type --- src/yuzu/applets/controller.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/yuzu/applets/controller.h') 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 emulated_controllers; + /// Pairs of emulated controller index and Controller Type enum per player. + std::array>, NUM_PLAYERS> + index_controller_type_pairs; + // Labels representing the number of connected controllers // above the "Connected Controllers" checkboxes. std::array connected_controller_labels; -- cgit v1.2.3 From f6d4a289d53516789ceb5f90f086ffe8b2822115 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sat, 5 Dec 2020 08:37:13 -0500 Subject: applets: Resolve variable shadowing --- src/yuzu/applets/controller.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/applets/controller.h') diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h index 7a421d856..3518eed56 100644 --- a/src/yuzu/applets/controller.h +++ b/src/yuzu/applets/controller.h @@ -147,7 +147,7 @@ public: ~QtControllerSelector() override; void ReconfigureControllers( - std::function callback, + std::function callback_, const Core::Frontend::ControllerParameters& parameters) const override; signals: -- cgit v1.2.3