stealth clothing (#19397)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-08-30 03:34:58 +01:00
committed by GitHub
parent 15c0c25fbf
commit 7870d02254
5 changed files with 203 additions and 3 deletions

View File

@@ -20,6 +20,11 @@ public sealed class GetItemActionsEvent : EntityEventArgs
{
public SortedSet<ActionType> Actions = new();
/// <summary>
/// User equipping the item.
/// </summary>
public EntityUid User;
/// <summary>
/// Slot flags for the inventory slot that this item got equipped to. Null if not in a slot (i.e., if equipped to hands).
/// </summary>
@@ -30,8 +35,9 @@ public sealed class GetItemActionsEvent : EntityEventArgs
/// </summary>
public bool InHands => SlotFlags == null;
public GetItemActionsEvent(SlotFlags? slotFlags = null)
public GetItemActionsEvent(EntityUid user, SlotFlags? slotFlags = null)
{
User = user;
SlotFlags = slotFlags;
}
}

View File

@@ -410,7 +410,7 @@ public abstract class SharedActionsSystem : EntitySystem
#region EquipHandlers
private void OnDidEquip(EntityUid uid, ActionsComponent component, DidEquipEvent args)
{
var ev = new GetItemActionsEvent(args.SlotFlags);
var ev = new GetItemActionsEvent(args.Equipee, args.SlotFlags);
RaiseLocalEvent(args.Equipment, ev);
if (ev.Actions.Count == 0)
@@ -421,7 +421,7 @@ public abstract class SharedActionsSystem : EntitySystem
private void OnHandEquipped(EntityUid uid, ActionsComponent component, DidEquipHandEvent args)
{
var ev = new GetItemActionsEvent();
var ev = new GetItemActionsEvent(args.User);
RaiseLocalEvent(args.Equipped, ev);
if (ev.Actions.Count == 0)