Revert "Actions Rework" (#6888)
This commit is contained in:
@@ -104,7 +104,7 @@ namespace Content.Shared.Hands
|
||||
/// Raised when putting an entity into a hand slot
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public abstract class EquippedHandEvent : HandledEntityEventArgs
|
||||
public sealed class EquippedHandEvent : HandledEntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity that equipped the item.
|
||||
@@ -133,7 +133,7 @@ namespace Content.Shared.Hands
|
||||
/// Raised when removing an entity from an inventory slot.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public abstract class UnequippedHandEvent : HandledEntityEventArgs
|
||||
public sealed class UnequippedHandEvent : HandledEntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity that equipped the item.
|
||||
@@ -157,24 +157,4 @@ namespace Content.Shared.Hands
|
||||
Hand = hand;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class GotEquippedHandEvent : EquippedHandEvent
|
||||
{
|
||||
public GotEquippedHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
|
||||
}
|
||||
|
||||
public sealed class GotUnequippedHandEvent : UnequippedHandEvent
|
||||
{
|
||||
public GotUnequippedHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
|
||||
}
|
||||
|
||||
public sealed class DidEquipHandEvent : EquippedHandEvent
|
||||
{
|
||||
public DidEquipHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
|
||||
}
|
||||
|
||||
public sealed class DidUnequipHandEvent : UnequippedHandEvent
|
||||
{
|
||||
public DidUnequipHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,11 +92,10 @@ namespace Content.Shared.Hands
|
||||
|
||||
hands.Dirty();
|
||||
|
||||
var gotUnequipped = new GotUnequippedHandEvent(uid, entity, hand);
|
||||
RaiseLocalEvent(entity, gotUnequipped, false);
|
||||
|
||||
var didUnequip = new DidUnequipHandEvent(uid, entity, hand);
|
||||
RaiseLocalEvent(uid, didUnequip);
|
||||
var unequippedHandMessage = new UnequippedHandEvent(uid, entity, hand);
|
||||
RaiseLocalEvent(entity, unequippedHandMessage);
|
||||
if (unequippedHandMessage.Handled)
|
||||
return;
|
||||
|
||||
if (hand.Name == hands.ActiveHand)
|
||||
RaiseLocalEvent(entity, new HandDeselectedEvent(uid, entity), false);
|
||||
@@ -124,15 +123,11 @@ namespace Content.Shared.Hands
|
||||
|
||||
hands.Dirty();
|
||||
|
||||
var didEquip = new DidEquipHandEvent(uid, entity, hand);
|
||||
RaiseLocalEvent(uid, didEquip, false);
|
||||
var equippedHandMessage = new EquippedHandEvent(uid, entity, hand);
|
||||
RaiseLocalEvent(entity, equippedHandMessage);
|
||||
|
||||
var gotEquipped = new GotEquippedHandEvent(uid, entity, hand);
|
||||
RaiseLocalEvent(entity, gotEquipped);
|
||||
|
||||
// TODO this should REALLY be a cancellable thing, not a handled event.
|
||||
// If one of the interactions resulted in the item being dropped, return early.
|
||||
if (gotEquipped.Handled)
|
||||
if (equippedHandMessage.Handled)
|
||||
return;
|
||||
|
||||
if (hand.Name == hands.ActiveHand)
|
||||
|
||||
Reference in New Issue
Block a user