Trophy Viewer - Select Game (#2678)

* Trophy Viewer - Select Game

* TR - Button in Utils +icon

TR - Button in Utils +icon
I also made a small correction to the game folder list, where the checkboxes were being filled in incorrectly.
This commit is contained in:
DanielSvoboda 2025-03-24 05:25:51 -03:00 committed by GitHub
parent 4f8e5dfd7c
commit 16a68d78eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 193 additions and 14 deletions

View file

@ -331,7 +331,33 @@ public:
Common::FS::PathToQString(gameTrpPath, game_update_path);
}
}
TrophyViewer* trophyViewer = new TrophyViewer(trophyPath, gameTrpPath);
// Array with all games and their trophy information
QVector<TrophyGameInfo> allTrophyGames;
for (const auto& game : m_games) {
TrophyGameInfo gameInfo;
gameInfo.name = QString::fromStdString(game.name);
Common::FS::PathToQString(gameInfo.trophyPath, game.serial);
Common::FS::PathToQString(gameInfo.gameTrpPath, game.path);
auto update_path = Common::FS::PathFromQString(gameInfo.gameTrpPath);
update_path += "-UPDATE";
if (std::filesystem::exists(update_path)) {
Common::FS::PathToQString(gameInfo.gameTrpPath, update_path);
} else {
update_path = Common::FS::PathFromQString(gameInfo.gameTrpPath);
update_path += "-patch";
if (std::filesystem::exists(update_path)) {
Common::FS::PathToQString(gameInfo.gameTrpPath, update_path);
}
}
allTrophyGames.append(gameInfo);
}
QString gameName = QString::fromStdString(m_games[itemID].name);
TrophyViewer* trophyViewer =
new TrophyViewer(trophyPath, gameTrpPath, gameName, allTrophyGames);
trophyViewer->show();
connect(widget->parent(), &QWidget::destroyed, trophyViewer,
[trophyViewer]() { trophyViewer->deleteLater(); });