Compare commits

...

1 Commits

Author SHA1 Message Date
ameerj
4b3d6384b6 config: Always apply input profile's controller type 2022-11-13 18:51:45 -05:00

View File

@@ -195,28 +195,17 @@ void Config::ReadPlayerValue(std::size_t player_index) {
auto& player = Settings::values.players.GetValue()[player_index]; auto& player = Settings::values.players.GetValue()[player_index];
if (player_prefix.isEmpty()) {
const auto controller = static_cast<Settings::ControllerType>(
qt_config
->value(QStringLiteral("%1type").arg(player_prefix),
static_cast<u8>(Settings::ControllerType::ProController))
.toUInt());
if (controller == Settings::ControllerType::LeftJoycon ||
controller == Settings::ControllerType::RightJoycon) {
player.controller_type = controller;
}
} else {
player.connected =
ReadSetting(QStringLiteral("%1connected").arg(player_prefix), player_index == 0)
.toBool();
player.controller_type = static_cast<Settings::ControllerType>( player.controller_type = static_cast<Settings::ControllerType>(
qt_config qt_config
->value(QStringLiteral("%1type").arg(player_prefix), ->value(QStringLiteral("%1type").arg(player_prefix),
static_cast<u8>(Settings::ControllerType::ProController)) static_cast<u8>(Settings::ControllerType::ProController))
.toUInt()); .toUInt());
if (!player_prefix.isEmpty()) {
player.connected =
ReadSetting(QStringLiteral("%1connected").arg(player_prefix), player_index == 0)
.toBool();
player.vibration_enabled = player.vibration_enabled =
qt_config->value(QStringLiteral("%1vibration_enabled").arg(player_prefix), true) qt_config->value(QStringLiteral("%1vibration_enabled").arg(player_prefix), true)
.toBool(); .toBool();