6
2026-01-24 12:49:55 +03:00

33 lines
932 B
C#

using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
namespace Content.Shared.Movement.Events;
/// <summary>
/// Raised on an entity whenever it has a movement input change.
/// </summary>
[ByRefEvent]
public readonly struct MoveInputEvent
{
public readonly Entity<InputMoverComponent> Entity;
public readonly MoveButtons OldMovement;
public bool HasDirectionalMovement => (Entity.Comp.HeldMoveButtons & MoveButtons.AnyDirection) != MoveButtons.None;
public MoveInputEvent(Entity<InputMoverComponent> entity, MoveButtons oldMovement)
{
Entity = entity;
OldMovement = oldMovement;
}
}
// WD EDIT START
/// <summary>
/// Raised on an entity whenever it has a sprinting input change.
/// </summary>
public readonly struct SprintingInputEvent(Entity<InputMoverComponent> entity)
{
public readonly Entity<InputMoverComponent> Entity = entity;
}
// WD EDIT END