Remove lights compref (#19531)

This commit is contained in:
metalgearsloth
2023-09-11 19:18:06 +10:00
committed by GitHub
parent d315ce3c8c
commit 99b77bc2d3
64 changed files with 222 additions and 132 deletions

View File

@@ -6,6 +6,8 @@ namespace Content.Client.Power.APC;
public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
{
[Dependency] private readonly SharedPointLightSystem _lights = default!;
protected override void OnAppearanceChange(EntityUid uid, ApcVisualsComponent comp, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
@@ -43,8 +45,10 @@ public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
}
}
if (TryComp<SharedPointLightComponent>(uid, out var light))
light.Color = comp.ScreenColors[(sbyte)chargeState];
if (TryComp<PointLightComponent>(uid, out var light))
{
_lights.SetColor(uid, comp.ScreenColors[(sbyte)chargeState], light);
}
}
else
{
@@ -61,8 +65,10 @@ public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
args.Sprite.LayerSetVisible(layer, false);
}
if (TryComp<SharedPointLightComponent>(uid, out var light))
light.Color = comp.EmaggedScreenColor;
if (TryComp<PointLightComponent>(uid, out var light))
{
_lights.SetColor(uid, comp.EmaggedScreenColor, light);
}
}
}
}