@@ -132,9 +132,6 @@ public enum XivDependencyFileType
132
132
invalid ,
133
133
root ,
134
134
meta ,
135
- eqp ,
136
- eqdp ,
137
- imc ,
138
135
mdl ,
139
136
mtrl ,
140
137
tex
@@ -787,16 +784,6 @@ public async Task<List<string>> GetImcEntryPaths()
787
784
return imcEntries ;
788
785
}
789
786
790
- private static readonly Dictionary < XivItemType , string > EqdpFolder = new Dictionary < XivItemType , string > ( )
791
- {
792
- { XivItemType . equipment , "chara/xls/charadb/equipmentdeformerparameter/" } ,
793
- { XivItemType . accessory , "chara/xls/charadb/accessorydeformerparameter/" }
794
- } ;
795
-
796
- private static readonly Dictionary < XivItemType , string > EqpPaths = new Dictionary < XivItemType , string > ( )
797
- {
798
- { XivItemType . equipment , "chara/xls/equipmentparameter/equipmentparameter.eqp" }
799
- } ;
800
787
801
788
802
789
@@ -1010,7 +997,7 @@ internal static class XivDependencyGraph
1010
997
*
1011
998
*
1012
999
* ROOT - [SET AND SLOT] - Theoretical/Just a number/prefix, no associated file.
1013
- * META - [EQP/EQDP/IMC ] - Binary entries. - Not all of these entries are available for all types, but at least one always is .
1000
+ * META - [META ] - Binary entries.
1014
1001
* MODEL - [MDL] - Files for each racial model.
1015
1002
* MATERIAL - [MTRL] - Files for each Racial Model x Material Variant, roughly.
1016
1003
* TEXTURE - [TEX] - Files For each Material. May be used by multiple.
@@ -1044,7 +1031,7 @@ internal static class XivDependencyGraph
1044
1031
/// </summary>
1045
1032
public static readonly Dictionary < XivDependencyLevel , List < XivDependencyFileType > > DependencyLevelGroups = new Dictionary < XivDependencyLevel , List < XivDependencyFileType > > ( )
1046
1033
{
1047
- { XivDependencyLevel . Root , new List < XivDependencyFileType > ( ) { XivDependencyFileType . root , XivDependencyFileType . meta , XivDependencyFileType . eqp , XivDependencyFileType . eqdp , XivDependencyFileType . imc } } ,
1034
+ { XivDependencyLevel . Root , new List < XivDependencyFileType > ( ) { XivDependencyFileType . root , XivDependencyFileType . meta } } ,
1048
1035
{ XivDependencyLevel . Model , new List < XivDependencyFileType > ( ) { XivDependencyFileType . mdl } } ,
1049
1036
{ XivDependencyLevel . Material , new List < XivDependencyFileType > ( ) { XivDependencyFileType . mtrl } } ,
1050
1037
{ XivDependencyLevel . Texture , new List < XivDependencyFileType > ( ) { XivDependencyFileType . tex } } ,
@@ -1071,12 +1058,6 @@ internal static class XivDependencyGraph
1071
1058
// Captures the binary offset of a file.
1072
1059
private static readonly Regex _binaryOffsetRegex = new Regex ( Constants . BinaryOffsetMarker + "([0-9]+)$" ) ;
1073
1060
1074
- // Regex for identifying EQP files and extracting the offset.
1075
- private static readonly Regex EqpRegex = new Regex ( "^chara\\ /xls\\ /equipmentparameter\\ /equipmentparameter\\ .eqp" + Constants . BinaryOffsetMarker + "([0-9]+)$" ) ;
1076
-
1077
- // Regex for identifying EQDP files and extracting the type and offset.
1078
- private static readonly Regex EqdpRegex = new Regex ( "^chara\\ /xls\\ /charadb\\ /(equipment|accessory)deformerparameter\\ /c[0-9]{4}\\ .eqdp" + Constants . BinaryOffsetMarker + "([0-9]+)$" ) ;
1079
-
1080
1061
private static readonly Regex MtrlRegex = new Regex ( "^.*\\ .mtrl$" ) ;
1081
1062
1082
1063
// Group 0 == Full File path
@@ -1303,19 +1284,6 @@ public static XivDependencyFileType GetDependencyFileType(string internalFilePat
1303
1284
return XivDependencyFileType . root ;
1304
1285
case "meta" :
1305
1286
return XivDependencyFileType . meta ;
1306
- case "imc" :
1307
- // Do not allow dependency crawling for meta files that do not have proper binary offsets.
1308
- if ( ! internalFilePath . Contains ( Constants . BinaryOffsetMarker ) )
1309
- return XivDependencyFileType . invalid ;
1310
- return XivDependencyFileType . imc ;
1311
- case "eqp" :
1312
- if ( ! internalFilePath . Contains ( Constants . BinaryOffsetMarker ) )
1313
- return XivDependencyFileType . invalid ;
1314
- return XivDependencyFileType . eqp ;
1315
- case "eqdp" :
1316
- if ( ! internalFilePath . Contains ( Constants . BinaryOffsetMarker ) )
1317
- return XivDependencyFileType . invalid ;
1318
- return XivDependencyFileType . eqdp ;
1319
1287
case "mdl" :
1320
1288
return XivDependencyFileType . mdl ;
1321
1289
case "mtrl" :
@@ -1559,106 +1527,33 @@ public static async Task<List<XivDependencyRoot>> GetDependencyRoots(string inte
1559
1527
{
1560
1528
var roots = new HashSet < XivDependencyRoot > ( ) ;
1561
1529
1530
+
1531
+ // First root should always be the path-extracted root.
1532
+ var info = ExtractRootInfo ( internalFilePath ) ;
1533
+ var root = CreateDependencyRoot ( info ) ;
1534
+ if ( root != null )
1535
+ {
1536
+ roots . Add ( root ) ;
1537
+ }
1538
+
1562
1539
// Tex files require special handling, because they can be referenced by modded items
1563
1540
// outside of their own dependency chain potentially.
1564
1541
var match = _extensionRegex . Match ( internalFilePath ) ;
1565
1542
var suffix = "" ;
1566
- if ( match . Success )
1543
+ if ( match . Success )
1567
1544
{
1568
1545
suffix = match . Groups [ 1 ] . Value ;
1569
1546
}
1570
- if ( suffix == "tex" )
1547
+ if ( suffix == "tex" )
1571
1548
{
1572
1549
// Oh boy. Here we have to scrape the cache to find any custom modded roots(plural) we may have.
1573
1550
var customRoots = await GetModdedRoots ( internalFilePath ) ;
1574
- foreach ( var r in customRoots )
1551
+ foreach ( var r in customRoots )
1575
1552
{
1576
1553
roots . Add ( r ) ;
1577
1554
}
1578
1555
}
1579
1556
1580
- var info = ExtractRootInfo ( internalFilePath ) ;
1581
- var root = CreateDependencyRoot ( info ) ;
1582
- if ( root != null )
1583
- {
1584
- roots . Add ( root ) ;
1585
- }
1586
-
1587
-
1588
- if ( roots . Count == 0 )
1589
- {
1590
- // See if this is a binary offset file.
1591
- match = _binaryOffsetRegex . Match ( internalFilePath ) ;
1592
- if ( match . Success )
1593
- {
1594
- long offset = Int64 . Parse ( match . Groups [ 1 ] . Value ) ;
1595
-
1596
- if ( suffix == "imc" )
1597
- {
1598
- // IMCs mostly parse out correctly above, but need to have slot information pulled from their binary offset.
1599
- const int ImcHeaderSize = 4 ;
1600
- const int ImcSubEntrySize = 6 ;
1601
- const int IMcFullEntrySize = 30 ;
1602
-
1603
- offset /= 8 ;
1604
- offset -= ImcHeaderSize ;
1605
- offset = offset % IMcFullEntrySize ;
1606
- var index = offset / ImcSubEntrySize ;
1607
- if ( info . PrimaryType == XivItemType . equipment || info . PrimaryType == XivItemType . demihuman )
1608
- {
1609
- info . Slot = Imc . EquipmentSlotOffsetDictionary . First ( x => x . Value == index ) . Key ;
1610
- }
1611
- else // accesory
1612
- {
1613
- info . Slot = Imc . AccessorySlotOffsetDictionary . First ( x => x . Value == index ) . Key ;
1614
- }
1615
-
1616
- root = CreateDependencyRoot ( info ) ;
1617
- if ( root != null )
1618
- {
1619
- roots . Add ( root ) ;
1620
- }
1621
- }
1622
- else if ( suffix == "eqp" )
1623
- {
1624
- var entrySize = Eqp . EquipmentParameterEntrySize * 8 ;
1625
- var setId = ( int ) ( offset / entrySize ) ;
1626
-
1627
- var subOffset = ( offset % entrySize ) / 8 ;
1628
- var slot = EquipmentParameterSet . EntryOffsets . First ( x => x . Value == subOffset ) . Key ;
1629
-
1630
- root = CreateDependencyRoot ( XivItemType . equipment , setId , null , null , slot ) ;
1631
- if ( root != null )
1632
- {
1633
- roots . Add ( root ) ;
1634
- }
1635
-
1636
- } else if ( suffix == "eqdp" )
1637
- {
1638
- // For EQDPs, this is 16 bits per set, then within that, we can determine the slot based on the offset internally within the full set.
1639
- match = EqdpRegex . Match ( internalFilePath ) ;
1640
- if ( match . Success )
1641
- {
1642
- var type = ( XivItemType ) Enum . Parse ( typeof ( XivItemType ) , match . Groups [ 1 ] . Value ) ;
1643
- var entrySize = Eqp . EquipmentDeformerParameterEntrySize * 8 ;
1644
- var setId = ( int ) ( offset / entrySize ) ;
1645
-
1646
-
1647
- var slotOffset = offset % entrySize ;
1648
- var slotIndex = ( int ) ( slotOffset / 2 ) ; // 2 Bits per slot.
1649
-
1650
- var slots = EquipmentDeformationParameterSet . SlotsAsList ( type == XivItemType . accessory ) ;
1651
- var slot = slots [ slotIndex ] ;
1652
-
1653
- // Ok, now we have everything we need to create the root object.
1654
- return new List < XivDependencyRoot > ( ) { CreateDependencyRoot ( type , setId , null , null , slot ) } ;
1655
-
1656
- }
1657
-
1658
- }
1659
-
1660
- }
1661
- }
1662
1557
1663
1558
return roots . ToList ( ) ;
1664
1559
}
0 commit comments