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.cpp | 16 ++++++++++++++++ src/yuzu/applets/controller.h | 3 +++ src/yuzu/applets/controller.ui | 18 ++++++------------ 3 files changed, 25 insertions(+), 12 deletions(-) (limited to 'src/yuzu/applets') diff --git a/src/yuzu/applets/controller.cpp b/src/yuzu/applets/controller.cpp index 0fc713a6e..c5e671309 100644 --- a/src/yuzu/applets/controller.cpp +++ b/src/yuzu/applets/controller.cpp @@ -14,6 +14,7 @@ #include "ui_controller.h" #include "yuzu/applets/controller.h" #include "yuzu/configuration/configure_input_dialog.h" +#include "yuzu/configuration/configure_vibration.h" #include "yuzu/main.h" namespace { @@ -223,6 +224,9 @@ QtControllerSelectorDialog::QtControllerSelectorDialog( } } + connect(ui->vibrationButton, &QPushButton::clicked, this, + &QtControllerSelectorDialog::CallConfigureVibrationDialog); + connect(ui->inputConfigButton, &QPushButton::clicked, this, &QtControllerSelectorDialog::CallConfigureInputDialog); @@ -285,6 +289,18 @@ void QtControllerSelectorDialog::LoadConfiguration() { ui->motionGroup->setChecked(Settings::values.motion_enabled.GetValue()); } +void QtControllerSelectorDialog::CallConfigureVibrationDialog() { + ConfigureVibration dialog(this); + + dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | + Qt::WindowSystemMenuHint); + dialog.setWindowModality(Qt::WindowModal); + + if (dialog.exec() == QDialog::Accepted) { + dialog.ApplyConfiguration(); + } +} + void QtControllerSelectorDialog::CallConfigureInputDialog() { const auto max_supported_players = parameters.enable_single_mode ? 1 : parameters.max_players; 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(); diff --git a/src/yuzu/applets/controller.ui b/src/yuzu/applets/controller.ui index cc27b8ef4..8e571ba8f 100644 --- a/src/yuzu/applets/controller.ui +++ b/src/yuzu/applets/controller.ui @@ -2329,11 +2329,11 @@ 3 - + 68 - 21 + 0 @@ -2342,17 +2342,11 @@ 16777215 - - % - - - 1 - - - 100 + + min-width: 68px; - - 100 + + Configure -- cgit v1.2.3