diff options
| author | 2022-08-05 08:02:04 -0700 | |
|---|---|---|
| committer | 2022-08-05 10:02:04 -0500 | |
| commit | cd5bbf0f04696d6d44dae8c4a4e5f768a70019de (patch) | |
| tree | 31744b8c027d110ad1554bae85c410867efe0e89 /src | |
| parent | Merge pull request #8702 from liamwhite/format-swap (diff) | |
| download | yuzu-cd5bbf0f04696d6d44dae8c4a4e5f768a70019de.tar.gz yuzu-cd5bbf0f04696d6d44dae8c4a4e5f768a70019de.tar.xz yuzu-cd5bbf0f04696d6d44dae8c4a4e5f768a70019de.zip | |
Controller bugfixes in profile select (#8716)
* Controller bugfixes in profile select, closes #8265
2 fixes for using a controller in profile select dialog.
Pressing 'B' cancels the launch of the game
Using controller to select a profile now correctly sets the index to use for the launch
* Added brackets to if statements as requested.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/applets/qt_profile_select.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp index 826c6c224..c8bcfb223 100644 --- a/src/yuzu/applets/qt_profile_select.cpp +++ b/src/yuzu/applets/qt_profile_select.cpp | |||
| @@ -100,6 +100,7 @@ QtProfileSelectionDialog::QtProfileSelectionDialog(Core::HID::HIDCore& hid_core, | |||
| 100 | } | 100 | } |
| 101 | QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier); | 101 | QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier); |
| 102 | QCoreApplication::postEvent(tree_view, event); | 102 | QCoreApplication::postEvent(tree_view, event); |
| 103 | SelectUser(tree_view->currentIndex()); | ||
| 103 | }); | 104 | }); |
| 104 | 105 | ||
| 105 | const auto& profiles = profile_manager->GetAllUsers(); | 106 | const auto& profiles = profile_manager->GetAllUsers(); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f8c234082..dc7b343d9 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1588,17 +1588,18 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p | |||
| 1588 | return true; | 1588 | return true; |
| 1589 | } | 1589 | } |
| 1590 | 1590 | ||
| 1591 | void GMainWindow::SelectAndSetCurrentUser() { | 1591 | bool GMainWindow::SelectAndSetCurrentUser() { |
| 1592 | QtProfileSelectionDialog dialog(system->HIDCore(), this); | 1592 | QtProfileSelectionDialog dialog(system->HIDCore(), this); |
| 1593 | dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | | 1593 | dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | |
| 1594 | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); | 1594 | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); |
| 1595 | dialog.setWindowModality(Qt::WindowModal); | 1595 | dialog.setWindowModality(Qt::WindowModal); |
| 1596 | 1596 | ||
| 1597 | if (dialog.exec() == QDialog::Rejected) { | 1597 | if (dialog.exec() == QDialog::Rejected) { |
| 1598 | return; | 1598 | return false; |
| 1599 | } | 1599 | } |
| 1600 | 1600 | ||
| 1601 | Settings::values.current_user = dialog.GetIndex(); | 1601 | Settings::values.current_user = dialog.GetIndex(); |
| 1602 | return true; | ||
| 1602 | } | 1603 | } |
| 1603 | 1604 | ||
| 1604 | void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t program_index, | 1605 | void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t program_index, |
| @@ -1632,11 +1633,14 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t | |||
| 1632 | Settings::LogSettings(); | 1633 | Settings::LogSettings(); |
| 1633 | 1634 | ||
| 1634 | if (UISettings::values.select_user_on_boot) { | 1635 | if (UISettings::values.select_user_on_boot) { |
| 1635 | SelectAndSetCurrentUser(); | 1636 | if (SelectAndSetCurrentUser() == false) { |
| 1637 | return; | ||
| 1638 | } | ||
| 1636 | } | 1639 | } |
| 1637 | 1640 | ||
| 1638 | if (!LoadROM(filename, program_id, program_index)) | 1641 | if (!LoadROM(filename, program_id, program_index)) { |
| 1639 | return; | 1642 | return; |
| 1643 | } | ||
| 1640 | 1644 | ||
| 1641 | system->SetShuttingDown(false); | 1645 | system->SetShuttingDown(false); |
| 1642 | 1646 | ||
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 23b67a14e..e13b38b24 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -218,7 +218,7 @@ private: | |||
| 218 | void SetDiscordEnabled(bool state); | 218 | void SetDiscordEnabled(bool state); |
| 219 | void LoadAmiibo(const QString& filename); | 219 | void LoadAmiibo(const QString& filename); |
| 220 | 220 | ||
| 221 | void SelectAndSetCurrentUser(); | 221 | bool SelectAndSetCurrentUser(); |
| 222 | 222 | ||
| 223 | /** | 223 | /** |
| 224 | * Stores the filename in the recently loaded files list. | 224 | * Stores the filename in the recently loaded files list. |