summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-01-21 02:05:44 +0100
committerGitHub <noreply@github.com>2021-01-21 02:05:44 +0100
commitd98b0f8f48e1412b140ec70181893c718704eb10 (patch)
treeca12e0ef95b67153d6b00ff21988af0540c0a7f2 /src
parentMerge pull request #5755 from FearlessTobi/port-5344 (diff)
parentAlways update configuration for handheld (diff)
downloadyuzu-d98b0f8f48e1412b140ec70181893c718704eb10.tar
yuzu-d98b0f8f48e1412b140ec70181893c718704eb10.tar.gz
yuzu-d98b0f8f48e1412b140ec70181893c718704eb10.tar.bz2
yuzu-d98b0f8f48e1412b140ec70181893c718704eb10.tar.lz
yuzu-d98b0f8f48e1412b140ec70181893c718704eb10.tar.xz
yuzu-d98b0f8f48e1412b140ec70181893c718704eb10.tar.zst
yuzu-d98b0f8f48e1412b140ec70181893c718704eb10.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/config.cpp3
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp10
2 files changed, 12 insertions, 1 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index cda448718..9f73d37d4 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -1005,7 +1005,8 @@ void Config::SavePlayerValue(std::size_t player_index) {
static_cast<u8>(Settings::ControllerType::ProController));
if (!player_prefix.isEmpty()) {
- WriteSetting(QStringLiteral("%1connected").arg(player_prefix), player.connected, false);
+ WriteSetting(QStringLiteral("%1connected").arg(player_prefix), player.connected,
+ player_index == 0);
WriteSetting(QStringLiteral("%1vibration_enabled").arg(player_prefix),
player.vibration_enabled, true);
WriteSetting(QStringLiteral("%1vibration_strength").arg(player_prefix),
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index 46ea026e4..13f0351d4 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -575,6 +575,16 @@ void ConfigureInputPlayer::ApplyConfiguration() {
std::transform(motions_param.begin(), motions_param.end(), motions.begin(),
[](const Common::ParamPackage& param) { return param.Serialize(); });
+
+ // Apply configuration for handheld
+ if (player_index == 0) {
+ auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX];
+ if (player.controller_type == Settings::ControllerType::Handheld) {
+ handheld = player;
+ }
+ handheld.connected = ui->groupConnectedController->isChecked() &&
+ player.controller_type == Settings::ControllerType::Handheld;
+ }
}
void ConfigureInputPlayer::TryConnectSelectedController() {