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
30 lines
1 KiB
C#
30 lines
1 KiB
C#
using Content.Shared.SurveillanceCamera;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.SurveillanceCamera;
|
|
|
|
public sealed partial class SurveillanceCameraVisualsSystem : EntitySystem
|
|
{
|
|
[Dependency] private SpriteSystem _sprite = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SurveillanceCameraVisualsComponent, AppearanceChangeEvent>(OnAppearanceChange);
|
|
}
|
|
|
|
private void OnAppearanceChange(EntityUid uid, SurveillanceCameraVisualsComponent component,
|
|
ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null
|
|
|| !args.TryGetData<SurveillanceCameraVisuals>(SurveillanceCameraVisualsKey.Key, out var key)
|
|
|| !_sprite.LayerMapTryGet((uid, args.Sprite), SurveillanceCameraVisualsKey.Layer, out var layer, false)
|
|
|| !component.CameraSprites.TryGetValue(key, out var state))
|
|
{
|
|
return;
|
|
}
|
|
|
|
_sprite.LayerSetRsiState((uid, args.Sprite), layer, state);
|
|
}
|
|
}
|