@@ -68,6 +68,23 @@ public XivDependencyRootInfo GetOtherSlot(string slot)
68
68
} ;
69
69
}
70
70
71
+ public bool IsHumanMaterialVersionException ( )
72
+ {
73
+ if ( PrimaryType == XivItemType . human )
74
+ {
75
+ if ( SecondaryType != null &&
76
+ ( SecondaryType == XivItemType . tail || SecondaryType == XivItemType . body ) )
77
+ {
78
+ if ( PrimaryId == XivRace . Hrothgar_Female . GetRaceCodeInt ( )
79
+ || PrimaryId == XivRace . Hrothgar_Male . GetRaceCodeInt ( ) )
80
+ {
81
+ return true ;
82
+ }
83
+ }
84
+ }
85
+ return false ;
86
+ }
87
+
71
88
/// <summary>
72
89
/// Converts this dependency root into a raw string entry.
73
90
/// </summary>
@@ -733,9 +750,28 @@ public async Task<List<string>> GetMaterialFiles(int materialVariant = -1, ModTr
733
750
734
751
index = await tx . GetIndexFile ( df ) ;
735
752
modlist = await tx . GetModList ( ) ;
736
-
737
753
var materials = new HashSet < string > ( ) ;
738
- if ( Info . PrimaryType == XivItemType . human && Info . SecondaryType == XivItemType . body )
754
+
755
+ if ( Info . IsHumanMaterialVersionException ( ) )
756
+ {
757
+ // Special Hrothgar Cases.
758
+ var primary = Info . PrimaryId . ToString ( "D4" ) ;
759
+ var secondary = Info . SecondaryId . Value . ToString ( "D4" ) ;
760
+ var path = $ "chara/human/c{ primary } /obj/body/b{ secondary } /material/v0001/mt_c{ primary } b{ secondary } _a.mtrl";
761
+ if ( Info . SecondaryType == XivItemType . tail )
762
+ {
763
+ path = $ "chara/human/c{ primary } /obj/tail/t{ secondary } /material/v0001/mt_c{ primary } t{ secondary } _a.mtrl";
764
+ }
765
+
766
+ materials . Add ( path ) ;
767
+ for ( int i = 2 ; i <= 5 ; i ++ )
768
+ {
769
+ materials . Add ( path . Replace ( "/v0001/" , "/v000" + i + "/" ) ) ;
770
+ }
771
+
772
+ materialVariant = - 1 ;
773
+ }
774
+ else if ( Info . PrimaryType == XivItemType . human && Info . SecondaryType == XivItemType . body )
739
775
{
740
776
// Bleargh. So here's the exception of exception class. Because the "models" in human body are
741
777
// are so sparse and all over the place, relying on them is impossible. Thankfully, body types only ever
@@ -745,27 +781,12 @@ public async Task<List<string>> GetMaterialFiles(int materialVariant = -1, ModTr
745
781
var path = $ "chara/human/c{ primary } /obj/body/b{ body } /material/v0001/mt_c{ primary } b{ body } _a.mtrl";
746
782
747
783
// Just validate it exists and call it a day.
748
-
749
784
var exists = index . FileExists ( path ) ;
750
785
if ( exists )
751
786
{
752
787
materials . Add ( path ) ;
753
788
}
754
789
755
- // XXX: I noticed female hrothgar also have patterns so I'm gonna put them here too
756
- if ( Info . PrimaryId == XivRace . Hrothgar_Male . GetRaceCodeInt ( )
757
- || Info . PrimaryId == XivRace . Hrothgar_Female . GetRaceCodeInt ( )
758
- )
759
- {
760
- // JK, Hrothgar actually have 5 material sets (that's how their fur pattern stuff is set)
761
- for ( int i = 2 ; i <= 5 ; i ++ )
762
- {
763
- var mSet = i . ToString ( ) . PadLeft ( 4 , '0' ) ;
764
- path = $ "chara/human/c{ primary } /obj/body/b{ body } /material/v{ mSet } /mt_c{ primary } b{ body } _a.mtrl";
765
- materials . Add ( path ) ;
766
- }
767
- }
768
-
769
790
materialVariant = - 1 ;
770
791
}
771
792
else if ( Info . PrimaryType == XivItemType . human && Info . SecondaryType != XivItemType . hair && Info . SecondaryId > 100 )
0 commit comments