From b2b8f2b6ebc5fa54b4051c204ae11a05aa6e716a Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sun, 17 Aug 2025 10:43:26 +0200 Subject: [PATCH] Make glamourers visor toggle trigger static visors. (?!?) --- Glamourer/Interop/VisorService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Glamourer/Interop/VisorService.cs b/Glamourer/Interop/VisorService.cs index 25823b6..83262e4 100644 --- a/Glamourer/Interop/VisorService.cs +++ b/Glamourer/Interop/VisorService.cs @@ -9,9 +9,9 @@ namespace Glamourer.Interop; public class VisorService : IDisposable { - private readonly PenumbraReloaded _penumbra; - private readonly IGameInteropProvider _interop; - public readonly VisorStateChanged Event; + private readonly PenumbraReloaded _penumbra; + private readonly IGameInteropProvider _interop; + public readonly VisorStateChanged Event; public VisorService(VisorStateChanged visorStateChanged, IGameInteropProvider interop, PenumbraReloaded penumbra) { @@ -36,7 +36,7 @@ public class VisorService : IDisposable /// The draw object. /// The desired state (true: toggled). /// Whether the state was changed. - public bool SetVisorState(Model human, bool on) + public unsafe bool SetVisorState(Model human, bool on) { if (!human.IsHuman) return false; @@ -46,6 +46,8 @@ public class VisorService : IDisposable if (oldState == on) return false; + // No clue what this flag does, but it's necessary for toggling static visors on or off, e.g. Alternate Cap (6229-1). + human.AsHuman->StateFlags |= (CharacterBase.StateFlag)0x40000000; SetupVisorDetour(human, human.GetArmor(EquipSlot.Head).Set.Id, on); return true; }