diff options
| author | bunnei <bunneidev@gmail.com> | 2018-11-27 18:38:12 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-27 18:38:12 -0500 |
| commit | e89a3b9e59ec6daebaf4ce112eaa2d5761bcdd42 (patch) | |
| tree | 2b10a5e3cf0eacdb86fa3d11a06353f1abe61ad0 /src/yuzu/configuration/configure_input_player.h | |
| parent | 71dfe4a7ae9308916504f1d89b3e4900e0548b35 (diff) | |
| parent | 2a22c1b27e01f43395d035ebc017df4ba088a67c (diff) | |
Merge pull request #1811 from lioncash/input
yuzu/input: Minor changes
Diffstat (limited to 'src/yuzu/configuration/configure_input_player.h')
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.h | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index b0e5550c5..7a53f6715 100644 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h @@ -9,9 +9,10 @@ #include <memory> #include <optional> #include <string> -#include <unordered_map> + #include <QDialog> #include <QKeyEvent> + #include "common/param_package.h" #include "core/settings.h" #include "input_common/main.h" @@ -29,16 +30,39 @@ class ConfigureInputPlayer : public QDialog { Q_OBJECT public: - explicit ConfigureInputPlayer(QWidget* parent, u8 player_index, bool debug = false); + explicit ConfigureInputPlayer(QWidget* parent, std::size_t player_index, bool debug = false); ~ConfigureInputPlayer() override; /// Save all button configurations to settings file void applyConfiguration(); private: + void OnControllerButtonClick(int i); + + /// Load configuration settings. + void loadConfiguration(); + /// Restore all buttons to their default values. + void restoreDefaults(); + /// Clear all input configuration + void ClearAll(); + + /// Update UI to reflect current configuration. + void updateButtonLabels(); + + /// Called when the button was pressed. + void handleClick(QPushButton* button, + std::function<void(const Common::ParamPackage&)> new_input_setter, + InputCommon::Polling::DeviceType type); + + /// Finish polling and configure input using the input_setter + void setPollingResult(const Common::ParamPackage& params, bool abort); + + /// Handle key press events. + void keyPressEvent(QKeyEvent* event) override; + std::unique_ptr<Ui::ConfigureInputPlayer> ui; - u8 player_index; + std::size_t player_index; bool debug; std::unique_ptr<QTimer> timeout_timer; @@ -77,27 +101,4 @@ private: std::array<QPushButton*, 4> controller_color_buttons; std::array<QColor, 4> controller_colors; - - void OnControllerButtonClick(int i); - - /// Load configuration settings. - void loadConfiguration(); - /// Restore all buttons to their default values. - void restoreDefaults(); - /// Clear all input configuration - void ClearAll(); - - /// Update UI to reflect current configuration. - void updateButtonLabels(); - - /// Called when the button was pressed. - void handleClick(QPushButton* button, - std::function<void(const Common::ParamPackage&)> new_input_setter, - InputCommon::Polling::DeviceType type); - - /// Finish polling and configure input using the input_setter - void setPollingResult(const Common::ParamPackage& params, bool abort); - - /// Handle key press events. - void keyPressEvent(QKeyEvent* event) override; }; |
