summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/yuzu/debugger/controller.cpp16
-rw-r--r--src/yuzu/debugger/controller.h3
-rw-r--r--src/yuzu/main.cpp7
-rw-r--r--src/yuzu/main.h2
4 files changed, 18 insertions, 10 deletions
diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp
index 23834f063..85724a8f3 100644
--- a/src/yuzu/debugger/controller.cpp
+++ b/src/yuzu/debugger/controller.cpp
@@ -18,12 +18,8 @@ ControllerDialog::ControllerDialog(QWidget* parent) : QWidget(parent, Qt::Dialog
18 setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) | 18 setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) |
19 Qt::WindowMaximizeButtonHint); 19 Qt::WindowMaximizeButtonHint);
20 20
21 PlayerControlPreview* widget = new PlayerControlPreview(this); 21 widget = new PlayerControlPreview(this);
22 const auto& players = Settings::values.players.GetValue(); 22 refreshConfiguration();
23 constexpr std::size_t player = 0;
24 widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs);
25 widget->SetConnectedStatus(players[player].connected);
26 widget->SetControllerType(players[player].controller_type);
27 QLayout* layout = new QVBoxLayout(this); 23 QLayout* layout = new QVBoxLayout(this);
28 layout->setContentsMargins(0, 0, 0, 0); 24 layout->setContentsMargins(0, 0, 0, 0);
29 layout->addWidget(widget); 25 layout->addWidget(widget);
@@ -36,6 +32,14 @@ ControllerDialog::ControllerDialog(QWidget* parent) : QWidget(parent, Qt::Dialog
36 widget->setFocus(); 32 widget->setFocus();
37} 33}
38 34
35void ControllerDialog::refreshConfiguration() {
36 const auto& players = Settings::values.players.GetValue();
37 constexpr std::size_t player = 0;
38 widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs);
39 widget->SetConnectedStatus(players[player].connected);
40 widget->SetControllerType(players[player].controller_type);
41}
42
39QAction* ControllerDialog::toggleViewAction() { 43QAction* ControllerDialog::toggleViewAction() {
40 if (toggle_view_action == nullptr) { 44 if (toggle_view_action == nullptr) {
41 toggle_view_action = new QAction(windowTitle(), this); 45 toggle_view_action = new QAction(windowTitle(), this);
diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h
index da389b6a2..c54750070 100644
--- a/src/yuzu/debugger/controller.h
+++ b/src/yuzu/debugger/controller.h
@@ -9,6 +9,7 @@
9class QAction; 9class QAction;
10class QHideEvent; 10class QHideEvent;
11class QShowEvent; 11class QShowEvent;
12class PlayerControlPreview;
12 13
13class ControllerDialog : public QWidget { 14class ControllerDialog : public QWidget {
14 Q_OBJECT 15 Q_OBJECT
@@ -18,6 +19,7 @@ public:
18 19
19 /// Returns a QAction that can be used to toggle visibility of this dialog. 20 /// Returns a QAction that can be used to toggle visibility of this dialog.
20 QAction* toggleViewAction(); 21 QAction* toggleViewAction();
22 void refreshConfiguration();
21 23
22protected: 24protected:
23 void showEvent(QShowEvent* ev) override; 25 void showEvent(QShowEvent* ev) override;
@@ -25,4 +27,5 @@ protected:
25 27
26private: 28private:
27 QAction* toggle_view_action = nullptr; 29 QAction* toggle_view_action = nullptr;
30 PlayerControlPreview* widget;
28}; 31};
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index f6f902fab..ef92c25bc 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -690,9 +690,9 @@ void GMainWindow::InitializeDebugWidgets() {
690 waitTreeWidget->hide(); 690 waitTreeWidget->hide();
691 debug_menu->addAction(waitTreeWidget->toggleViewAction()); 691 debug_menu->addAction(waitTreeWidget->toggleViewAction());
692 692
693 controllerDialog = new ControllerDialog(this); 693 controller_dialog = new ControllerDialog(this);
694 controllerDialog->hide(); 694 controller_dialog->hide();
695 debug_menu->addAction(controllerDialog->toggleViewAction()); 695 debug_menu->addAction(controller_dialog->toggleViewAction());
696 696
697 connect(this, &GMainWindow::EmulationStarting, waitTreeWidget, 697 connect(this, &GMainWindow::EmulationStarting, waitTreeWidget,
698 &WaitTreeWidget::OnEmulationStarting); 698 &WaitTreeWidget::OnEmulationStarting);
@@ -2342,6 +2342,7 @@ void GMainWindow::OnConfigure() {
2342 } 2342 }
2343 2343
2344 configure_dialog.ApplyConfiguration(); 2344 configure_dialog.ApplyConfiguration();
2345 controller_dialog->refreshConfiguration();
2345 InitializeHotkeys(); 2346 InitializeHotkeys();
2346 if (UISettings::values.theme != old_theme) { 2347 if (UISettings::values.theme != old_theme) {
2347 UpdateUITheme(); 2348 UpdateUITheme();
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index f4a71ea11..04d37d4ae 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -314,7 +314,7 @@ private:
314 ProfilerWidget* profilerWidget; 314 ProfilerWidget* profilerWidget;
315 MicroProfileDialog* microProfileDialog; 315 MicroProfileDialog* microProfileDialog;
316 WaitTreeWidget* waitTreeWidget; 316 WaitTreeWidget* waitTreeWidget;
317 ControllerDialog* controllerDialog; 317 ControllerDialog* controller_dialog;
318 318
319 QAction* actions_recent_files[max_recent_files_item]; 319 QAction* actions_recent_files[max_recent_files_item];
320 320