Chameleon clothing hides identity (#12642)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -13,6 +14,23 @@ public abstract class SharedChameleonClothingSystem : EntitySystem
|
||||
[Dependency] private readonly SharedItemSystem _itemSystem = default!;
|
||||
[Dependency] private readonly ClothingSystem _clothingSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ChameleonClothingComponent, GotEquippedEvent>(OnGotEquipped);
|
||||
SubscribeLocalEvent<ChameleonClothingComponent, GotUnequippedEvent>(OnGotUnequipped);
|
||||
}
|
||||
|
||||
private void OnGotEquipped(EntityUid uid, ChameleonClothingComponent component, GotEquippedEvent args)
|
||||
{
|
||||
component.User = args.Equipee;
|
||||
}
|
||||
|
||||
private void OnGotUnequipped(EntityUid uid, ChameleonClothingComponent component, GotUnequippedEvent args)
|
||||
{
|
||||
component.User = null;
|
||||
}
|
||||
|
||||
// Updates chameleon visuals and meta information.
|
||||
// This function is called on a server after user selected new outfit.
|
||||
// And after that on a client after state was updated.
|
||||
|
||||
Reference in New Issue
Block a user