Skip to content

Commit

Permalink
Qt/Patches: Use the game list serial when populating patches for the ELF
Browse files Browse the repository at this point in the history
This makes the Game Properties window match the behaviour of the VM
when booting into a game.

Fixes #11533
  • Loading branch information
CookiePLMonster authored and F0bes committed Jan 11, 2025
1 parent 534ddd8 commit d8e310e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions pcsx2-qt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,9 +1346,8 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point)
if (action->isEnabled())
{
connect(action, &QAction::triggered, [entry]() {
SettingsWindow::openGamePropertiesDialog(entry, entry->title,
(entry->type != GameList::EntryType::ELF) ? entry->serial : std::string(),
entry->crc);
SettingsWindow::openGamePropertiesDialog(entry,
entry->title, entry->serial, entry->crc, entry->type == GameList::EntryType::ELF);
});
}

Expand Down Expand Up @@ -1564,7 +1563,7 @@ void MainWindow::onViewGamePropertiesActionTriggered()
if (entry)
{
SettingsWindow::openGamePropertiesDialog(
entry, entry->title, s_current_elf_override.isEmpty() ? entry->serial : std::string(), entry->crc);
entry, entry->title, entry->serial, entry->crc, !s_current_elf_override.isEmpty());
return;
}
}
Expand All @@ -1580,12 +1579,12 @@ void MainWindow::onViewGamePropertiesActionTriggered()
if (s_current_elf_override.isEmpty())
{
SettingsWindow::openGamePropertiesDialog(
nullptr, s_current_title.toStdString(), s_current_disc_serial.toStdString(), s_current_disc_crc);
nullptr, s_current_title.toStdString(), s_current_disc_serial.toStdString(), s_current_disc_crc, false);
}
else
{
SettingsWindow::openGamePropertiesDialog(
nullptr, s_current_title.toStdString(), std::string(), s_current_disc_crc);
nullptr, s_current_title.toStdString(), std::string(), s_current_disc_crc, true);
}
}

Expand Down
4 changes: 2 additions & 2 deletions pcsx2-qt/Settings/SettingsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ void SettingsWindow::saveAndReloadGameSettings()
g_emu_thread->reloadGameSettings();
}

void SettingsWindow::openGamePropertiesDialog(const GameList::Entry* game, const std::string_view title, std::string serial, u32 disc_crc)
void SettingsWindow::openGamePropertiesDialog(const GameList::Entry* game, const std::string_view title, std::string serial, u32 disc_crc, bool is_elf)
{
std::string filename = VMManager::GetGameSettingsPath(serial, disc_crc);
std::string filename = VMManager::GetGameSettingsPath(!is_elf ? serial : std::string_view(), disc_crc);

// check for an existing dialog with this filename
for (SettingsWindow* dialog : s_open_game_properties_dialogs)
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Settings/SettingsWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SettingsWindow final : public QWidget
u32 disc_crc, QString filename = QString());
~SettingsWindow();

static void openGamePropertiesDialog(const GameList::Entry* game, const std::string_view title, std::string serial, u32 disc_crc);
static void openGamePropertiesDialog(const GameList::Entry* game, const std::string_view title, std::string serial, u32 disc_crc, bool is_elf);
static void closeGamePropertiesDialogs();

SettingsInterface* getSettingsInterface() const;
Expand Down

0 comments on commit d8e310e

Please sign in to comment.