CatStation/Content.Client/Light/EntitySystems/EmergencyLightSystem.cs
DrSmugleaf 65f5f67cd5
Make every EntitySystem partial (#45220)
* Make every EntitySystem partial

* Oobs thats for a diff PR

* Also oops on that one

* Test systems

* git are we fr

* Update file templates

* cleanup empty classes while we are here

* forgor

---------

Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
2026-08-14 18:24:47 +00:00

26 lines
1.1 KiB
C#

using Content.Client.Light.Components;
using Content.Shared.Light.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Light.EntitySystems;
public sealed partial class EmergencyLightSystem : VisualizerSystem<EmergencyLightComponent>
{
protected override void OnAppearanceChange(EntityUid uid, EmergencyLightComponent comp, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
if (!AppearanceSystem.TryGetData<bool>(uid, EmergencyLightVisuals.On, out var on, args.Component))
on = false;
SpriteSystem.LayerSetVisible((uid, args.Sprite), EmergencyLightVisualLayers.LightOff, !on);
SpriteSystem.LayerSetVisible((uid, args.Sprite), EmergencyLightVisualLayers.LightOn, on);
if (AppearanceSystem.TryGetData<Color>(uid, EmergencyLightVisuals.Color, out var color, args.Component))
{
SpriteSystem.LayerSetColor((uid, args.Sprite), EmergencyLightVisualLayers.LightOn, color);
SpriteSystem.LayerSetColor((uid, args.Sprite), EmergencyLightVisualLayers.LightOff, color);
}
}
}