summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-05-24 03:34:46 +0200
committergerman77 <juangerman-13@hotmail.com>2021-05-24 03:34:46 +0200
commit7f445a59fa7362615338bd93e5f57d84a594e181 (patch)
tree2c5b0cad6524593b83ea1d42a26f640b9a38746f
parentMerge pull request #6248 from A-w-x/intelmesa (diff)
downloadyuzu-7f445a59fa7362615338bd93e5f57d84a594e181.tar
yuzu-7f445a59fa7362615338bd93e5f57d84a594e181.tar.gz
yuzu-7f445a59fa7362615338bd93e5f57d84a594e181.tar.bz2
yuzu-7f445a59fa7362615338bd93e5f57d84a594e181.tar.lz
yuzu-7f445a59fa7362615338bd93e5f57d84a594e181.tar.xz
yuzu-7f445a59fa7362615338bd93e5f57d84a594e181.tar.zst
yuzu-7f445a59fa7362615338bd93e5f57d84a594e181.zip
Diffstat (limited to '')
-rw-r--r--src/yuzu/configuration/config.cpp7
-rw-r--r--src/yuzu/debugger/controller.cpp1
-rw-r--r--src/yuzu/main.cpp20
3 files changed, 24 insertions, 4 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 125feb86b..21d1dc174 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -514,6 +514,13 @@ void Config::ReadControlValues() {
ReadSetting(QStringLiteral("mouse_panning_sensitivity"), 1).toFloat();
ReadSettingGlobal(Settings::values.use_docked_mode, QStringLiteral("use_docked_mode"), true);
+
+ // Disable docked mode if handheld is selected
+ const auto controller_type = Settings::values.players.GetValue()[0].controller_type;
+ if (controller_type == Settings::ControllerType::Handheld) {
+ Settings::values.use_docked_mode.SetValue(false);
+ }
+
ReadSettingGlobal(Settings::values.vibration_enabled, QStringLiteral("vibration_enabled"),
true);
ReadSettingGlobal(Settings::values.enable_accurate_vibrations,
diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp
index 7186eac76..d85408ac6 100644
--- a/src/yuzu/debugger/controller.cpp
+++ b/src/yuzu/debugger/controller.cpp
@@ -38,6 +38,7 @@ void ControllerDialog::refreshConfiguration() {
widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs);
widget->SetConnectedStatus(players[player].connected);
widget->SetControllerType(players[player].controller_type);
+ widget->repaint();
}
QAction* ControllerDialog::toggleViewAction() {
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 9275cba53..bc97f9d53 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -773,10 +773,22 @@ void GMainWindow::InitializeWidgets() {
dock_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
dock_status_button->setFocusPolicy(Qt::NoFocus);
connect(dock_status_button, &QPushButton::clicked, [&] {
- Settings::values.use_docked_mode.SetValue(!Settings::values.use_docked_mode.GetValue());
- dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue());
- OnDockedModeChanged(!Settings::values.use_docked_mode.GetValue(),
- Settings::values.use_docked_mode.GetValue());
+ const bool is_docked = Settings::values.use_docked_mode.GetValue();
+ auto& controller_type = Settings::values.players.GetValue()[0].controller_type;
+
+ if (!is_docked && controller_type == Settings::ControllerType::Handheld) {
+ QMessageBox::warning(this, tr("Invalid config detected"),
+ tr("Handheld controller can't be used on docked mode. Pro "
+ "controller will be selected."));
+ controller_type = Settings::ControllerType::ProController;
+ ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get());
+ configure_dialog.ApplyConfiguration();
+ controller_dialog->refreshConfiguration();
+ }
+
+ Settings::values.use_docked_mode.SetValue(!is_docked);
+ dock_status_button->setChecked(!is_docked);
+ OnDockedModeChanged(is_docked, !is_docked);
});
dock_status_button->setText(tr("DOCK"));
dock_status_button->setCheckable(true);