Rename and clean up interaction events (#4044)
* Rename and clean up interaction events * Fix hand equip events
This commit is contained in:
@@ -67,12 +67,12 @@ namespace Content.Shared.GameObjects.Components.Buckle
|
||||
return !Buckled;
|
||||
}
|
||||
|
||||
bool IDraggable.CanDrop(CanDropEventArgs args)
|
||||
bool IDraggable.CanDrop(CanDropEvent args)
|
||||
{
|
||||
return args.Target.HasComponent<SharedStrapComponent>();
|
||||
}
|
||||
|
||||
bool IDraggable.Drop(DragDropEventArgs args)
|
||||
bool IDraggable.Drop(DragDropEvent args)
|
||||
{
|
||||
return TryBuckle(args.User, args.Target);
|
||||
}
|
||||
|
||||
@@ -187,11 +187,11 @@ namespace Content.Shared.GameObjects.Components.Disposal
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool CanDragDropOn(DragDropEventArgs eventArgs)
|
||||
public virtual bool CanDragDropOn(DragDropEvent eventArgs)
|
||||
{
|
||||
return CanInsert(eventArgs.Dragged);
|
||||
}
|
||||
|
||||
public abstract bool DragDropOn(DragDropEventArgs eventArgs);
|
||||
public abstract bool DragDropOn(DragDropEvent eventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@ namespace Content.Shared.GameObjects.Components.GUI
|
||||
&& ActionBlockerSystem.CanInteract(by);
|
||||
}
|
||||
|
||||
bool IDraggable.CanDrop(CanDropEventArgs args)
|
||||
bool IDraggable.CanDrop(CanDropEvent args)
|
||||
{
|
||||
return args.Target != args.Dragged
|
||||
&& args.Target == args.User
|
||||
&& CanBeStripped(args.User);
|
||||
}
|
||||
|
||||
public abstract bool Drop(DragDropEventArgs args);
|
||||
public abstract bool Drop(DragDropEvent args);
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum StrippingUiKey
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace Content.Shared.GameObjects.Components.GUI
|
||||
{
|
||||
public override string Name => "Stripping";
|
||||
|
||||
bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs)
|
||||
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
|
||||
{
|
||||
if (!eventArgs.Dragged.TryGetComponent(out SharedStrippableComponent? strippable)) return false;
|
||||
return strippable.CanBeStripped(Owner);
|
||||
}
|
||||
|
||||
bool IDragDropOn.DragDropOn(DragDropEventArgs eventArgs)
|
||||
bool IDragDropOn.DragDropOn(DragDropEvent eventArgs)
|
||||
{
|
||||
// Handled by StrippableComponent
|
||||
return true;
|
||||
|
||||
@@ -80,11 +80,11 @@ namespace Content.Shared.GameObjects.Components.Medical
|
||||
}
|
||||
|
||||
|
||||
bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs)
|
||||
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
|
||||
{
|
||||
return eventArgs.Dragged.HasComponent<IBody>();
|
||||
}
|
||||
|
||||
public abstract bool DragDropOn(DragDropEventArgs eventArgs);
|
||||
public abstract bool DragDropOn(DragDropEvent eventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
/// </summary>
|
||||
[ViewVariables] [DataField("range")] protected float Range = SharedInteractionSystem.InteractionRange / 1.4f;
|
||||
|
||||
public virtual bool CanDragDropOn(DragDropEventArgs eventArgs)
|
||||
public virtual bool CanDragDropOn(DragDropEvent eventArgs)
|
||||
{
|
||||
return eventArgs.Dragged.HasComponent<SharedClimbingComponent>();
|
||||
}
|
||||
|
||||
public abstract bool DragDropOn(DragDropEventArgs eventArgs);
|
||||
public abstract bool DragDropOn(DragDropEvent eventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Shared.GameObjects.Components.Nutrition
|
||||
[DataField("meat")]
|
||||
private string? _meatPrototype;
|
||||
|
||||
public bool CanDrop(CanDropEventArgs args)
|
||||
public bool CanDrop(CanDropEvent args)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,13 +24,13 @@ namespace Content.Shared.GameObjects.Components.Storage
|
||||
/// <returns>True if no longer in storage, false otherwise</returns>
|
||||
public abstract bool Remove(IEntity entity);
|
||||
|
||||
bool IDraggable.CanDrop(CanDropEventArgs args)
|
||||
bool IDraggable.CanDrop(CanDropEvent args)
|
||||
{
|
||||
return args.Target.TryGetComponent(out SharedPlaceableSurfaceComponent? placeable) &&
|
||||
placeable.IsPlaceable;
|
||||
}
|
||||
|
||||
bool IDraggable.Drop(DragDropEventArgs eventArgs)
|
||||
bool IDraggable.Drop(DragDropEvent eventArgs)
|
||||
{
|
||||
if (!ActionBlockerSystem.CanInteract(eventArgs.User))
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Shared.GameObjects.Components.Strap
|
||||
|
||||
public sealed override uint? NetID => ContentNetIDs.STRAP;
|
||||
|
||||
bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs)
|
||||
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
|
||||
{
|
||||
if (!eventArgs.Dragged.TryGetComponent(out SharedBuckleComponent? buckleComponent)) return false;
|
||||
bool Ignored(IEntity entity) => entity == eventArgs.User || entity == eventArgs.Dragged || entity == eventArgs.Target;
|
||||
@@ -40,7 +40,7 @@ namespace Content.Shared.GameObjects.Components.Strap
|
||||
return eventArgs.Target.InRangeUnobstructed(eventArgs.Dragged, buckleComponent.Range, predicate: Ignored);
|
||||
}
|
||||
|
||||
public abstract bool DragDropOn(DragDropEventArgs eventArgs);
|
||||
public abstract bool DragDropOn(DragDropEvent eventArgs);
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
Reference in New Issue
Block a user