-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ntr-access
- Loading branch information
Showing
68 changed files
with
778 additions
and
641 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
Content.Client/Movement/Systems/ClientSpriteMovementSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Content.Shared.Movement.Components; | ||
using Content.Shared.Movement.Systems; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Client.Movement.Systems; | ||
|
||
/// <summary> | ||
/// Controls the switching of motion and standing still animation | ||
/// </summary> | ||
public sealed class ClientSpriteMovementSystem : SharedSpriteMovementSystem | ||
{ | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
|
||
private EntityQuery<SpriteComponent> _spriteQuery; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
_spriteQuery = GetEntityQuery<SpriteComponent>(); | ||
|
||
SubscribeLocalEvent<SpriteMovementComponent, AfterAutoHandleStateEvent>(OnAfterAutoHandleState); | ||
} | ||
|
||
private void OnAfterAutoHandleState(Entity<SpriteMovementComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
if (!_spriteQuery.TryGetComponent(ent, out var sprite)) | ||
return; | ||
|
||
if (ent.Comp.IsMoving) | ||
{ | ||
foreach (var (layer, state) in ent.Comp.MovementLayers) | ||
{ | ||
sprite.LayerSetData(layer, state); | ||
} | ||
} | ||
else | ||
{ | ||
foreach (var (layer, state) in ent.Comp.NoMovementLayers) | ||
{ | ||
sprite.LayerSetData(layer, state); | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.