List which level subdirectory a mod changes

pyro-refactor
MrSimbax 2020-07-23 18:07:02 +02:00
parent e6ce4112c6
commit 253cca379b
1 changed files with 11 additions and 0 deletions

View File

@ -281,6 +281,17 @@ void CModManager::LoadModData(Mod& mod)
// Changes
data.changes = CResourceManager::ListDirectories("temp/mod");
auto levelsIt = std::find(data.changes.begin(), data.changes.end(), "levels");
if (levelsIt != data.changes.end())
{
auto levelsDirs = CResourceManager::ListDirectories("temp/mod/levels");
if (!levelsDirs.empty())
{
std::transform(levelsDirs.begin(), levelsDirs.end(), levelsDirs.begin(), [](const std::string& dir) { return "levels/" + dir; });
levelsIt = data.changes.erase(levelsIt);
data.changes.insert(levelsIt, levelsDirs.begin(), levelsDirs.end());
}
}
}
void CModManager::MountMod(const Mod& mod, const std::string& mountPoint)