Allow IdentityBlocker partial coverage (#24741)

* Allow IdentityBlocker partial coverage

* rename to TotalCoverage
This commit is contained in:
themias
2024-01-30 22:49:19 -05:00
committed by GitHub
parent bd46d7cc8a
commit d75f6c3db4
5 changed files with 35 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
using Content.Shared.Inventory;
using Content.Shared.Inventory;
using Robust.Shared.GameStates;
namespace Content.Shared.IdentityManagement.Components;
@@ -7,6 +7,20 @@ namespace Content.Shared.IdentityManagement.Components;
public sealed partial class IdentityBlockerComponent : Component
{
public bool Enabled = true;
/// <summary>
/// What part of your face does this cover? Eyes, mouth, or full?
/// </summary>
[DataField]
public IdentityBlockerCoverage Coverage = IdentityBlockerCoverage.FULL;
}
public enum IdentityBlockerCoverage
{
NONE = 0,
MOUTH = 1 << 0,
EYES = 1 << 1,
FULL = MOUTH | EYES
}
/// <summary>
@@ -14,6 +28,9 @@ public sealed partial class IdentityBlockerComponent : Component
/// </summary>
public sealed class SeeIdentityAttemptEvent : CancellableEntityEventArgs, IInventoryRelayEvent
{
// i.e. masks or helmets.
public SlotFlags TargetSlots => SlotFlags.MASK | SlotFlags.HEAD;
// i.e. masks, helmets, or glasses.
public SlotFlags TargetSlots => SlotFlags.MASK | SlotFlags.HEAD | SlotFlags.EYES;
// cumulative coverage from each relayed slot
public IdentityBlockerCoverage TotalCoverage = IdentityBlockerCoverage.NONE;
}