mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* 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
26 lines
830 B
C#
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);
|
|
}
|
|
}
|