mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +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
1 KiB
C#
26 lines
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 (!args.TryGetData<bool>(EmergencyLightVisuals.On, out var on))
|
|
on = false;
|
|
|
|
SpriteSystem.LayerSetVisible((uid, args.Sprite), EmergencyLightVisualLayers.LightOff, !on);
|
|
SpriteSystem.LayerSetVisible((uid, args.Sprite), EmergencyLightVisualLayers.LightOn, on);
|
|
|
|
if (args.TryGetData<Color>(EmergencyLightVisuals.Color, out var color))
|
|
{
|
|
SpriteSystem.LayerSetColor((uid, args.Sprite), EmergencyLightVisualLayers.LightOn, color);
|
|
SpriteSystem.LayerSetColor((uid, args.Sprite), EmergencyLightVisualLayers.LightOff, color);
|
|
}
|
|
}
|
|
}
|