Skip to content

Commit ddc7ff0

Browse files
committed
Copy common path items into their own personal folder during root cloning.
1 parent 11b97ad commit ddc7ff0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
405405
{
406406
if (allFiles.Contains(mod.fullPath))
407407
{
408+
// Ensure all of our modified files are attributed correctly.
409+
mod.name = iName;
410+
mod.category = iCat;
411+
mod.source = ApplicationSource;
408412
mod.modPack = modPack;
409413
}
410414
}
@@ -429,9 +433,16 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
429433

430434
private static string UpdatePath(XivDependencyRoot Source, XivDependencyRoot Destination, string path)
431435
{
432-
// Things that live in the common folder get to stay there/don't get copied.
433-
if (path.StartsWith(CommonPath)) return path;
436+
// For common path items, copy them to our own personal mimic of the path.
437+
if (path.StartsWith(CommonPath))
438+
{
439+
var len = CommonPath.Length;
440+
var afterCommon = path.Substring(len);
441+
path = Destination.Info.GetRootFolder() + "common/" + afterCommon;
442+
return path;
443+
}
434444

445+
// Things that live in the common folder get to stay there/don't get copied.
435446

436447
var file = UpdateFileName(Source, Destination, path);
437448
var folder = UpdateFolder(Source, Destination, path);
@@ -441,6 +452,8 @@ private static string UpdatePath(XivDependencyRoot Source, XivDependencyRoot Des
441452

442453
private static string UpdateFolder(XivDependencyRoot Source, XivDependencyRoot Destination, string path)
443454
{
455+
456+
444457
// So first off, just copy anything from the old root folder to the new one.
445458
var match = RemoveRootPathRegex.Match(path);
446459
if(match.Success)

0 commit comments

Comments
 (0)