| 277 | } |
| 278 | return out; |
| 279 | } |
| 280 | |
| 281 | ModCollection 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 |
no test coverage detected