|
11 | 11 | using xivModdingFramework.Materials.FileTypes;
|
12 | 12 | using xivModdingFramework.Models.DataContainers;
|
13 | 13 | using xivModdingFramework.Models.FileTypes;
|
| 14 | +using xivModdingFramework.Mods.DataContainers; |
14 | 15 | using xivModdingFramework.Mods.FileTypes;
|
15 | 16 | using xivModdingFramework.SqPack.FileTypes;
|
16 | 17 | using xivModdingFramework.Textures.FileTypes;
|
@@ -301,6 +302,39 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
|
301 | 302 | }
|
302 | 303 | }
|
303 | 304 |
|
| 305 | + if (ProgressReporter != null) |
| 306 | + { |
| 307 | + ProgressReporter.Report("Updating modlist..."); |
| 308 | + } |
| 309 | + |
| 310 | + // Here we're going to go through and edit all the modded items to be joined together in a modpack for convenience. |
| 311 | + modlist = await _modding.GetModListAsync(); |
| 312 | + |
| 313 | + var files = newModelPaths.Select(x => x.Value).Union( |
| 314 | + newMaterialPaths.Select(x => x.Value)).Union( |
| 315 | + newAvfxPaths.Select(x => x.Value)).Union( |
| 316 | + newTexturePaths.Select(x => x.Value)); |
| 317 | + |
| 318 | + var allFiles = new HashSet<string>(); |
| 319 | + foreach(var f in files) |
| 320 | + { |
| 321 | + allFiles.Add(f); |
| 322 | + } |
| 323 | + |
| 324 | + |
| 325 | + var modPack = new ModPack() { author = "System", name = "Item Copy - " + iName, url = "", version = "1.0" }; |
| 326 | + foreach(var mod in modlist.Mods) |
| 327 | + { |
| 328 | + if(allFiles.Contains(mod.fullPath)) |
| 329 | + { |
| 330 | + mod.modPack = modPack; |
| 331 | + } |
| 332 | + } |
| 333 | + |
| 334 | + modlist.ModPacks.Add(modPack); |
| 335 | + modlist.modPackCount++; |
| 336 | + |
| 337 | + _modding.SaveModList(modlist); |
304 | 338 |
|
305 | 339 | if (ProgressReporter != null)
|
306 | 340 | {
|
|
0 commit comments