mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
configure_input_player: Fix profile saving when using handheld controller type
This commit is contained in:
parent
3de05726eb
commit
4cbbf590e3
|
@ -1553,6 +1553,7 @@ void ConfigureInputPlayer::LoadProfile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureInputPlayer::SaveProfile() {
|
void ConfigureInputPlayer::SaveProfile() {
|
||||||
|
static constexpr size_t HANDHELD_INDEX = 8;
|
||||||
const QString profile_name = ui->comboProfiles->itemText(ui->comboProfiles->currentIndex());
|
const QString profile_name = ui->comboProfiles->itemText(ui->comboProfiles->currentIndex());
|
||||||
|
|
||||||
if (profile_name.isEmpty()) {
|
if (profile_name.isEmpty()) {
|
||||||
|
@ -1561,7 +1562,12 @@ void ConfigureInputPlayer::SaveProfile() {
|
||||||
|
|
||||||
ApplyConfiguration();
|
ApplyConfiguration();
|
||||||
|
|
||||||
if (!profiles->SaveProfile(profile_name.toStdString(), player_index)) {
|
// When we're in handheld mode, only the handheld emulated controller bindings are updated
|
||||||
|
const bool is_handheld = player_index == 0 && emulated_controller->GetNpadIdType() ==
|
||||||
|
Core::HID::NpadIdType::Handheld;
|
||||||
|
const auto profile_player_index = is_handheld ? HANDHELD_INDEX : player_index;
|
||||||
|
|
||||||
|
if (!profiles->SaveProfile(profile_name.toStdString(), profile_player_index)) {
|
||||||
QMessageBox::critical(this, tr("Save Input Profile"),
|
QMessageBox::critical(this, tr("Save Input Profile"),
|
||||||
tr("Failed to save the input profile \"%1\"").arg(profile_name));
|
tr("Failed to save the input profile \"%1\"").arg(profile_name));
|
||||||
UpdateInputProfiles();
|
UpdateInputProfiles();
|
||||||
|
|
Loading…
Reference in a new issue