summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/MainWindow.cpp
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2018-12-23 16:04:05 +0100
committerGitHub <noreply@github.com>2018-12-23 16:04:05 +0100
commitfc998093cce1e2876e776bdede807887cb979a17 (patch)
treeee67b7c51efa69cf471230fb592d8508ff079f22 /Source/Core/DolphinQt/MainWindow.cpp
parent2d0031551e6f163eae256ffb9d2fc81742255be1 (diff)
parent71d53c922fe09e5598cb31990d003f92f8e2b0a9 (diff)
Merge pull request #7600 from spycrab/resource_pack
Implement resource packs
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index 2d81e75267..e3c06d09eb 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -87,6 +87,7 @@
#include "DolphinQt/QtUtils/RunOnObject.h"
#include "DolphinQt/QtUtils/WindowActivationEventFilter.h"
#include "DolphinQt/RenderWidget.h"
+#include "DolphinQt/ResourcePackManager.h"
#include "DolphinQt/Resources.h"
#include "DolphinQt/SearchBar.h"
#include "DolphinQt/Settings.h"
@@ -99,6 +100,10 @@
#include "UICommon/DiscordPresence.h"
#include "UICommon/GameFile.h"
+#include "UICommon/ResourcePack/Manager.h"
+#include "UICommon/ResourcePack/Manifest.h"
+#include "UICommon/ResourcePack/ResourcePack.h"
+
#include "UICommon/UICommon.h"
#include "VideoCommon/VideoConfig.h"
@@ -208,6 +213,21 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainW
// Restoring of window states can sometimes go wrong, resulting in widgets being visible when they
// shouldn't be so we have to reapply all our rules afterwards.
Settings::Instance().RefreshWidgetVisibility();
+
+ if (!ResourcePack::Init())
+ QMessageBox::critical(this, tr("Error"), tr("Error occured while loading some texture packs"));
+
+ for (auto& pack : ResourcePack::GetPacks())
+ {
+ if (!pack.IsValid())
+ {
+ QMessageBox::critical(this, tr("Error"),
+ tr("Invalid Pack %1 provided: %2")
+ .arg(QString::fromStdString(pack.GetPath()))
+ .arg(QString::fromStdString(pack.GetError())));
+ return;
+ }
+ }
}
MainWindow::~MainWindow()
@@ -393,6 +413,8 @@ void MainWindow::ConnectMenuBar()
// Tools
connect(m_menu_bar, &MenuBar::ShowMemcardManager, this, &MainWindow::ShowMemcardManager);
+ connect(m_menu_bar, &MenuBar::ShowResourcePackManager, this,
+ &MainWindow::ShowResourcePackManager);
connect(m_menu_bar, &MenuBar::ShowCheatsManager, this, &MainWindow::ShowCheatsManager);
connect(m_menu_bar, &MenuBar::BootGameCubeIPL, this, &MainWindow::OnBootGameCubeIPL);
connect(m_menu_bar, &MenuBar::ImportNANDBackup, this, &MainWindow::OnImportNANDBackup);
@@ -1556,6 +1578,13 @@ void MainWindow::ShowMemcardManager()
manager.exec();
}
+void MainWindow::ShowResourcePackManager()
+{
+ ResourcePackManager manager(this);
+
+ manager.exec();
+}
+
void MainWindow::ShowCheatsManager()
{
m_cheats_manager->show();