Update Available mods when installing them

Differential revision: D4211
Since 498f0d420b available mods where cached and not updated when new
where installed.
Fixing above.

This was SVN commit r25850.
This commit is contained in:
Angen
2021-08-17 17:32:10 +00:00
parent 8f5b5670ff
commit 6400a4a0c5
4 changed files with 16 additions and 11 deletions
+10 -9
View File
@@ -56,6 +56,16 @@ public:
const std::vector<CStr>& GetIncompatibleMods() const;
const std::vector<ModData>& GetAvailableMods() const;
/**
* Fetches available mods and stores some metadata about them.
* This may open the zipped mod archives, depending on the situation,
* and/or try to write files to the user mod folder,
* which can be quite slow, so should be run rarely.
* TODO: if this did not need the scriptInterface to parse JSON,
* we could run it in different contexts and possibly cleaner.
*/
void UpdateAvailableMods(const ScriptInterface& scriptInterface);
/**
* Enables specified mods (& mods required by the engine).
* @param addPublic - if true, enable the public mod.
@@ -83,15 +93,6 @@ public:
*/
static bool AreModsPlayCompatible(const std::vector<const Mod::ModData*>& modsA, const std::vector<const Mod::ModData*>& modsB);
private:
/**
* Fetches available mods and stores some metadata about them.
* This may open the zipped mod archives, depending on the situation,
* and/or try to write files to the user mod folder,
* which can be quite slow, so should be run rarely.
* TODO: if this did not need the scriptInterface to parse JSON,
* we could run it in different contexts and possibly cleaner.
*/
void UpdateAvailableMods(const ScriptInterface& scriptInterface);
/**
* Checks a list of @a mods and returns the incompatible mods, if any.