Add EntityWorldTargetAction (#29819)

* Add EntityWorldTargetAction initial implementation

* Update obsolete methods

* Partially working EntityWorldTargetAction

* Fix entity selection

* Move and clean up AfterInteract

* Fix building new walls

* Readd no entity or coordinates error

* Consolidate action validation code

* Add summaries to component

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
This commit is contained in:
ShadowCommander
2024-08-08 02:47:08 -07:00
committed by GitHub
parent 489efeb717
commit 1df84515c7
7 changed files with 266 additions and 19 deletions

View File

@@ -101,6 +101,13 @@ public sealed class RequestPerformActionEvent : EntityEventArgs
Action = action;
EntityCoordinatesTarget = entityCoordinatesTarget;
}
public RequestPerformActionEvent(NetEntity action, NetEntity entityTarget, NetCoordinates entityCoordinatesTarget)
{
Action = action;
EntityTarget = entityTarget;
EntityCoordinatesTarget = entityCoordinatesTarget;
}
}
/// <summary>
@@ -144,6 +151,27 @@ public abstract partial class WorldTargetActionEvent : BaseActionEvent
public EntityCoordinates Target;
}
/// <summary>
/// This is the type of event that gets raised when an <see cref="EntityWorldTargetActionComponent"/> is performed.
/// The <see cref="BaseActionEvent.Performer"/>, <see cref="Entity"/>, and <see cref="Coords"/>
/// fields will automatically be filled out by the <see cref="SharedActionsSystem"/>.
/// </summary>
/// <remarks>
/// To define a new action for some system, you need to create an event that inherits from this class.
/// </remarks>
public abstract partial class EntityWorldTargetActionEvent : BaseActionEvent
{
/// <summary>
/// The entity that the user targeted.
/// </summary>
public EntityUid? Entity;
/// <summary>
/// The coordinates of the location that the user targeted.
/// </summary>
public EntityCoordinates? Coords;
}
/// <summary>
/// Base class for events that are raised when an action gets performed. This should not generally be used outside of the action
/// system.