Remove lights compref (#19531)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user