Add sprite movement states (#22940)

* Add sprite movement states

Did it for borgs for reference for future implementations.

* Fix

* Fix prediction issue

* review
This commit is contained in:
metalgearsloth
2023-12-25 18:34:21 +11:00
committed by GitHub
parent 721a445bbd
commit 9a40cf81f5
13 changed files with 227 additions and 25 deletions

View File

@@ -0,0 +1,22 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Movement.Components;
/// <summary>
/// Updates a sprite layer based on whether an entity is moving via input or not.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class SpriteMovementComponent : Component
{
/// <summary>
/// Layer and sprite state to use when moving.
/// </summary>
[DataField]
public Dictionary<string, PrototypeLayerData> MovementLayers = new();
/// <summary>
/// Layer and sprite state to use when not moving.
/// </summary>
[DataField]
public Dictionary<string, PrototypeLayerData> NoMovementLayers = new();
}