Remove IAfterInteract (#9715)
* remove gas analyzer iafterinteract * solution transfer + obsolete * cuffable * remove
This commit is contained in:
@@ -208,34 +208,6 @@ namespace Content.Shared.Examine
|
||||
return InRangeUnOccluded(originPos, other, range, predicate, ignoreInsideBlocker);
|
||||
}
|
||||
|
||||
public static bool InRangeUnOccluded(ITargetedInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||
{
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
var originPos = entMan.GetComponent<TransformComponent>(args.User).MapPosition;
|
||||
var otherPos = entMan.GetComponent<TransformComponent>(args.Target).MapPosition;
|
||||
|
||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||
}
|
||||
|
||||
public static bool InRangeUnOccluded(DragDropEvent args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||
{
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
var originPos = entMan.GetComponent<TransformComponent>(args.User).MapPosition;
|
||||
var otherPos = args.DropLocation.ToMap(entMan);
|
||||
|
||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||
}
|
||||
|
||||
public static bool InRangeUnOccluded(AfterInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();;
|
||||
var originPos = entityManager.GetComponent<TransformComponent>(args.User).MapPosition;
|
||||
var target = args.Target;
|
||||
var otherPos = (target != null ? entityManager.GetComponent<TransformComponent>(target.Value).MapPosition : args.ClickLocation.ToMap(entityManager));
|
||||
|
||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||
}
|
||||
|
||||
public FormattedMessage GetExamineText(EntityUid entity, EntityUid? examiner)
|
||||
{
|
||||
var message = new FormattedMessage();
|
||||
|
||||
@@ -5,43 +5,6 @@ using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Shared.Interaction
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface gives components a behavior when their entity is in the active hand, when
|
||||
/// clicking on another object and no interaction occurs, at any range. This includes
|
||||
/// clicking on an object in the world as well as clicking on an object in inventory.
|
||||
/// </summary>
|
||||
[RequiresExplicitImplementation]
|
||||
public interface IAfterInteract
|
||||
{
|
||||
/// <summary>
|
||||
/// The interaction priority. Higher numbers get called first.
|
||||
/// </summary>
|
||||
/// <value>Priority defaults to 0</value>
|
||||
int Priority => 0;
|
||||
|
||||
/// <summary>
|
||||
/// Called when we interact with nothing, or when we interact with an entity out of range that has no behavior
|
||||
/// </summary>
|
||||
[Obsolete("Use AfterInteractMessage instead")]
|
||||
Task<bool> AfterInteract(AfterInteractEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public sealed class AfterInteractEventArgs : EventArgs
|
||||
{
|
||||
public EntityUid User { get; }
|
||||
public EntityCoordinates ClickLocation { get; }
|
||||
public EntityUid? Target { get; }
|
||||
public bool CanReach { get; }
|
||||
|
||||
public AfterInteractEventArgs(EntityUid user, EntityCoordinates clickLocation, EntityUid? target, bool canReach)
|
||||
{
|
||||
User = user;
|
||||
ClickLocation = clickLocation;
|
||||
Target = target;
|
||||
CanReach = canReach;
|
||||
}
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public abstract class InteractEvent : HandledEntityEventArgs
|
||||
{
|
||||
@@ -343,37 +343,5 @@ namespace Content.Shared.Interaction.Helpers
|
||||
ignoreInsideBlocker);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region EventArgs
|
||||
public static bool InRangeUnOccluded(
|
||||
this ITargetedInteractEventArgs args,
|
||||
float range = InteractionRange,
|
||||
Ignored? predicate = null,
|
||||
bool ignoreInsideBlocker = true)
|
||||
{
|
||||
return ExamineSystemShared.InRangeUnOccluded(args, range, predicate,
|
||||
ignoreInsideBlocker);
|
||||
}
|
||||
|
||||
public static bool InRangeUnOccluded(
|
||||
this DragDropEvent args,
|
||||
float range = InteractionRange,
|
||||
Ignored? predicate = null,
|
||||
bool ignoreInsideBlocker = true)
|
||||
{
|
||||
return ExamineSystemShared.InRangeUnOccluded(args, range, predicate,
|
||||
ignoreInsideBlocker);
|
||||
}
|
||||
|
||||
public static bool InRangeUnOccluded(
|
||||
this AfterInteractEventArgs args,
|
||||
float range = InteractionRange,
|
||||
Ignored? predicate = null,
|
||||
bool ignoreInsideBlocker = true)
|
||||
{
|
||||
return ExamineSystemShared.InRangeUnOccluded(args, range, predicate,
|
||||
ignoreInsideBlocker);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Content.Shared.Popups
|
||||
/// <param name="source">The entity above which the message will appear.</param>
|
||||
/// <param name="viewer">The entity that will see the message.</param>
|
||||
/// <param name="message">The message to show.</param>
|
||||
[Obsolete("Use PopupSystem.PopupEntity instead.")]
|
||||
public static void PopupMessage(this EntityUid source, EntityUid viewer, string message)
|
||||
{
|
||||
var popupSystem = EntitySystem.Get<SharedPopupSystem>();
|
||||
@@ -24,6 +25,7 @@ namespace Content.Shared.Popups
|
||||
/// </summary>
|
||||
/// <param name="viewer">The entity that will see the message.</param>
|
||||
/// <param name="message">The message to be seen.</param>
|
||||
[Obsolete("Use PopupSystem.PopupEntity instead.")]
|
||||
public static void PopupMessage(this EntityUid viewer, string message)
|
||||
{
|
||||
viewer.PopupMessage(viewer, message);
|
||||
@@ -35,6 +37,7 @@ namespace Content.Shared.Popups
|
||||
/// <param name="coordinates">Location on a grid that the message floats up from.</param>
|
||||
/// <param name="viewer">The client attached entity that the message is being sent to.</param>
|
||||
/// <param name="message">Text contents of the message.</param>
|
||||
[Obsolete("Use PopupSystem.PopupCoordinates instead.")]
|
||||
public static void PopupMessage(this EntityCoordinates coordinates, EntityUid viewer, string message)
|
||||
{
|
||||
var popupSystem = EntitySystem.Get<SharedPopupSystem>();
|
||||
@@ -48,6 +51,7 @@ namespace Content.Shared.Popups
|
||||
/// The client attached entity that the message is being sent to.
|
||||
/// </param>
|
||||
/// <param name="message">Text contents of the message.</param>
|
||||
[Obsolete("Use PopupSystem.PopupCursor instead.")]
|
||||
public static void PopupMessageCursor(this EntityUid viewer, string message)
|
||||
{
|
||||
var popupSystem = EntitySystem.Get<SharedPopupSystem>();
|
||||
|
||||
Reference in New Issue
Block a user