Remove IInteractHand (#7601)
* Plantholder * Strap * Finish him * Mirror review stuff
This commit is contained in:
@@ -1,24 +1,7 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Shared.Interaction
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on by a user with an empty hand
|
||||
/// who is in range and has unobstructed reach of the target entity (allows inside blockers).
|
||||
/// </summary>
|
||||
[RequiresExplicitImplementation]
|
||||
public interface IInteractHand
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when a player directly interacts with an empty hand when user is in range of the target entity.
|
||||
/// </summary>
|
||||
[Obsolete("Use InteractHandEvent instead")]
|
||||
bool InteractHand(InteractHandEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public sealed class InteractHandEventArgs : EventArgs, ITargetedInteractEventArgs
|
||||
{
|
||||
public InteractHandEventArgs(EntityUid user, EntityUid target)
|
||||
@@ -272,17 +272,6 @@ namespace Content.Shared.Interaction
|
||||
if (message.Handled)
|
||||
return;
|
||||
|
||||
var interactHandEventArgs = new InteractHandEventArgs(user, target);
|
||||
var interactHandComps = AllComps<IInteractHand>(target).ToList();
|
||||
foreach (var interactHandComp in interactHandComps)
|
||||
{
|
||||
// If an InteractHand returns a status completion we finish our interaction
|
||||
#pragma warning disable 618
|
||||
if (interactHandComp.InteractHand(interactHandEventArgs))
|
||||
#pragma warning restore 618
|
||||
return;
|
||||
}
|
||||
|
||||
// Else we run Activate.
|
||||
InteractionActivate(user, target,
|
||||
checkCanInteract: false,
|
||||
@@ -439,7 +428,7 @@ namespace Content.Shared.Interaction
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
Ignored? predicate = null,
|
||||
bool popup = false)
|
||||
{;
|
||||
{;
|
||||
Ignored combinedPredicate = e => e == origin || (predicate?.Invoke(e) ?? false);
|
||||
|
||||
var inRange = InRangeUnobstructed(Transform(origin).MapPosition, other, range, collisionMask, combinedPredicate);
|
||||
|
||||
Reference in New Issue
Block a user