MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ActiveModsFromMountPath

Function ActiveModsFromMountPath

engine/Poseidon/Core/ModCollection.cpp:279–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277 }
278 return out;
279}
280
281ModCollection ActiveModsFromMountPath(const std::string& mountPath)
282{
283 ModCollection col;
284 std::stringstream ss(mountPath);
285 std::string entry;
286 while (std::getline(ss, entry, ';'))
287 {
288 if (entry.empty())
289 continue;
290 Mod m;
291 m.id = FolderBasename(entry); // the folder name verbatim — the mod identity, 1:1
292 m.catalogId = ReadModJsonString(std::filesystem::path(entry), "modId");
293 m.name = ModDisplayName(m.id, ReadModJsonString(std::filesystem::path(entry), "name"));
294 m.version = ReadModJsonString(std::filesystem::path(entry), "version");
295 m.path = entry;
296 col.Add(std::move(m));
297 }
298 return col;
299}
300

Callers 3

BeginModdedJoinMethod · 0.85
SetModPathMethod · 0.85

Calls 5

FolderBasenameFunction · 0.85
ReadModJsonStringFunction · 0.85
ModDisplayNameFunction · 0.85
emptyMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected