From 30c177cb371e92fe5e4cfc600cf27586402cf0a8 Mon Sep 17 00:00:00 2001 From: Silarn Date: Mon, 16 Apr 2018 12:47:17 -0500 Subject: Support for multi-game downloads --- src/organizerproxy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/organizerproxy.cpp') diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index cf2e29e3..77d61a52 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -2,6 +2,7 @@ #include "appconfig.h" #include "organizercore.h" +#include "plugincontainer.h" #include @@ -9,15 +10,16 @@ using namespace MOBase; using namespace MOShared; -OrganizerProxy::OrganizerProxy(OrganizerCore *organizer, const QString &pluginName) +OrganizerProxy::OrganizerProxy(OrganizerCore *organizer, PluginContainer *pluginContainer, const QString &pluginName) : m_Proxied(organizer) + , m_PluginContainer(pluginContainer) , m_PluginName(pluginName) { } IModRepositoryBridge *OrganizerProxy::createNexusBridge() const { - return new NexusBridge(m_PluginName); + return new NexusBridge(m_PluginContainer, m_PluginName); } QString OrganizerProxy::profileName() const -- cgit v1.3.1 From 02d3f8182984c86b6a1e778e9f32a118f6fe02fe Mon Sep 17 00:00:00 2001 From: Silarn Date: Mon, 7 May 2018 01:29:00 -0500 Subject: Changes to allow installer_NCC to use the game source set in the DL meta --- src/installationmanager.cpp | 2 +- src/organizercore.cpp | 9 +++++++++ src/organizercore.h | 1 + src/organizerproxy.cpp | 5 +++++ src/organizerproxy.h | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/organizerproxy.cpp') diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index b7ec3d68..d1922cf9 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -819,7 +819,7 @@ bool InstallationManager::install(const QString &fileName, = installerCustom->supportedExtensions(); if (installerExt.find(fileInfo.suffix()) != installerExt.end()) { installResult - = installerCustom->install(modName, fileName, version, modID); + = installerCustom->install(modName, gameName, fileName, version, modID); unsigned int idx = ModInfo::getIndex(modName); if (idx != UINT_MAX) { ModInfo::Ptr info = ModInfo::getByIndex(idx); diff --git a/src/organizercore.cpp b/src/organizercore.cpp index d1b1fcd7..35486f98 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -789,6 +789,15 @@ MOBase::IModInterface *OrganizerCore::getMod(const QString &name) const return index == UINT_MAX ? nullptr : ModInfo::getByIndex(index).data(); } +MOBase::IPluginGame *OrganizerCore::getGame(const QString &name) const +{ + for (IPluginGame *game : m_PluginContainer->plugins()) { + if (game->gameShortName().compare(name, Qt::CaseInsensitive) == 0) + return game; + } + return nullptr; +} + MOBase::IModInterface *OrganizerCore::createMod(GuessedValue &name) { bool merge = false; diff --git a/src/organizercore.h b/src/organizercore.h index 76c286be..28ecef48 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -184,6 +184,7 @@ public: QString basePath() const; MOBase::VersionInfo appVersion() const; MOBase::IModInterface *getMod(const QString &name) const; + MOBase::IPluginGame *getGame(const QString &gameName) const; MOBase::IModInterface *createMod(MOBase::GuessedValue &name); bool removeMod(MOBase::IModInterface *mod); void modDataChanged(MOBase::IModInterface *mod); diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index 77d61a52..8e0bc95b 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -60,6 +60,11 @@ IModInterface *OrganizerProxy::getMod(const QString &name) const return m_Proxied->getMod(name); } +IPluginGame *OrganizerProxy::getGame(const QString &gameName) const +{ + return m_Proxied->getGame(gameName); +} + IModInterface *OrganizerProxy::createMod(MOBase::GuessedValue &name) { return m_Proxied->createMod(name); diff --git a/src/organizerproxy.h b/src/organizerproxy.h index cebb98ac..b8eb9b82 100644 --- a/src/organizerproxy.h +++ b/src/organizerproxy.h @@ -22,6 +22,7 @@ public: virtual QString basePath() const; virtual MOBase::VersionInfo appVersion() const; virtual MOBase::IModInterface *getMod(const QString &name) const; + virtual MOBase::IPluginGame *getGame(const QString &gameName) const; virtual MOBase::IModInterface *createMod(MOBase::GuessedValue &name); virtual bool removeMod(MOBase::IModInterface *mod); virtual void modDataChanged(MOBase::IModInterface *mod); -- cgit v1.3.1