From 460a2dbbd3a0413d71f5ab1e6609f801a839ffa1 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 23 Jul 2023 15:35:32 +1000 Subject: [PATCH] Qt: Add custom binding widget for GunCon2 --- pcsx2-qt/CMakeLists.txt | 1 + .../Settings/ControllerBindingWidgets.cpp | 6 + pcsx2-qt/Settings/USBBindingWidget_GunCon2.ui | 779 ++++++++++++++++++ pcsx2-qt/pcsx2-qt.vcxproj | 11 +- pcsx2-qt/pcsx2-qt.vcxproj.filters | 15 +- 5 files changed, 804 insertions(+), 8 deletions(-) create mode 100644 pcsx2-qt/Settings/USBBindingWidget_GunCon2.ui diff --git a/pcsx2-qt/CMakeLists.txt b/pcsx2-qt/CMakeLists.txt index 9128762519..91a61a66a7 100644 --- a/pcsx2-qt/CMakeLists.txt +++ b/pcsx2-qt/CMakeLists.txt @@ -134,6 +134,7 @@ target_sources(pcsx2-qt PRIVATE Settings/SettingsDialog.ui Settings/USBBindingWidget_DrivingForce.ui Settings/USBBindingWidget_GTForce.ui + Settings/USBBindingWidget_GunCon2.ui Debugger/CpuWidget.cpp Debugger/CpuWidget.h Debugger/CpuWidget.ui diff --git a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp index b9022de405..c6749608c9 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp +++ b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp @@ -38,6 +38,7 @@ #include "ui_USBBindingWidget_DrivingForce.h" #include "ui_USBBindingWidget_GTForce.h" +#include "ui_USBBindingWidget_GunCon2.h" ControllerBindingWidget::ControllerBindingWidget(QWidget* parent, ControllerSettingsDialog* dialog, u32 port) : QWidget(parent) @@ -1275,6 +1276,11 @@ USBBindingWidget* USBBindingWidget::createInstance( has_template = true; } } + else if (type == "guncon2") + { + Ui::USBBindingWidget_GunCon2().setupUi(widget); + has_template = true; + } if (has_template) widget->bindWidgets(bindings); diff --git a/pcsx2-qt/Settings/USBBindingWidget_GunCon2.ui b/pcsx2-qt/Settings/USBBindingWidget_GunCon2.ui new file mode 100644 index 0000000000..529ebaf848 --- /dev/null +++ b/pcsx2-qt/Settings/USBBindingWidget_GunCon2.ui @@ -0,0 +1,779 @@ + + + USBBindingWidget_GunCon2 + + + + 0 + 0 + 1000 + 400 + + + + + 0 + 0 + + + + + 1000 + 400 + + + + Form + + + + + + Buttons + + + + + + A + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + PushButton + + + + + + + + + + C + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + PushButton + + + + + + + + + + Start + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + PushButton + + + + + + + + + + Select + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + PushButton + + + + + + + + + + B + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + PushButton + + + + + + + + + + + + + D-Pad + + + + + + Down + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 125 + 0 + + + + + 125 + 16777215 + + + + PushButton + + + + + + + + + + Left + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 125 + 0 + + + + + 125 + 16777215 + + + + PushButton + + + + + + + + + + Up + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 125 + 0 + + + + + 125 + 16777215 + + + + PushButton + + + + + + + + + + Right + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 125 + 0 + + + + + 125 + 16777215 + + + + PushButton + + + + + + + + + + + + + Pointer Setup + + + + + + <p>By default, GunCon2 will use the mouse pointer. To use the mouse, you <strong>do not</strong> need to configure any bindings apart from the trigger and buttons.</p> + +<p>If you want to use a controller, or lightgun which simulates a controller instead of a mouse, then you should bind it to Relative Aiming. Otherwise, Relative Aiming should be <strong>left unbound</strong>.</p> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Relative Aiming + + + + + + Down + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + PushButton + + + + + + + + + + Left + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + PushButton + + + + + + + + + + Up + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + PushButton + + + + + + + + + + Right + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + PushButton + + + + + + + + + + + + + Trigger + + + + + + Trigger + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 125 + 0 + + + + + 125 + 16777215 + + + + PushButton + + + + + + + + + + Shoot Offscreen + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 125 + 0 + + + + + 125 + 16777215 + + + + PushButton + + + + + + + + + + Calibration Shot + + + + + + + 125 + 0 + + + + + 125 + 16777215 + + + + PushButton + + + + + + + Calibration shot is required to pass the setup screen in some games. + + + true + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + InputBindingWidget + QPushButton +
Settings/InputBindingWidget.h
+
+
+ + + + +
diff --git a/pcsx2-qt/pcsx2-qt.vcxproj b/pcsx2-qt/pcsx2-qt.vcxproj index 562bda532b..9c036502e3 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj +++ b/pcsx2-qt/pcsx2-qt.vcxproj @@ -374,6 +374,9 @@ + + Document + Document @@ -395,8 +398,12 @@ Document - - + + Document + + + Document + Document diff --git a/pcsx2-qt/pcsx2-qt.vcxproj.filters b/pcsx2-qt/pcsx2-qt.vcxproj.filters index 3cef1749b1..4d84ce1358 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj.filters +++ b/pcsx2-qt/pcsx2-qt.vcxproj.filters @@ -624,17 +624,20 @@ Settings + + Settings + + + Settings + + + Settings + Settings - - Settings - - - Settings -