summaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-30 21:34:43 -0400
committerGitHub <noreply@github.com>2018-08-30 21:34:43 -0400
commit26aaa86ece9cf96b477e0755f5ee7ebe471ef85a (patch)
tree792b04795f475dbb86b6d678533f4703e09a60d4 /src/yuzu/main.cpp
parent915ab81ec203d40e6f67d3cfa6e2e26599bec570 (diff)
parent78653f73398b98071fe9bb4b4a32ec68f674ccfd (diff)
Merge pull request #1195 from FearlessTobi/port-gamelist-compat
yuzu: Show game compatibility in the game list (PR ported from Citra)
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index ffa9f72aa..1501aedc4 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -16,6 +16,7 @@
#include <QMessageBox>
#include <QtGui>
#include <QtWidgets>
+#include <fmt/format.h>
#include "common/common_paths.h"
#include "common/logging/backend.h"
#include "common/logging/filter.h"
@@ -35,6 +36,7 @@
#include "core/gdbstub/gdbstub.h"
#include "core/loader/loader.h"
#include "core/settings.h"
+#include "game_list_p.h"
#include "video_core/debug_utils/debug_utils.h"
#include "yuzu/about_dialog.h"
#include "yuzu/bootmanager.h"
@@ -134,6 +136,7 @@ GMainWindow::GMainWindow()
// Necessary to load titles from nand in gamelist.
Service::FileSystem::CreateFactories(vfs);
+ game_list->LoadCompatibilityList();
game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan);
// Show one-time "callout" messages to the user
@@ -349,6 +352,8 @@ void GMainWindow::RestoreUIState() {
void GMainWindow::ConnectWidgetEvents() {
connect(game_list, &GameList::GameChosen, this, &GMainWindow::OnGameListLoadFile);
connect(game_list, &GameList::OpenFolderRequested, this, &GMainWindow::OnGameListOpenFolder);
+ connect(game_list, &GameList::NavigateToGamedbEntryRequested, this,
+ &GMainWindow::OnGameListNavigateToGamedbEntry);
connect(this, &GMainWindow::EmulationStarting, render_window,
&GRenderWindow::OnEmulationStarting);
@@ -678,6 +683,20 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
QDesktopServices::openUrl(QUrl::fromLocalFile(qpath));
}
+void GMainWindow::OnGameListNavigateToGamedbEntry(
+ u64 program_id,
+ std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list) {
+
+ auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id);
+
+ QString directory;
+
+ if (it != compatibility_list.end())
+ directory = it->second.second;
+
+ QDesktopServices::openUrl(QUrl("https://yuzu-emu.org/game/" + directory));
+}
+
void GMainWindow::OnMenuLoadFile() {
QString extensions;
for (const auto& piece : game_list->supported_file_extensions)