diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-19 18:00:12 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-19 18:00:12 +0200 |
| commit | c391c2b584a309f64f87dd5e00b0083279e6211c (patch) | |
| tree | 73b0386d1198acdf3acaf1f4c1ac5d365347c67e /src | |
| parent | 04698417a93a51acc80112feab170f3aff7572b7 (diff) | |
Rollback to setGameName instead of setGamePlugin for mod interface.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modinfo.h | 10 | ||||
| -rw-r--r-- | src/modinfobackup.h | 2 | ||||
| -rw-r--r-- | src/modinfodialognexus.cpp | 2 | ||||
| -rw-r--r-- | src/modinfoforeign.h | 2 | ||||
| -rw-r--r-- | src/modinfooverwrite.h | 2 | ||||
| -rw-r--r-- | src/modinforegular.cpp | 6 | ||||
| -rw-r--r-- | src/modinforegular.h | 18 | ||||
| -rw-r--r-- | src/modinfoseparator.h | 2 |
8 files changed, 22 insertions, 22 deletions
diff --git a/src/modinfo.h b/src/modinfo.h index d611fa87..2c108378 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -319,11 +319,11 @@ public: virtual void setNotes(const QString ¬es) = 0; /** - * @brief set/change the game plgin for this mod - * - * @param gamePlugin the game plugin - */ - virtual void setGamePlugin(const MOBase::IPluginGame* gamePlugin) = 0; + * @brief set/change the source game of this mod + * + * @param gameName the source game shortName + */ + virtual void setGameName(const QString& gameName) = 0; /** * @brief set the name of this mod diff --git a/src/modinfobackup.h b/src/modinfobackup.h index bc340b3e..9eba545c 100644 --- a/src/modinfobackup.h +++ b/src/modinfobackup.h @@ -16,7 +16,7 @@ public: virtual bool updateIgnored() const override { return false; } virtual bool downgradeAvailable() const override { return false; } virtual bool updateNXMInfo() override { return false; } - virtual void setGamePlugin(const MOBase::IPluginGame*) override {} + virtual void setGameName(const QString& gameName) override {} virtual void setNexusID(int) override {} virtual void endorse(bool) override {} virtual int getFixedPriority() const override { return -1; } diff --git a/src/modinfodialognexus.cpp b/src/modinfodialognexus.cpp index 447beea6..8d99d230 100644 --- a/src/modinfodialognexus.cpp +++ b/src/modinfodialognexus.cpp @@ -324,7 +324,7 @@ void NexusTab::onSourceGameChanged() for (auto game : plugin().plugins<MOBase::IPluginGame>()) { if (game->gameName() == ui->sourceGame->currentText()) { - mod().setGamePlugin(game); + mod().setGameName(game->gameShortName()); mod().setLastNexusQuery(QDateTime::fromSecsSinceEpoch(0)); refreshData(mod().getNexusID()); return; diff --git a/src/modinfoforeign.h b/src/modinfoforeign.h index 0c15c7a4..da2c865b 100644 --- a/src/modinfoforeign.h +++ b/src/modinfoforeign.h @@ -22,7 +22,7 @@ public: virtual bool setName(const QString&) override { return false; } virtual void setComments(const QString&) override {} virtual void setNotes(const QString&) override {} - virtual void setGamePlugin(const MOBase::IPluginGame*) override {} + virtual void setGameName(const QString& gameName) override {} virtual void setNexusID(int) override {} virtual void setNewestVersion(const MOBase::VersionInfo&) override {} virtual void ignoreUpdate(bool) override {} diff --git a/src/modinfooverwrite.h b/src/modinfooverwrite.h index 10d405bd..0bcf6f27 100644 --- a/src/modinfooverwrite.h +++ b/src/modinfooverwrite.h @@ -24,7 +24,7 @@ public: virtual bool setName(const QString&) override { return false; } virtual void setComments(const QString&) override {} virtual void setNotes(const QString&) override {} - virtual void setGamePlugin(const MOBase::IPluginGame*) override {} + virtual void setGameName(const QString& gameName) override {} virtual void setNexusID(int) override {} virtual void setNewestVersion(const MOBase::VersionInfo&) override {} virtual void ignoreUpdate(bool) override {} diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp index d248f530..a1ef5701 100644 --- a/src/modinforegular.cpp +++ b/src/modinforegular.cpp @@ -468,12 +468,10 @@ void ModInfoRegular::setNotes(const QString ¬es) m_MetaInfoChanged = true; } -void ModInfoRegular::setGamePlugin(const MOBase::IPluginGame* gamePlugin) +void ModInfoRegular::setGameName(const QString& gameName) { - m_GamePlugin = gamePlugin; - m_GameName = gamePlugin->gameShortName(); + m_GameName = gameName; m_MetaInfoChanged = true; - testValid(); } void ModInfoRegular::setNexusID(int modID) diff --git a/src/modinforegular.h b/src/modinforegular.h index b4a7bfd2..75b24a6b 100644 --- a/src/modinforegular.h +++ b/src/modinforegular.h @@ -105,11 +105,11 @@ public: void setNotes(const QString ¬es) override; /** - * @brief set/change the game plgin for this mod - * - * @param gamePlugin the game plugin - */ - virtual void setGamePlugin(const MOBase::IPluginGame* gamePlugin) override; + * @brief set/change the source game of this mod + * + * @param gameName the source game shortName + */ + virtual void setGameName(const QString& gameName) override; /** * @brief set/change the nexus mod id of this mod @@ -432,9 +432,11 @@ private: QString m_CustomURL; bool m_HasCustomURL; - // Storing both the game name and game plugin since we can have a game - // name that is not one of the primary names of the game plugin: - const MOBase::IPluginGame* m_GamePlugin; + // Current game plugin running in MO2: + MOBase::IPluginGame const* m_GamePlugin; + + // Game name for the mod, can be different from the actual game running in MO2 + // e.g., for Skyrim / Skyrim SE. QString m_GameName; mutable QStringList m_Archives; diff --git a/src/modinfoseparator.h b/src/modinfoseparator.h index d715d548..80734bcf 100644 --- a/src/modinfoseparator.h +++ b/src/modinfoseparator.h @@ -21,7 +21,7 @@ public: virtual bool setName(const QString& name); virtual int getNexusID() const override { return -1; } - virtual void setGamePlugin(const MOBase::IPluginGame* /*gamePlugin*/) override {} + virtual void setGameName(const QString& gameName) override {} virtual void setNexusID(int /*modID*/) override {} virtual void endorse(bool /*doEndorse*/) override {} virtual void ignoreUpdate(bool /*ignore*/) override {} |
