summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/installationmanager.cpp2
-rw-r--r--src/organizercore.cpp9
-rw-r--r--src/organizercore.h1
-rw-r--r--src/organizerproxy.cpp5
-rw-r--r--src/organizerproxy.h1
5 files changed, 17 insertions, 1 deletions
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<IPluginGame>()) {
+ if (game->gameShortName().compare(name, Qt::CaseInsensitive) == 0)
+ return game;
+ }
+ return nullptr;
+}
+
MOBase::IModInterface *OrganizerCore::createMod(GuessedValue<QString> &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<QString> &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<QString> &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<QString> &name);
virtual bool removeMod(MOBase::IModInterface *mod);
virtual void modDataChanged(MOBase::IModInterface *mod);