-using Content.Shared.Actions;
+using Content.Shared.Actions;
using Content.Shared.Clothing.Components;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
RaiseLocalEvent(uid, ref maskEv);
var wearerEv = new WearerMaskToggledEvent(mask.IsToggled);
- RaiseLocalEvent(uid, ref wearerEv);
+ RaiseLocalEvent(wearer, ref wearerEv);
}
}
-using Content.Shared.Inventory;
+using Content.Shared.Inventory;
using Robust.Shared.GameStates;
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>
/// </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;
}
private void OnSeeIdentity(EntityUid uid, IdentityBlockerComponent component, SeeIdentityAttemptEvent args)
{
if (component.Enabled)
- args.Cancel();
+ {
+ args.TotalCoverage |= component.Coverage;
+ if(args.TotalCoverage == IdentityBlockerCoverage.FULL)
+ args.Cancel();
+ }
}
protected virtual void OnComponentInit(EntityUid uid, IdentityComponent component, ComponentInit args)
sprite: Clothing/Eyes/Glasses/outlawglasses.rsi
- type: VisionCorrection
- type: IdentityBlocker
+ coverage: EYES
- type: entity
parent: ClothingEyesBase
tags:
- HamsterWearable
- WhitelistChameleon
+ - type: IdentityBlocker
+ coverage: EYES
- type: entity
parent: ClothingEyesBase
guides:
- Security
- type: ShowSecurityIcons
+ - type: IdentityBlocker
+ coverage: EYES
- type: entity
parent: ClothingEyesBase