diff options
author | german77 <juangerman-13@hotmail.com> | 2021-10-15 19:07:47 -0500 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2021-11-24 20:30:24 -0600 |
commit | e0da5c1bbcdf85676f968b63c8ae2587f0464193 (patch) | |
tree | 588837d1181d6b9d3bd4536fd4d2c5877335632d /src/yuzu/debugger | |
parent | 06a5ef5874144a70e30e577a83ba68d1dad79e78 (diff) |
kraken: Fix errors from rebase and format files
Diffstat (limited to 'src/yuzu/debugger')
-rw-r--r-- | src/yuzu/debugger/controller.cpp | 9 | ||||
-rw-r--r-- | src/yuzu/debugger/controller.h | 9 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp index d8e41f8b6..3619aed26 100644 --- a/src/yuzu/debugger/controller.cpp +++ b/src/yuzu/debugger/controller.cpp @@ -10,7 +10,8 @@ #include "yuzu/configuration/configure_input_player_widget.h" #include "yuzu/debugger/controller.h" -ControllerDialog::ControllerDialog(QWidget* parent) : QWidget(parent, Qt::Dialog) { +ControllerDialog::ControllerDialog(Core::System& system, QWidget* parent) + : QWidget(parent, Qt::Dialog) { setObjectName(QStringLiteral("Controller")); setWindowTitle(tr("Controller P1")); resize(500, 350); @@ -20,7 +21,7 @@ ControllerDialog::ControllerDialog(QWidget* parent) : QWidget(parent, Qt::Dialog Qt::WindowMaximizeButtonHint); widget = new PlayerControlPreview(this); - widget->SetController(Core::System::GetInstance().HIDCore().GetEmulatedController( + widget->SetController(system.HIDCore().GetEmulatedController( Core::HID::NpadIdType::Player1)); QLayout* layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); @@ -45,6 +46,10 @@ QAction* ControllerDialog::toggleViewAction() { return toggle_view_action; } +void ControllerDialog::UnloadController() { + widget->UnloadController(); +} + void ControllerDialog::showEvent(QShowEvent* ev) { if (toggle_view_action) { toggle_view_action->setChecked(isVisible()); diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h index 697489cbb..33f617b9b 100644 --- a/src/yuzu/debugger/controller.h +++ b/src/yuzu/debugger/controller.h @@ -11,6 +11,10 @@ class QHideEvent; class QShowEvent; class PlayerControlPreview; +namespace Core { +class System; +} + namespace InputCommon { class InputSubsystem; } @@ -19,11 +23,14 @@ class ControllerDialog : public QWidget { Q_OBJECT public: - explicit ControllerDialog(QWidget* parent = nullptr); + explicit ControllerDialog(Core::System& system, QWidget* parent = nullptr); /// Returns a QAction that can be used to toggle visibility of this dialog. QAction* toggleViewAction(); + // Disables events from the emulated controller + void UnloadController(); + protected: void showEvent(QShowEvent* ev) override; void hideEvent(QHideEvent* ev) override; |