Add global EQP edits to always hide horns or ears.

This commit is contained in:
Ottermandias 2025-05-20 17:05:49 +02:00
parent fefa3852f7
commit 861cbc7759
4 changed files with 51 additions and 8 deletions

View file

@ -15,6 +15,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
private readonly HashSet<PrimaryId> _doNotHideRingR = []; private readonly HashSet<PrimaryId> _doNotHideRingR = [];
private bool _doNotHideVieraHats; private bool _doNotHideVieraHats;
private bool _doNotHideHrothgarHats; private bool _doNotHideHrothgarHats;
private bool _hideAuRaHorns;
private bool _hideVieraEars;
private bool _hideMiqoteEars;
public new void Clear() public new void Clear()
{ {
@ -26,6 +29,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
_doNotHideRingR.Clear(); _doNotHideRingR.Clear();
_doNotHideHrothgarHats = false; _doNotHideHrothgarHats = false;
_doNotHideVieraHats = false; _doNotHideVieraHats = false;
_hideAuRaHorns = false;
_hideVieraEars = false;
_hideMiqoteEars = false;
} }
public unsafe EqpEntry Apply(EqpEntry original, CharacterArmor* armor) public unsafe EqpEntry Apply(EqpEntry original, CharacterArmor* armor)
@ -39,8 +45,20 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
if (_doNotHideHrothgarHats) if (_doNotHideHrothgarHats)
original |= EqpEntry.HeadShowHrothgarHat; original |= EqpEntry.HeadShowHrothgarHat;
if (_hideAuRaHorns)
original &= ~EqpEntry.HeadShowEarAuRa;
if (_hideVieraEars)
original &= ~EqpEntry.HeadShowEarViera;
if (_hideMiqoteEars)
original &= ~EqpEntry.HeadShowEarMiqote;
if (_doNotHideEarrings.Contains(armor[5].Set)) if (_doNotHideEarrings.Contains(armor[5].Set))
original |= EqpEntry.HeadShowEarringsHyurRoe | EqpEntry.HeadShowEarringsLalaElezen | EqpEntry.HeadShowEarringsMiqoHrothViera | EqpEntry.HeadShowEarringsAura; original |= EqpEntry.HeadShowEarringsHyurRoe
| EqpEntry.HeadShowEarringsLalaElezen
| EqpEntry.HeadShowEarringsMiqoHrothViera
| EqpEntry.HeadShowEarringsAura;
if (_doNotHideNecklace.Contains(armor[6].Set)) if (_doNotHideNecklace.Contains(armor[6].Set))
original |= EqpEntry.BodyShowNecklace | EqpEntry.HeadShowNecklace; original |= EqpEntry.BodyShowNecklace | EqpEntry.HeadShowNecklace;
@ -53,6 +71,7 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
if (_doNotHideRingL.Contains(armor[9].Set)) if (_doNotHideRingL.Contains(armor[9].Set))
original |= EqpEntry.HandShowRingL; original |= EqpEntry.HandShowRingL;
return original; return original;
} }
@ -71,6 +90,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
GlobalEqpType.DoNotHideRingL => _doNotHideRingL.Add(manipulation.Condition), GlobalEqpType.DoNotHideRingL => _doNotHideRingL.Add(manipulation.Condition),
GlobalEqpType.DoNotHideHrothgarHats => !_doNotHideHrothgarHats && (_doNotHideHrothgarHats = true), GlobalEqpType.DoNotHideHrothgarHats => !_doNotHideHrothgarHats && (_doNotHideHrothgarHats = true),
GlobalEqpType.DoNotHideVieraHats => !_doNotHideVieraHats && (_doNotHideVieraHats = true), GlobalEqpType.DoNotHideVieraHats => !_doNotHideVieraHats && (_doNotHideVieraHats = true),
GlobalEqpType.HideHorns => !_hideAuRaHorns && (_hideAuRaHorns = true),
GlobalEqpType.HideMiqoteEars => !_hideMiqoteEars && (_hideMiqoteEars = true),
GlobalEqpType.HideVieraEars => !_hideVieraEars && (_hideVieraEars = true),
_ => false, _ => false,
}; };
return true; return true;
@ -90,6 +112,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
GlobalEqpType.DoNotHideRingL => _doNotHideRingL.Remove(manipulation.Condition), GlobalEqpType.DoNotHideRingL => _doNotHideRingL.Remove(manipulation.Condition),
GlobalEqpType.DoNotHideHrothgarHats => _doNotHideHrothgarHats && !(_doNotHideHrothgarHats = false), GlobalEqpType.DoNotHideHrothgarHats => _doNotHideHrothgarHats && !(_doNotHideHrothgarHats = false),
GlobalEqpType.DoNotHideVieraHats => _doNotHideVieraHats && !(_doNotHideVieraHats = false), GlobalEqpType.DoNotHideVieraHats => _doNotHideVieraHats && !(_doNotHideVieraHats = false),
GlobalEqpType.HideHorns => _hideAuRaHorns && (_hideAuRaHorns = false),
GlobalEqpType.HideMiqoteEars => _hideMiqoteEars && (_hideMiqoteEars = false),
GlobalEqpType.HideVieraEars => _hideVieraEars && (_hideVieraEars = false),
_ => false, _ => false,
}; };
return true; return true;

View file

@ -16,10 +16,10 @@ public readonly struct GlobalEqpManipulation : IMetaIdentifier
if (!Enum.IsDefined(Type)) if (!Enum.IsDefined(Type))
return false; return false;
if (Type is GlobalEqpType.DoNotHideVieraHats or GlobalEqpType.DoNotHideHrothgarHats) if (Type.HasCondition())
return Condition == 0; return Condition.Id is not 0;
return Condition != 0; return Condition.Id is 0;
} }
public JObject AddToJson(JObject jObj) public JObject AddToJson(JObject jObj)
@ -89,6 +89,12 @@ public readonly struct GlobalEqpManipulation : IMetaIdentifier
changedItems.UpdateCountOrSet("All Hats for Viera", () => new IdentifiedName()); changedItems.UpdateCountOrSet("All Hats for Viera", () => new IdentifiedName());
else if (Type is GlobalEqpType.DoNotHideHrothgarHats) else if (Type is GlobalEqpType.DoNotHideHrothgarHats)
changedItems.UpdateCountOrSet("All Hats for Hrothgar", () => new IdentifiedName()); changedItems.UpdateCountOrSet("All Hats for Hrothgar", () => new IdentifiedName());
else if (Type is GlobalEqpType.HideHorns)
changedItems.UpdateCountOrSet("All Au Ra Horns", () => new IdentifiedName());
else if (Type is GlobalEqpType.HideVieraEars)
changedItems.UpdateCountOrSet("All Viera Ears", () => new IdentifiedName());
else if (Type is GlobalEqpType.HideMiqoteEars)
changedItems.UpdateCountOrSet("All Miqo'te Ears", () => new IdentifiedName());
} }
public MetaIndex FileIndex() public MetaIndex FileIndex()

View file

@ -13,6 +13,9 @@ public enum GlobalEqpType
DoNotHideRingL, DoNotHideRingL,
DoNotHideHrothgarHats, DoNotHideHrothgarHats,
DoNotHideVieraHats, DoNotHideVieraHats,
HideHorns,
HideVieraEars,
HideMiqoteEars,
} }
public static class GlobalEqpExtensions public static class GlobalEqpExtensions
@ -27,6 +30,9 @@ public static class GlobalEqpExtensions
GlobalEqpType.DoNotHideRingL => true, GlobalEqpType.DoNotHideRingL => true,
GlobalEqpType.DoNotHideHrothgarHats => false, GlobalEqpType.DoNotHideHrothgarHats => false,
GlobalEqpType.DoNotHideVieraHats => false, GlobalEqpType.DoNotHideVieraHats => false,
GlobalEqpType.HideHorns => false,
GlobalEqpType.HideVieraEars => false,
GlobalEqpType.HideMiqoteEars => false,
_ => false, _ => false,
}; };
@ -41,6 +47,9 @@ public static class GlobalEqpExtensions
GlobalEqpType.DoNotHideRingL => "Always Show Rings (Left Finger)"u8, GlobalEqpType.DoNotHideRingL => "Always Show Rings (Left Finger)"u8,
GlobalEqpType.DoNotHideHrothgarHats => "Always Show Hats for Hrothgar"u8, GlobalEqpType.DoNotHideHrothgarHats => "Always Show Hats for Hrothgar"u8,
GlobalEqpType.DoNotHideVieraHats => "Always Show Hats for Viera"u8, GlobalEqpType.DoNotHideVieraHats => "Always Show Hats for Viera"u8,
GlobalEqpType.HideHorns => "Always Hide Horns (Au Ra)"u8,
GlobalEqpType.HideVieraEars => "Always Hide Ears (Viera)"u8,
GlobalEqpType.HideMiqoteEars => "Always Hide Ears (Miqo'te)"u8,
_ => "\0"u8, _ => "\0"u8,
}; };
@ -60,6 +69,9 @@ public static class GlobalEqpExtensions
"Prevents the game from hiding any hats for Hrothgar that are normally flagged to not display on them."u8, "Prevents the game from hiding any hats for Hrothgar that are normally flagged to not display on them."u8,
GlobalEqpType.DoNotHideVieraHats => GlobalEqpType.DoNotHideVieraHats =>
"Prevents the game from hiding any hats for Viera that are normally flagged to not display on them."u8, "Prevents the game from hiding any hats for Viera that are normally flagged to not display on them."u8,
_ => "\0"u8, GlobalEqpType.HideHorns => "Forces the game to hide Au Ra horns regardless of headwear."u8,
GlobalEqpType.HideVieraEars => "Forces the game to hide Viera ears regardless of headwear."u8,
GlobalEqpType.HideMiqoteEars => "Forces the game to hide Miqo'te ears regardless of headwear."u8,
_ => "\0"u8,
}; };
} }

View file

@ -6,7 +6,7 @@
"$ref": "meta_enums.json#U16" "$ref": "meta_enums.json#U16"
}, },
"Type": { "Type": {
"enum": [ "DoNotHideEarrings", "DoNotHideNecklace", "DoNotHideBracelets", "DoNotHideRingR", "DoNotHideRingL", "DoNotHideHrothgarHats", "DoNotHideVieraHats" ] "enum": [ "DoNotHideEarrings", "DoNotHideNecklace", "DoNotHideBracelets", "DoNotHideRingR", "DoNotHideRingL", "DoNotHideHrothgarHats", "DoNotHideVieraHats", "HideHorns", "HideVieraEars", "HideMiqoteEars" ]
} }
}, },
"required": [ "Type" ], "required": [ "Type" ],
@ -14,7 +14,7 @@
{ {
"properties": { "properties": {
"Type": { "Type": {
"const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats" ] "const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats", "HideHorns", "HideVieraEars", "HideMiqoteEars" ]
}, },
"Condition": { "Condition": {
"const": 0 "const": 0
@ -24,7 +24,7 @@
{ {
"properties": { "properties": {
"Type": { "Type": {
"const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats" ] "const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats", "HideHorns", "HideVieraEars", "HideMiqoteEars" ]
} }
} }
}, },