]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup warnings in `ExpendableLightSystem` (#37415)
authorTayrtahn <tayrtahn@gmail.com>
Tue, 13 May 2025 15:41:18 +0000 (11:41 -0400)
committerGitHub <noreply@github.com>
Tue, 13 May 2025 15:41:18 +0000 (11:41 -0400)
Cleanup warnings in ExpendableLightSystem

Content.Client/Light/EntitySystems/ExpendableLightSystem.cs

index 4d52b0933d4cf52168803e93bef8aefb93c85841..bc4c85cca719d1a2357f5284a4ae47fdcda55dac 100644 (file)
@@ -1,8 +1,6 @@
 using Content.Client.Light.Components;
 using Content.Shared.Light.Components;
 using Robust.Client.GameObjects;
-using Robust.Client.Graphics;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 
 namespace Content.Client.Light.EntitySystems;
@@ -12,6 +10,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
     [Dependency] private readonly PointLightSystem _pointLightSystem = default!;
     [Dependency] private readonly SharedAudioSystem _audioSystem = default!;
     [Dependency] private readonly LightBehaviorSystem _lightBehavior = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
 
     public override void Initialize()
     {
@@ -31,7 +30,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
             return;
 
         if (AppearanceSystem.TryGetData<string>(uid, ExpendableLightVisuals.Behavior, out var lightBehaviourID, args.Component)
-        &&  TryComp<LightBehaviourComponent>(uid, out var lightBehaviour))
+            && TryComp<LightBehaviourComponent>(uid, out var lightBehaviour))
         {
             _lightBehavior.StopLightBehaviour((uid, lightBehaviour));
 
@@ -55,37 +54,37 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
                 comp.PlayingStream = _audioSystem.PlayPvs(
                     comp.LoopedSound, uid)?.Entity;
 
-                if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out var layerIdx, true))
+                if (_sprite.LayerMapTryGet((uid, args.Sprite), ExpendableLightVisualLayers.Overlay, out var layerIdx, true))
                 {
                     if (!string.IsNullOrWhiteSpace(comp.IconStateLit))
-                        args.Sprite.LayerSetState(layerIdx, comp.IconStateLit);
+                        _sprite.LayerSetRsiState((uid, args.Sprite), layerIdx, comp.IconStateLit);
                     if (!string.IsNullOrWhiteSpace(comp.SpriteShaderLit))
                         args.Sprite.LayerSetShader(layerIdx, comp.SpriteShaderLit);
                     else
                         args.Sprite.LayerSetShader(layerIdx, null, null);
                     if (comp.GlowColorLit.HasValue)
-                        args.Sprite.LayerSetColor(layerIdx, comp.GlowColorLit.Value);
-                    args.Sprite.LayerSetVisible(layerIdx, true);
+                        _sprite.LayerSetColor((uid, args.Sprite), layerIdx, comp.GlowColorLit.Value);
+                    _sprite.LayerSetVisible((uid, args.Sprite), layerIdx, true);
                 }
 
                 if (comp.GlowColorLit.HasValue)
-                    args.Sprite.LayerSetColor(ExpendableLightVisualLayers.Glow, comp.GlowColorLit.Value);
-                args.Sprite.LayerSetVisible(ExpendableLightVisualLayers.Glow, true);
+                    _sprite.LayerSetColor((uid, args.Sprite), ExpendableLightVisualLayers.Glow, comp.GlowColorLit.Value);
+                _sprite.LayerSetVisible((uid, args.Sprite), ExpendableLightVisualLayers.Glow, true);
 
                 break;
             case ExpendableLightState.Dead:
                 comp.PlayingStream = _audioSystem.Stop(comp.PlayingStream);
-                if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out layerIdx, true))
+                if (_sprite.LayerMapTryGet((uid, args.Sprite), ExpendableLightVisualLayers.Overlay, out layerIdx, true))
                 {
                     if (!string.IsNullOrWhiteSpace(comp.IconStateSpent))
-                        args.Sprite.LayerSetState(layerIdx, comp.IconStateSpent);
+                        _sprite.LayerSetRsiState((uid, args.Sprite), layerIdx, comp.IconStateSpent);
                     if (!string.IsNullOrWhiteSpace(comp.SpriteShaderSpent))
                         args.Sprite.LayerSetShader(layerIdx, comp.SpriteShaderSpent);
                     else
                         args.Sprite.LayerSetShader(layerIdx, null, null);
                 }
 
-                args.Sprite.LayerSetVisible(ExpendableLightVisualLayers.Glow, false);
+                _sprite.LayerSetVisible((uid, args.Sprite), ExpendableLightVisualLayers.Glow, false);
                 break;
         }
     }