Merge pull request #5743 from german77/HandheldFix

Fix player 1 turning on handheld and not updating handheld settings
This commit is contained in:
bunnei 2021-01-20 17:05:44 -08:00 committed by GitHub
commit d98b0f8f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -1005,7 +1005,8 @@ void Config::SavePlayerValue(std::size_t player_index) {
static_cast<u8>(Settings::ControllerType::ProController)); static_cast<u8>(Settings::ControllerType::ProController));
if (!player_prefix.isEmpty()) { 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), WriteSetting(QStringLiteral("%1vibration_enabled").arg(player_prefix),
player.vibration_enabled, true); player.vibration_enabled, true);
WriteSetting(QStringLiteral("%1vibration_strength").arg(player_prefix), WriteSetting(QStringLiteral("%1vibration_strength").arg(player_prefix),

View File

@ -575,6 +575,16 @@ void ConfigureInputPlayer::ApplyConfiguration() {
std::transform(motions_param.begin(), motions_param.end(), motions.begin(), std::transform(motions_param.begin(), motions_param.end(), motions.begin(),
[](const Common::ParamPackage& param) { return param.Serialize(); }); [](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() { void ConfigureInputPlayer::TryConnectSelectedController() {