forked from space-syndicate/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'next-origin/master' into Upstream5
- Loading branch information
Showing
58 changed files
with
428 additions
and
610 deletions.
There are no files selected for viewing
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,47 @@ | ||
using Content.Shared._CorvaxNext.Footprints; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client._CorvaxNext.Footprints; | ||
|
||
public sealed class FootprintSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<FootprintComponent, ComponentStartup>(OnComponentStartup); | ||
SubscribeNetworkEvent<FootprintChangedEvent>(OnFootprintChanged); | ||
} | ||
|
||
private void OnComponentStartup(Entity<FootprintComponent> entity, ref ComponentStartup e) | ||
{ | ||
UpdateSprite(entity, entity); | ||
} | ||
|
||
private void OnFootprintChanged(FootprintChangedEvent e) | ||
{ | ||
if (!TryGetEntity(e.Entity, out var entity)) | ||
return; | ||
|
||
if (!TryComp<FootprintComponent>(entity, out var footprint)) | ||
return; | ||
|
||
UpdateSprite(entity.Value, footprint); | ||
} | ||
|
||
private void UpdateSprite(EntityUid entity, FootprintComponent footprint) | ||
{ | ||
if (!TryComp<SpriteComponent>(entity, out var sprite)) | ||
return; | ||
|
||
for (var i = 0; i < footprint.Footprints.Count; i++) | ||
{ | ||
if (!sprite.LayerExists(i, false)) | ||
sprite.AddBlankLayer(i); | ||
|
||
sprite.LayerSetOffset(i, footprint.Footprints[i].Offset); | ||
sprite.LayerSetRotation(i, footprint.Footprints[i].Rotation); | ||
sprite.LayerSetColor(i, footprint.Footprints[i].Color); | ||
sprite.LayerSetSprite(i, new SpriteSpecifier.Rsi(new("/Textures/_CorvaxNext/Effects/footprint.rsi"), footprint.Footprints[i].State)); | ||
} | ||
} | ||
} |
75 changes: 0 additions & 75 deletions
75
Content.Client/_CorvaxNext/Footprints/FootprintsVisualizerSystem.cs
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
Oops, something went wrong.