From: Tayrtahn Date: Sun, 21 Apr 2024 15:00:50 +0000 (-0400) Subject: Add clothing equipped/unequipped events (#27155) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=50631f430d62fc413bc8757f8d1e1c4523417816;p=space-station-14.git Add clothing equipped/unequipped events (#27155) * Added ClothingGotEquipped/ClothingGotUnequipped events * Better version * Implemented in a few places * More implementations * Add ClothingDidEquipped/ClothingDidUnequipped events --- diff --git a/Content.Server/Clothing/MagbootsSystem.cs b/Content.Server/Clothing/MagbootsSystem.cs index bc6880552f..f12558389e 100644 --- a/Content.Server/Clothing/MagbootsSystem.cs +++ b/Content.Server/Clothing/MagbootsSystem.cs @@ -1,7 +1,6 @@ using Content.Server.Atmos.Components; using Content.Shared.Alert; using Content.Shared.Clothing; -using Content.Shared.Inventory.Events; namespace Content.Server.Clothing; @@ -13,8 +12,8 @@ public sealed class MagbootsSystem : SharedMagbootsSystem { base.Initialize(); - SubscribeLocalEvent(OnGotEquipped); - SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnGotEquipped); + SubscribeLocalEvent(OnGotUnequipped); } protected override void UpdateMagbootEffects(EntityUid parent, EntityUid uid, bool state, MagbootsComponent? component) @@ -38,19 +37,13 @@ public sealed class MagbootsSystem : SharedMagbootsSystem } } - private void OnGotUnequipped(EntityUid uid, MagbootsComponent component, GotUnequippedEvent args) + private void OnGotUnequipped(EntityUid uid, MagbootsComponent component, ref ClothingGotUnequippedEvent args) { - if (args.Slot == "shoes") - { - UpdateMagbootEffects(args.Equipee, uid, false, component); - } + UpdateMagbootEffects(args.Wearer, uid, false, component); } - private void OnGotEquipped(EntityUid uid, MagbootsComponent component, GotEquippedEvent args) + private void OnGotEquipped(EntityUid uid, MagbootsComponent component, ref ClothingGotEquippedEvent args) { - if (args.Slot == "shoes") - { - UpdateMagbootEffects(args.Equipee, uid, true, component); - } + UpdateMagbootEffects(args.Wearer, uid, true, component); } } diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs index 7780e5d467..d02dd44e81 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs @@ -1,16 +1,14 @@ using Content.Server.Chemistry.Containers.EntitySystems; -using Content.Server.Fluids.Components; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reaction; using Content.Shared.Chemistry.Reagent; -using Content.Shared.Clothing.Components; +using Content.Shared.Clothing; using Content.Shared.CombatMode.Pacification; using Content.Shared.Database; using Content.Shared.FixedPoint; using Content.Shared.Fluids.Components; using Content.Shared.IdentityManagement; -using Content.Shared.Inventory.Events; using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Popups; using Content.Shared.Spillable; @@ -29,8 +27,8 @@ public sealed partial class PuddleSystem SubscribeLocalEvent(SpillOnLand); // Openable handles the event if it's closed SubscribeLocalEvent(SplashOnMeleeHit, after: [typeof(OpenableSystem)]); - SubscribeLocalEvent(OnGotEquipped); - SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnGotEquipped); + SubscribeLocalEvent(OnGotUnequipped); SubscribeLocalEvent(OnOverflow); SubscribeLocalEvent(OnDoAfter); SubscribeLocalEvent(OnAttemptPacifiedThrow); @@ -99,20 +97,11 @@ public sealed partial class PuddleSystem } } - private void OnGotEquipped(Entity entity, ref GotEquippedEvent args) + private void OnGotEquipped(Entity entity, ref ClothingGotEquippedEvent args) { if (!entity.Comp.SpillWorn) return; - if (!TryComp(entity, out ClothingComponent? clothing)) - return; - - // check if entity was actually used as clothing - // not just taken in pockets or something - var isCorrectSlot = clothing.Slots.HasFlag(args.SlotFlags); - if (!isCorrectSlot) - return; - if (!_solutionContainerSystem.TryGetSolution(entity.Owner, entity.Comp.SolutionName, out var soln, out var solution)) return; @@ -124,10 +113,10 @@ public sealed partial class PuddleSystem // spill all solution on the player var drainedSolution = _solutionContainerSystem.Drain(entity.Owner, soln.Value, solution.Volume); - TrySplashSpillAt(entity.Owner, Transform(args.Equipee).Coordinates, drainedSolution, out _); + TrySplashSpillAt(entity.Owner, Transform(args.Wearer).Coordinates, drainedSolution, out _); } - private void OnGotUnequipped(Entity entity, ref GotUnequippedEvent args) + private void OnGotUnequipped(Entity entity, ref ClothingGotUnequippedEvent args) { if (!entity.Comp.SpillWorn) return; diff --git a/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs b/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs index f1864bb3a1..b8304c562a 100644 --- a/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs +++ b/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs @@ -3,11 +3,10 @@ using Content.Server.Medical.Components; using Content.Server.Medical.Stethoscope.Components; using Content.Server.Popups; using Content.Shared.Actions; -using Content.Shared.Clothing.Components; +using Content.Shared.Clothing; using Content.Shared.Damage; using Content.Shared.DoAfter; using Content.Shared.FixedPoint; -using Content.Shared.Inventory.Events; using Content.Shared.Medical; using Content.Shared.Medical.Stethoscope; using Content.Shared.Mobs.Components; @@ -26,8 +25,8 @@ namespace Content.Server.Medical.Stethoscope public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnEquipped); - SubscribeLocalEvent(OnUnequipped); + SubscribeLocalEvent(OnEquipped); + SubscribeLocalEvent(OnUnequipped); SubscribeLocalEvent>(AddStethoscopeVerb); SubscribeLocalEvent(OnGetActions); SubscribeLocalEvent(OnStethoscopeAction); @@ -37,26 +36,20 @@ namespace Content.Server.Medical.Stethoscope /// /// Add the component the verb event subs to if the equippee is wearing the stethoscope. /// - private void OnEquipped(EntityUid uid, StethoscopeComponent component, GotEquippedEvent args) + private void OnEquipped(EntityUid uid, StethoscopeComponent component, ref ClothingGotEquippedEvent args) { - if (!TryComp(uid, out var clothing)) - return; - // Is the clothing in its actual slot? - if (!clothing.Slots.HasFlag(args.SlotFlags)) - return; - component.IsActive = true; - var wearingComp = EnsureComp(args.Equipee); + var wearingComp = EnsureComp(args.Wearer); wearingComp.Stethoscope = uid; } - private void OnUnequipped(EntityUid uid, StethoscopeComponent component, GotUnequippedEvent args) + private void OnUnequipped(EntityUid uid, StethoscopeComponent component, ref ClothingGotUnequippedEvent args) { if (!component.IsActive) return; - RemComp(args.Equipee); + RemComp(args.Wearer); component.IsActive = false; } diff --git a/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs b/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs index 9864badc62..38e88f6e1e 100644 --- a/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs +++ b/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs @@ -7,10 +7,10 @@ using Content.Server.GameTicking; using Content.Server.Medical.CrewMonitoring; using Content.Server.Popups; using Content.Server.Station.Systems; +using Content.Shared.Clothing; using Content.Shared.Damage; using Content.Shared.DeviceNetwork; using Content.Shared.Examine; -using Content.Shared.Inventory.Events; using Content.Shared.Medical.SuitSensor; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; @@ -40,8 +40,8 @@ public sealed class SuitSensorSystem : EntitySystem base.Initialize(); SubscribeLocalEvent(OnPlayerSpawn); SubscribeLocalEvent(OnMapInit); - SubscribeLocalEvent(OnEquipped); - SubscribeLocalEvent(OnUnequipped); + SubscribeLocalEvent(OnEquipped); + SubscribeLocalEvent(OnUnequipped); SubscribeLocalEvent(OnExamine); SubscribeLocalEvent>(OnVerb); SubscribeLocalEvent(OnInsert); @@ -160,19 +160,13 @@ public sealed class SuitSensorSystem : EntitySystem } } - private void OnEquipped(EntityUid uid, SuitSensorComponent component, GotEquippedEvent args) + private void OnEquipped(EntityUid uid, SuitSensorComponent component, ref ClothingGotEquippedEvent args) { - if (args.Slot != component.ActivationSlot) - return; - - component.User = args.Equipee; + component.User = args.Wearer; } - private void OnUnequipped(EntityUid uid, SuitSensorComponent component, GotUnequippedEvent args) + private void OnUnequipped(EntityUid uid, SuitSensorComponent component, ref ClothingGotUnequippedEvent args) { - if (args.Slot != component.ActivationSlot) - return; - component.User = null; } diff --git a/Content.Server/Speech/EntitySystems/AddAccentClothingSystem.cs b/Content.Server/Speech/EntitySystems/AddAccentClothingSystem.cs index 1f707c2249..897cd061f4 100644 --- a/Content.Server/Speech/EntitySystems/AddAccentClothingSystem.cs +++ b/Content.Server/Speech/EntitySystems/AddAccentClothingSystem.cs @@ -1,6 +1,5 @@ using Content.Server.Speech.Components; -using Content.Shared.Clothing.Components; -using Content.Shared.Inventory.Events; +using Content.Shared.Clothing; namespace Content.Server.Speech.EntitySystems; @@ -11,29 +10,20 @@ public sealed class AddAccentClothingSystem : EntitySystem public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnGotEquipped); - SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnGotEquipped); + SubscribeLocalEvent(OnGotUnequipped); } - private void OnGotEquipped(EntityUid uid, AddAccentClothingComponent component, GotEquippedEvent args) + private void OnGotEquipped(EntityUid uid, AddAccentClothingComponent component, ref ClothingGotEquippedEvent args) { - if (!TryComp(uid, out ClothingComponent? clothing)) - return; - - // check if entity was actually used as clothing - // not just taken in pockets or something - var isCorrectSlot = clothing.Slots.HasFlag(args.SlotFlags); - if (!isCorrectSlot) - return; - // does the user already has this accent? var componentType = _componentFactory.GetRegistration(component.Accent).Type; - if (HasComp(args.Equipee, componentType)) + if (HasComp(args.Wearer, componentType)) return; // add accent to the user var accentComponent = (Component) _componentFactory.GetComponent(componentType); - AddComp(args.Equipee, accentComponent); + AddComp(args.Wearer, accentComponent); // snowflake case for replacement accent if (accentComponent is ReplacementAccentComponent rep) @@ -42,16 +32,16 @@ public sealed class AddAccentClothingSystem : EntitySystem component.IsActive = true; } - private void OnGotUnequipped(EntityUid uid, AddAccentClothingComponent component, GotUnequippedEvent args) + private void OnGotUnequipped(EntityUid uid, AddAccentClothingComponent component, ref ClothingGotUnequippedEvent args) { if (!component.IsActive) return; // try to remove accent var componentType = _componentFactory.GetRegistration(component.Accent).Type; - if (EntityManager.HasComponent(args.Equipee, componentType)) + if (EntityManager.HasComponent(args.Wearer, componentType)) { - EntityManager.RemoveComponent(args.Equipee, componentType); + EntityManager.RemoveComponent(args.Wearer, componentType); } component.IsActive = false; diff --git a/Content.Server/VoiceMask/VoiceMaskSystem.Equip.cs b/Content.Server/VoiceMask/VoiceMaskSystem.Equip.cs index bd0c40f26a..b97c47ceef 100644 --- a/Content.Server/VoiceMask/VoiceMaskSystem.Equip.cs +++ b/Content.Server/VoiceMask/VoiceMaskSystem.Equip.cs @@ -1,6 +1,6 @@ using Content.Server.Actions; +using Content.Shared.Clothing; using Content.Shared.Inventory; -using Content.Shared.Inventory.Events; namespace Content.Server.VoiceMask; @@ -12,13 +12,9 @@ public sealed partial class VoiceMaskSystem private const string MaskSlot = "mask"; - private void OnEquip(EntityUid uid, VoiceMaskerComponent component, GotEquippedEvent args) + private void OnEquip(EntityUid uid, VoiceMaskerComponent component, ClothingGotEquippedEvent args) { - var user = args.Equipee; - // have to be wearing the mask to use it, duh. - if (!_inventory.TryGetSlotEntity(user, MaskSlot, out var maskEntity) || maskEntity != uid) - return; - + var user = args.Wearer; var comp = EnsureComp(user); comp.VoiceName = component.LastSetName; comp.SpeechVerb = component.LastSpeechVerb; @@ -26,9 +22,9 @@ public sealed partial class VoiceMaskSystem _actions.AddAction(user, ref component.ActionEntity, component.Action, uid); } - private void OnUnequip(EntityUid uid, VoiceMaskerComponent compnent, GotUnequippedEvent args) + private void OnUnequip(EntityUid uid, VoiceMaskerComponent compnent, ClothingGotUnequippedEvent args) { - RemComp(args.Equipee); + RemComp(args.Wearer); } private VoiceMaskerComponent? TryGetMask(EntityUid user) diff --git a/Content.Server/VoiceMask/VoiceMaskSystem.cs b/Content.Server/VoiceMask/VoiceMaskSystem.cs index ac16e92259..ad9020d324 100644 --- a/Content.Server/VoiceMask/VoiceMaskSystem.cs +++ b/Content.Server/VoiceMask/VoiceMaskSystem.cs @@ -3,7 +3,6 @@ using Content.Server.Chat.Systems; using Content.Server.Popups; using Content.Shared.Clothing; using Content.Shared.Database; -using Content.Shared.Inventory.Events; using Content.Shared.Popups; using Content.Shared.Preferences; using Content.Shared.Speech; @@ -27,8 +26,8 @@ public sealed partial class VoiceMaskSystem : EntitySystem SubscribeLocalEvent(OnChangeName); SubscribeLocalEvent(OnChangeVerb); SubscribeLocalEvent(OnMaskToggled); - SubscribeLocalEvent(OnEquip); - SubscribeLocalEvent(OnUnequip); + SubscribeLocalEvent(OnEquip); + SubscribeLocalEvent(OnUnequip); SubscribeLocalEvent(OnSetName); // SubscribeLocalEvent>(GetVerbs); } diff --git a/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs b/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs index 41ed4b1b2b..81ebcfb108 100644 --- a/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs +++ b/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs @@ -1,5 +1,4 @@ -using Content.Shared.Clothing.Components; -using Content.Shared.Inventory.Events; +using Content.Shared.Clothing; namespace Content.Shared.Chat.TypingIndicator; @@ -17,25 +16,21 @@ public abstract class SharedTypingIndicatorSystem : EntitySystem public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnGotEquipped); - SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnGotEquipped); + SubscribeLocalEvent(OnGotUnequipped); } - private void OnGotEquipped(EntityUid uid, TypingIndicatorClothingComponent component, GotEquippedEvent args) + private void OnGotEquipped(EntityUid uid, TypingIndicatorClothingComponent component, ClothingGotEquippedEvent args) { - if (!TryComp(uid, out var clothing) || - !TryComp(args.Equipee, out var indicator)) + if (!TryComp(args.Wearer, out var indicator)) return; - var isCorrectSlot = clothing.Slots.HasFlag(args.SlotFlags); - if (!isCorrectSlot) return; - indicator.Prototype = component.Prototype; } - private void OnGotUnequipped(EntityUid uid, TypingIndicatorClothingComponent component, GotUnequippedEvent args) + private void OnGotUnequipped(EntityUid uid, TypingIndicatorClothingComponent component, ClothingGotUnequippedEvent args) { - if (!TryComp(args.Equipee, out var indicator)) + if (!TryComp(args.Wearer, out var indicator)) return; indicator.Prototype = SharedTypingIndicatorSystem.InitialIndicatorId; diff --git a/Content.Shared/Clothing/ClothingEvents.cs b/Content.Shared/Clothing/ClothingEvents.cs index 1dcce2402a..83afea4597 100644 --- a/Content.Shared/Clothing/ClothingEvents.cs +++ b/Content.Shared/Clothing/ClothingEvents.cs @@ -1,5 +1,6 @@ using Content.Shared.Actions; +using Content.Shared.Clothing.Components; namespace Content.Shared.Clothing; @@ -71,3 +72,31 @@ public readonly record struct ItemMaskToggledEvent(EntityUid Wearer, string? equ /// [ByRefEvent] public readonly record struct WearerMaskToggledEvent(bool IsToggled); + +/// +/// Raised on the clothing entity when it is equipped to a valid slot, +/// as determined by . +/// +[ByRefEvent] +public readonly record struct ClothingGotEquippedEvent(EntityUid Wearer, ClothingComponent Clothing); + +/// +/// Raised on the clothing entity when it is unequipped from a valid slot, +/// as determined by . +/// +[ByRefEvent] +public readonly record struct ClothingGotUnequippedEvent(EntityUid Wearer, ClothingComponent Clothing); + +/// +/// Raised on an entity when they equip a clothing item to a valid slot, +/// as determined by . +/// +[ByRefEvent] +public readonly record struct ClothingDidEquippedEvent(Entity Clothing); + +/// +/// Raised on an entity when they unequip a clothing item from a valid slot, +/// as determined by . +/// +[ByRefEvent] +public readonly record struct ClothingDidUnequippedEvent(Entity Clothing); diff --git a/Content.Shared/Clothing/Components/ClothingComponent.cs b/Content.Shared/Clothing/Components/ClothingComponent.cs index 0f4c7f68bf..6d7226e767 100644 --- a/Content.Shared/Clothing/Components/ClothingComponent.cs +++ b/Content.Shared/Clothing/Components/ClothingComponent.cs @@ -66,6 +66,9 @@ public sealed partial class ClothingComponent : Component [DataField("unisexMask")] public ClothingMask UnisexMask = ClothingMask.UniformFull; + /// + /// Name of the inventory slot the clothing is in. + /// public string? InSlot; [DataField, ViewVariables(VVAccess.ReadWrite)] diff --git a/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs index f035453d0d..d85506df4b 100644 --- a/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs @@ -120,10 +120,28 @@ public abstract class ClothingSystem : EntitySystem { component.InSlot = args.Slot; CheckEquipmentForLayerHide(args.Equipment, args.Equipee); + + if ((component.Slots & args.SlotFlags) != SlotFlags.NONE) + { + var gotEquippedEvent = new ClothingGotEquippedEvent(args.Equipee, component); + RaiseLocalEvent(uid, ref gotEquippedEvent); + + var didEquippedEvent = new ClothingDidEquippedEvent((uid, component)); + RaiseLocalEvent(args.Equipee, ref didEquippedEvent); + } } protected virtual void OnGotUnequipped(EntityUid uid, ClothingComponent component, GotUnequippedEvent args) { + if ((component.Slots & args.SlotFlags) != SlotFlags.NONE) + { + var gotUnequippedEvent = new ClothingGotUnequippedEvent(args.Equipee, component); + RaiseLocalEvent(uid, ref gotUnequippedEvent); + + var didUnequippedEvent = new ClothingDidUnequippedEvent((uid, component)); + RaiseLocalEvent(args.Equipee, ref didUnequippedEvent); + } + component.InSlot = null; CheckEquipmentForLayerHide(args.Equipment, args.Equipee); } diff --git a/Content.Shared/Clothing/EntitySystems/SkatesSystem.cs b/Content.Shared/Clothing/EntitySystems/SkatesSystem.cs index 7d748a67a4..bbb640bd98 100644 --- a/Content.Shared/Clothing/EntitySystems/SkatesSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/SkatesSystem.cs @@ -17,34 +17,28 @@ public sealed class SkatesSystem : EntitySystem { base.Initialize(); - SubscribeLocalEvent(OnGotEquipped); - SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnGotEquipped); + SubscribeLocalEvent(OnGotUnequipped); } /// /// When item is unequipped from the shoe slot, friction, aceleration and collide on impact return to default settings. /// - public void OnGotUnequipped(EntityUid uid, SkatesComponent component, GotUnequippedEvent args) + public void OnGotUnequipped(EntityUid uid, SkatesComponent component, ClothingGotUnequippedEvent args) { - if (!TryComp(args.Equipee, out MovementSpeedModifierComponent? speedModifier)) + if (!TryComp(args.Wearer, out MovementSpeedModifierComponent? speedModifier)) return; - if (args.Slot == "shoes") - { - _move.ChangeFriction(args.Equipee, MovementSpeedModifierComponent.DefaultFriction, MovementSpeedModifierComponent.DefaultFrictionNoInput, MovementSpeedModifierComponent.DefaultAcceleration, speedModifier); - _impact.ChangeCollide(args.Equipee, component.DefaultMinimumSpeed, component.DefaultStunSeconds, component.DefaultDamageCooldown, component.DefaultSpeedDamage); - } + _move.ChangeFriction(args.Wearer, MovementSpeedModifierComponent.DefaultFriction, MovementSpeedModifierComponent.DefaultFrictionNoInput, MovementSpeedModifierComponent.DefaultAcceleration, speedModifier); + _impact.ChangeCollide(args.Wearer, component.DefaultMinimumSpeed, component.DefaultStunSeconds, component.DefaultDamageCooldown, component.DefaultSpeedDamage); } /// /// When item is equipped into the shoe slot, friction, acceleration and collide on impact are adjusted. /// - private void OnGotEquipped(EntityUid uid, SkatesComponent component, GotEquippedEvent args) + private void OnGotEquipped(EntityUid uid, SkatesComponent component, ClothingGotEquippedEvent args) { - if (args.Slot == "shoes") - { - _move.ChangeFriction(args.Equipee, component.Friction, component.FrictionNoInput, component.Acceleration); - _impact.ChangeCollide(args.Equipee, component.MinimumSpeed, component.StunSeconds, component.DamageCooldown, component.SpeedDamage); - } + _move.ChangeFriction(args.Wearer, component.Friction, component.FrictionNoInput, component.Acceleration); + _impact.ChangeCollide(args.Wearer, component.MinimumSpeed, component.StunSeconds, component.DamageCooldown, component.SpeedDamage); } } diff --git a/Content.Shared/Inventory/Events/UnequippedEvents.cs b/Content.Shared/Inventory/Events/UnequippedEvents.cs index ef607f071a..4e1764a7d2 100644 --- a/Content.Shared/Inventory/Events/UnequippedEvents.cs +++ b/Content.Shared/Inventory/Events/UnequippedEvents.cs @@ -22,12 +22,18 @@ public abstract class UnequippedEventBase : EntityEventArgs /// public readonly string SlotGroup; + /// + /// Slotflags of the slot the entity just got unequipped from. + /// + public readonly SlotFlags SlotFlags; + public UnequippedEventBase(EntityUid equipee, EntityUid equipment, SlotDefinition slotDefinition) { Equipee = equipee; Equipment = equipment; Slot = slotDefinition.Name; SlotGroup = slotDefinition.SlotGroup; + SlotFlags = slotDefinition.SlotFlags; } }