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