Skip to content

Commit 9e12f00

Browse files
committed
Bundle item copy elements into a single modpack for easy toggling.
1 parent 38c9f86 commit 9e12f00

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using xivModdingFramework.Materials.FileTypes;
1212
using xivModdingFramework.Models.DataContainers;
1313
using xivModdingFramework.Models.FileTypes;
14+
using xivModdingFramework.Mods.DataContainers;
1415
using xivModdingFramework.Mods.FileTypes;
1516
using xivModdingFramework.SqPack.FileTypes;
1617
using xivModdingFramework.Textures.FileTypes;
@@ -301,6 +302,39 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
301302
}
302303
}
303304

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);
304338

305339
if (ProgressReporter != null)
306340
{

0 commit comments

Comments
 (0)