Chameleon clothing hides identity (#12642)
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Server.IdentityManagement;
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Shared.Clothing.EntitySystems;
|
||||
using Content.Shared.IdentityManagement.Components;
|
||||
using Content.Shared.Prototypes;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameStates;
|
||||
@@ -11,6 +14,8 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly IComponentFactory _factory = default!;
|
||||
[Dependency] private readonly IdentitySystem _identity = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -91,8 +96,20 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem
|
||||
return;
|
||||
component.SelectedId = protoId;
|
||||
|
||||
UpdateIdentityBlocker(uid, component, proto);
|
||||
UpdateVisuals(uid, component);
|
||||
UpdateUi(uid, component);
|
||||
Dirty(component);
|
||||
}
|
||||
|
||||
private void UpdateIdentityBlocker(EntityUid uid, ChameleonClothingComponent component, EntityPrototype proto)
|
||||
{
|
||||
if (proto.HasComponent<IdentityBlockerComponent>(_factory))
|
||||
EnsureComp<IdentityBlockerComponent>(uid);
|
||||
else
|
||||
RemComp<IdentityBlockerComponent>(uid);
|
||||
|
||||
if (component.User != null)
|
||||
_identity.QueueIdentityUpdate(component.User.Value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user