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

@@ -13,6 +13,7 @@ namespace Content.Client.Toggleable;
public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLightVisualsComponent>
{
[Dependency] private readonly SharedItemSystem _itemSys = default!;
[Dependency] private readonly SharedPointLightSystem _lights = default!;
public override void Initialize()
{
@@ -40,9 +41,11 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
if (TryComp(uid, out PointLightComponent? light))
{
DebugTools.Assert(!light.NetSyncEnabled, "light visualizers require point lights without net-sync");
light.Enabled = enabled;
_lights.SetEnabled(uid, enabled, light);
if (enabled && modulate)
light.Color = color;
{
_lights.SetColor(uid, color, light);
}
}
// update clothing & in-hand visuals.