@@ -91,6 +91,24 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
91
91
newMetadata . Root = Destination . Info . ToFullRoot ( ) ;
92
92
var originalDestinationMetadata = await ItemMetadata . GetMetadata ( Destination ) ;
93
93
94
+ // Set 0 needs special handling.
95
+ if ( Source . Info . PrimaryType == XivItemType . equipment && Source . Info . PrimaryId == 0 )
96
+ {
97
+ var set1Root = new XivDependencyRoot ( Source . Info . PrimaryType , 1 , null , null , Source . Info . Slot ) ;
98
+ var set1Metadata = await ItemMetadata . GetMetadata ( set1Root ) ;
99
+
100
+ newMetadata . EqpEntry = set1Metadata . EqpEntry ;
101
+
102
+ if ( Source . Info . Slot == "met" )
103
+ {
104
+ newMetadata . GmpEntry = set1Metadata . GmpEntry ;
105
+ }
106
+ } else if ( Destination . Info . PrimaryType == XivItemType . equipment && Destination . Info . PrimaryId == 0 )
107
+ {
108
+ newMetadata . EqpEntry = null ;
109
+ newMetadata . GmpEntry = null ;
110
+ }
111
+
94
112
95
113
// Now figure out the path names for all of our new paths.
96
114
// These dictionarys map Old Path => New Path
@@ -143,13 +161,14 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
143
161
newMaterialPaths . Select ( x => x . Value ) ) . Union (
144
162
newAvfxPaths . Select ( x => x . Value ) ) . Union (
145
163
newTexturePaths . Select ( x => x . Value ) ) ;
146
-
147
164
var allFiles = new HashSet < string > ( ) ;
148
165
foreach ( var f in files )
149
166
{
150
167
allFiles . Add ( f ) ;
151
168
}
152
169
170
+ allFiles . Add ( Destination . Info . GetRootFile ( ) ) ;
171
+
153
172
if ( ProgressReporter != null )
154
173
{
155
174
ProgressReporter . Report ( "Getting modlist..." ) ;
@@ -386,11 +405,11 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
386
405
{
387
406
if ( allFiles . Contains ( mod . fullPath ) )
388
407
{
389
- // Don't claim common path items into our modpack .
390
- if ( ! mod . fullPath . StartsWith ( CommonPath ) )
391
- {
392
- mod . modPack = modPack ;
393
- }
408
+ // Ensure all of our modified files are attributed correctly .
409
+ mod . name = iName ;
410
+ mod . category = iCat ;
411
+ mod . source = ApplicationSource ;
412
+ mod . modPack = modPack ;
394
413
}
395
414
}
396
415
@@ -414,9 +433,16 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
414
433
415
434
private static string UpdatePath ( XivDependencyRoot Source , XivDependencyRoot Destination , string path )
416
435
{
417
- // Things that live in the common folder get to stay there/don't get copied.
418
- 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
+ }
419
444
445
+ // Things that live in the common folder get to stay there/don't get copied.
420
446
421
447
var file = UpdateFileName ( Source , Destination , path ) ;
422
448
var folder = UpdateFolder ( Source , Destination , path ) ;
@@ -426,6 +452,8 @@ private static string UpdatePath(XivDependencyRoot Source, XivDependencyRoot Des
426
452
427
453
private static string UpdateFolder ( XivDependencyRoot Source , XivDependencyRoot Destination , string path )
428
454
{
455
+
456
+
429
457
// So first off, just copy anything from the old root folder to the new one.
430
458
var match = RemoveRootPathRegex . Match ( path ) ;
431
459
if ( match . Success )
0 commit comments