mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-25 15:37:51 -05:00
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 <kupfel@gmail.com>
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -2329,11 +2329,11 @@
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="vibrationSpin">
|
||||
<widget class="QPushButton" name="vibrationButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>68</width>
|
||||
<height>21</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
@ -2342,17 +2342,11 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">min-width: 68px;</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Reference in New Issue
Block a user