mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Add global EQP edits to always hide horns or ears.
This commit is contained in:
parent
fefa3852f7
commit
861cbc7759
4 changed files with 51 additions and 8 deletions
|
|
@ -15,6 +15,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
|
|||
private readonly HashSet<PrimaryId> _doNotHideRingR = [];
|
||||
private bool _doNotHideVieraHats;
|
||||
private bool _doNotHideHrothgarHats;
|
||||
private bool _hideAuRaHorns;
|
||||
private bool _hideVieraEars;
|
||||
private bool _hideMiqoteEars;
|
||||
|
||||
public new void Clear()
|
||||
{
|
||||
|
|
@ -26,6 +29,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
|
|||
_doNotHideRingR.Clear();
|
||||
_doNotHideHrothgarHats = false;
|
||||
_doNotHideVieraHats = false;
|
||||
_hideAuRaHorns = false;
|
||||
_hideVieraEars = false;
|
||||
_hideMiqoteEars = false;
|
||||
}
|
||||
|
||||
public unsafe EqpEntry Apply(EqpEntry original, CharacterArmor* armor)
|
||||
|
|
@ -39,8 +45,20 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
|
|||
if (_doNotHideHrothgarHats)
|
||||
original |= EqpEntry.HeadShowHrothgarHat;
|
||||
|
||||
if (_hideAuRaHorns)
|
||||
original &= ~EqpEntry.HeadShowEarAuRa;
|
||||
|
||||
if (_hideVieraEars)
|
||||
original &= ~EqpEntry.HeadShowEarViera;
|
||||
|
||||
if (_hideMiqoteEars)
|
||||
original &= ~EqpEntry.HeadShowEarMiqote;
|
||||
|
||||
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))
|
||||
original |= EqpEntry.BodyShowNecklace | EqpEntry.HeadShowNecklace;
|
||||
|
|
@ -53,6 +71,7 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
|
|||
|
||||
if (_doNotHideRingL.Contains(armor[9].Set))
|
||||
original |= EqpEntry.HandShowRingL;
|
||||
|
||||
return original;
|
||||
}
|
||||
|
||||
|
|
@ -71,6 +90,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
|
|||
GlobalEqpType.DoNotHideRingL => _doNotHideRingL.Add(manipulation.Condition),
|
||||
GlobalEqpType.DoNotHideHrothgarHats => !_doNotHideHrothgarHats && (_doNotHideHrothgarHats = true),
|
||||
GlobalEqpType.DoNotHideVieraHats => !_doNotHideVieraHats && (_doNotHideVieraHats = true),
|
||||
GlobalEqpType.HideHorns => !_hideAuRaHorns && (_hideAuRaHorns = true),
|
||||
GlobalEqpType.HideMiqoteEars => !_hideMiqoteEars && (_hideMiqoteEars = true),
|
||||
GlobalEqpType.HideVieraEars => !_hideVieraEars && (_hideVieraEars = true),
|
||||
_ => false,
|
||||
};
|
||||
return true;
|
||||
|
|
@ -90,6 +112,9 @@ public class GlobalEqpCache : ReadWriteDictionary<GlobalEqpManipulation, IMod>,
|
|||
GlobalEqpType.DoNotHideRingL => _doNotHideRingL.Remove(manipulation.Condition),
|
||||
GlobalEqpType.DoNotHideHrothgarHats => _doNotHideHrothgarHats && !(_doNotHideHrothgarHats = false),
|
||||
GlobalEqpType.DoNotHideVieraHats => _doNotHideVieraHats && !(_doNotHideVieraHats = false),
|
||||
GlobalEqpType.HideHorns => _hideAuRaHorns && (_hideAuRaHorns = false),
|
||||
GlobalEqpType.HideMiqoteEars => _hideMiqoteEars && (_hideMiqoteEars = false),
|
||||
GlobalEqpType.HideVieraEars => _hideVieraEars && (_hideVieraEars = false),
|
||||
_ => false,
|
||||
};
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ public readonly struct GlobalEqpManipulation : IMetaIdentifier
|
|||
if (!Enum.IsDefined(Type))
|
||||
return false;
|
||||
|
||||
if (Type is GlobalEqpType.DoNotHideVieraHats or GlobalEqpType.DoNotHideHrothgarHats)
|
||||
return Condition == 0;
|
||||
if (Type.HasCondition())
|
||||
return Condition.Id is not 0;
|
||||
|
||||
return Condition != 0;
|
||||
return Condition.Id is 0;
|
||||
}
|
||||
|
||||
public JObject AddToJson(JObject jObj)
|
||||
|
|
@ -89,6 +89,12 @@ public readonly struct GlobalEqpManipulation : IMetaIdentifier
|
|||
changedItems.UpdateCountOrSet("All Hats for Viera", () => new IdentifiedName());
|
||||
else if (Type is GlobalEqpType.DoNotHideHrothgarHats)
|
||||
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()
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ public enum GlobalEqpType
|
|||
DoNotHideRingL,
|
||||
DoNotHideHrothgarHats,
|
||||
DoNotHideVieraHats,
|
||||
HideHorns,
|
||||
HideVieraEars,
|
||||
HideMiqoteEars,
|
||||
}
|
||||
|
||||
public static class GlobalEqpExtensions
|
||||
|
|
@ -27,6 +30,9 @@ public static class GlobalEqpExtensions
|
|||
GlobalEqpType.DoNotHideRingL => true,
|
||||
GlobalEqpType.DoNotHideHrothgarHats => false,
|
||||
GlobalEqpType.DoNotHideVieraHats => false,
|
||||
GlobalEqpType.HideHorns => false,
|
||||
GlobalEqpType.HideVieraEars => false,
|
||||
GlobalEqpType.HideMiqoteEars => false,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
|
|
@ -41,6 +47,9 @@ public static class GlobalEqpExtensions
|
|||
GlobalEqpType.DoNotHideRingL => "Always Show Rings (Left Finger)"u8,
|
||||
GlobalEqpType.DoNotHideHrothgarHats => "Always Show Hats for Hrothgar"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,
|
||||
};
|
||||
|
||||
|
|
@ -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,
|
||||
GlobalEqpType.DoNotHideVieraHats =>
|
||||
"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,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"$ref": "meta_enums.json#U16"
|
||||
},
|
||||
"Type": {
|
||||
"enum": [ "DoNotHideEarrings", "DoNotHideNecklace", "DoNotHideBracelets", "DoNotHideRingR", "DoNotHideRingL", "DoNotHideHrothgarHats", "DoNotHideVieraHats" ]
|
||||
"enum": [ "DoNotHideEarrings", "DoNotHideNecklace", "DoNotHideBracelets", "DoNotHideRingR", "DoNotHideRingL", "DoNotHideHrothgarHats", "DoNotHideVieraHats", "HideHorns", "HideVieraEars", "HideMiqoteEars" ]
|
||||
}
|
||||
},
|
||||
"required": [ "Type" ],
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
{
|
||||
"properties": {
|
||||
"Type": {
|
||||
"const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats" ]
|
||||
"const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats", "HideHorns", "HideVieraEars", "HideMiqoteEars" ]
|
||||
},
|
||||
"Condition": {
|
||||
"const": 0
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
{
|
||||
"properties": {
|
||||
"Type": {
|
||||
"const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats" ]
|
||||
"const": [ "DoNotHideHrothgarHats", "DoNotHideVieraHats", "HideHorns", "HideVieraEars", "HideMiqoteEars" ]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue