Blindness refactor (#15705)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Leon Friedrich
2023-04-29 17:32:14 +12:00
committed by GitHub
parent e0b809b62d
commit 84299cae63
34 changed files with 460 additions and 456 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Eye.Blinding;
using Content.Shared.Eye.Blinding.Components;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
@@ -22,8 +23,6 @@ public sealed class BlurryVisionSystem : EntitySystem
SubscribeLocalEvent<BlurryVisionComponent, PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<BlurryVisionComponent, PlayerDetachedEvent>(OnPlayerDetached);
SubscribeLocalEvent<BlurryVisionComponent, ComponentHandleState>(OnHandleState);
_overlay = new();
}
@@ -50,12 +49,4 @@ public sealed class BlurryVisionSystem : EntitySystem
_overlayMan.RemoveOverlay(_overlay);
}
}
private void OnHandleState(EntityUid uid, BlurryVisionComponent component, ref ComponentHandleState args)
{
if (args.Current is not BlurryVisionComponentState state)
return;
component.Magnitude = state.Magnitude;
}
}