CatStation/Content.Client/StationTeleporter/StationTeleporterSystem.cs
Whatstone d9ffbf1d03
Cleanup: AppearanceSystem.TryGetData to AppearanceChangeEvent.TryGetData (#45373)
* First impl. of appearance TryGetData cleanup

* Handful of fixes

* DamageVisuals: fix HandleDamage call, inheritdoc

* bunch of unused AppearanceSystem instances

* Handful more unused appearance systems, inheritdoc

* JetpackSystem: Ent<T>

* cleanup roundup, more Ent<T>

* a few lingering AppearanceSystem.TryGetData calls

* more lingering AppearanceData access

* Remove unnecessary inheritdoc

* once again, with feeling
2026-10-05 00:45:37 +00:00

26 lines
830 B
C#

using Content.Shared.StationTeleporter;
using Content.Shared.StationTeleporter.Components;
using Robust.Client.GameObjects;
namespace Content.Client.StationTeleporter;
/// <inheritdoc/>
public sealed partial class StationTeleporterSystem : SharedStationTeleporterSystem
{
[Dependency] private SpriteSystem _sprite = default!;
[SubscribeLocalEvent]
private void OnAppearanceChanged(Entity<StationTeleporterComponent> ent, ref AppearanceChangeEvent args)
{
if (ent.Comp.PortalLayerMap is null)
return;
if (!args.TryGetData<Color>(TeleporterPortalVisuals.Color, out var newColor))
return;
if (!_sprite.LayerMapTryGet(ent.Owner, ent.Comp.PortalLayerMap, out var index, false))
return;
_sprite.LayerSetColor(ent.Owner, index, newColor);
}
}