ECS dragdrop (#12973)

* ECS dragdrop

No more excuses.

* AAAAAAAAAAAAAA

* kry

* events

* aaaaaaaaaa

* HUH

* Fix stripping

* aaaaaa

* spoike

* asease

* fix table vaulting

* ded

* rebiew

* aaaaaaaaaaaaa

* drag

* aeaeae

* weh
This commit is contained in:
metalgearsloth
2023-02-14 00:29:34 +11:00
committed by GitHub
parent 4183b5f449
commit c8f89eca60
53 changed files with 936 additions and 1079 deletions

View File

@@ -0,0 +1,67 @@
namespace Content.Shared.DragDrop;
/// <summary>
/// Raised directed on an entity when attempting to start a drag.
/// </summary>
[ByRefEvent]
public record struct CanDragEvent
{
/// <summary>
/// False if we are unable to drag this entity.
/// </summary>
public bool Handled;
}
/// <summary>
/// Raised directed on a dragged entity to indicate whether it has interactions with the target entity.
/// </summary>
[ByRefEvent]
public record struct CanDropDraggedEvent(EntityUid User, EntityUid Target)
{
public readonly EntityUid User = User;
public readonly EntityUid Target = Target;
public bool Handled = false;
/// <summary>
/// Can we drop the entity onto the target? If the event is not handled then there is no supported interactions.
/// </summary>
public bool CanDrop = false;
}
/// <summary>
/// Raised directed on the target entity to indicate whether it has interactions with the dragged entity.
/// </summary>
[ByRefEvent]
public record struct CanDropTargetEvent(EntityUid User, EntityUid Dragged)
{
public readonly EntityUid User = User;
public readonly EntityUid Dragged = Dragged;
public bool Handled = false;
/// <summary>
/// <see cref="CanDropDraggedEvent"/>
/// </summary>
public bool CanDrop = false;
}
/// <summary>
/// Raised directed on a dragged entity when it is dropped on a target entity.
/// </summary>
[ByRefEvent]
public record struct DragDropDraggedEvent(EntityUid User, EntityUid Target)
{
public readonly EntityUid User = User;
public readonly EntityUid Target = Target;
public bool Handled = false;
}
/// <summary>
/// Raised directed on the target entity when a dragged entity is dragged onto it.
/// </summary>
[ByRefEvent]
public record struct DragDropTargetEvent(EntityUid User, EntityUid Dragged)
{
public readonly EntityUid User = User;
public readonly EntityUid Dragged = Dragged;
public bool Handled = false;
}