MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / setupModDataPaths

Method setupModDataPaths

framework/framework.cpp:1133–1154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1131void *Framework::getWindowHandle() const { return static_cast<void *>(p->window); }
1132
1133void Framework::setupModDataPaths()
1134{
1135 auto mods = split(Options::modList.get(), ":");
1136 for (const auto &modString : mods)
1137 {
1138 LogWarning("loading mod \"%s\"", modString);
1139 auto modPath = Options::modPath.get() + "/" + modString;
1140 auto modInfo = ModInfo::getInfo(modPath);
1141 if (!modInfo)
1142 {
1143 LogError("Failed to load ModInfo for mod \"%s\"", modString);
1144 continue;
1145 }
1146 auto modDataPath = modPath + "/" + modInfo->getDataPath();
1147 LogWarning("Loaded modinfo for mod ID \"%s\"", modInfo->getID());
1148 if (modInfo->getDataPath() != "")
1149 {
1150 LogWarning("Appending data path \"%s\"", modDataPath);
1151 this->data->fs.addPath(modDataPath);
1152 }
1153 }
1154}
1155
1156}; // namespace OpenApoc

Callers 1

updateMethod · 0.80

Calls 3

splitFunction · 0.85
addPathMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected