Merge pull request #6353 from german77/handheld_docked
settings: Forbid docked mode on handheld
This commit is contained in:
commit
4bf53eb935
|
@ -514,6 +514,13 @@ void Config::ReadControlValues() {
|
||||||
ReadSetting(QStringLiteral("mouse_panning_sensitivity"), 1).toFloat();
|
ReadSetting(QStringLiteral("mouse_panning_sensitivity"), 1).toFloat();
|
||||||
|
|
||||||
ReadSettingGlobal(Settings::values.use_docked_mode, QStringLiteral("use_docked_mode"), true);
|
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"),
|
ReadSettingGlobal(Settings::values.vibration_enabled, QStringLiteral("vibration_enabled"),
|
||||||
true);
|
true);
|
||||||
ReadSettingGlobal(Settings::values.enable_accurate_vibrations,
|
ReadSettingGlobal(Settings::values.enable_accurate_vibrations,
|
||||||
|
|
|
@ -38,6 +38,7 @@ void ControllerDialog::refreshConfiguration() {
|
||||||
widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs);
|
widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs);
|
||||||
widget->SetConnectedStatus(players[player].connected);
|
widget->SetConnectedStatus(players[player].connected);
|
||||||
widget->SetControllerType(players[player].controller_type);
|
widget->SetControllerType(players[player].controller_type);
|
||||||
|
widget->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction* ControllerDialog::toggleViewAction() {
|
QAction* ControllerDialog::toggleViewAction() {
|
||||||
|
|
|
@ -773,10 +773,22 @@ void GMainWindow::InitializeWidgets() {
|
||||||
dock_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
dock_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
||||||
dock_status_button->setFocusPolicy(Qt::NoFocus);
|
dock_status_button->setFocusPolicy(Qt::NoFocus);
|
||||||
connect(dock_status_button, &QPushButton::clicked, [&] {
|
connect(dock_status_button, &QPushButton::clicked, [&] {
|
||||||
Settings::values.use_docked_mode.SetValue(!Settings::values.use_docked_mode.GetValue());
|
const bool is_docked = Settings::values.use_docked_mode.GetValue();
|
||||||
dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue());
|
auto& controller_type = Settings::values.players.GetValue()[0].controller_type;
|
||||||
OnDockedModeChanged(!Settings::values.use_docked_mode.GetValue(),
|
|
||||||
Settings::values.use_docked_mode.GetValue());
|
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->setText(tr("DOCK"));
|
||||||
dock_status_button->setCheckable(true);
|
dock_status_button->setCheckable(true);
|
||||||
|
|
Loading…
Reference in New Issue