mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Fixes mod install / uninstall / updates
This commit is contained in:
@@ -192,7 +192,28 @@ bool ModDescription::isInstalled() const
|
||||
|
||||
bool ModDescription::affectsGameplay() const
|
||||
{
|
||||
return true; // TODO
|
||||
static const std::array keysToTest = {
|
||||
"artifacts",
|
||||
"battlefields",
|
||||
"creatures",
|
||||
"factions",
|
||||
"heroClasses",
|
||||
"heroes",
|
||||
"objects",
|
||||
"obstacles",
|
||||
"rivers",
|
||||
"roads",
|
||||
"settings",
|
||||
"skills",
|
||||
"spells",
|
||||
"terrains",
|
||||
};
|
||||
|
||||
for(const auto & key : keysToTest)
|
||||
if (!getLocalValue(key).isNull())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
@@ -503,7 +503,7 @@ void ModManager::tryEnableMod(const TModID & modName)
|
||||
auto additionalActiveMods = getActiveMods();
|
||||
|
||||
assert(!vstd::contains(additionalActiveMods, modName));
|
||||
assert(vstd::contains(requiredActiveMods, modName));
|
||||
assert(vstd::contains(requiredActiveMods, modName));// FIXME: fails on attempt to enable broken mod / translation to other language
|
||||
|
||||
ModDependenciesResolver testResolver(requiredActiveMods, *modsStorage);
|
||||
assert(testResolver.getBrokenMods().empty());
|
||||
@@ -555,6 +555,8 @@ void ModManager::updatePreset(const ModDependenciesResolver & testResolver)
|
||||
std::vector<TModID> desiredModList = modsPreset->getActiveMods();
|
||||
depedencyResolver = std::make_unique<ModDependenciesResolver>(desiredModList, *modsStorage);
|
||||
|
||||
// TODO: check activation status of submods of new mods
|
||||
|
||||
modsPreset->saveConfigurationState();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user