Cleanup warnings in ExpendableLightSystem (#37415)
Cleanup warnings in ExpendableLightSystem
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
using Content.Client.Light.Components;
|
using Content.Client.Light.Components;
|
||||||
using Content.Shared.Light.Components;
|
using Content.Shared.Light.Components;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
|
|
||||||
namespace Content.Client.Light.EntitySystems;
|
namespace Content.Client.Light.EntitySystems;
|
||||||
@@ -12,6 +10,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
|
|||||||
[Dependency] private readonly PointLightSystem _pointLightSystem = default!;
|
[Dependency] private readonly PointLightSystem _pointLightSystem = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||||
[Dependency] private readonly LightBehaviorSystem _lightBehavior = default!;
|
[Dependency] private readonly LightBehaviorSystem _lightBehavior = default!;
|
||||||
|
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -31,7 +30,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (AppearanceSystem.TryGetData<string>(uid, ExpendableLightVisuals.Behavior, out var lightBehaviourID, args.Component)
|
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));
|
_lightBehavior.StopLightBehaviour((uid, lightBehaviour));
|
||||||
|
|
||||||
@@ -55,37 +54,37 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
|
|||||||
comp.PlayingStream = _audioSystem.PlayPvs(
|
comp.PlayingStream = _audioSystem.PlayPvs(
|
||||||
comp.LoopedSound, uid)?.Entity;
|
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))
|
if (!string.IsNullOrWhiteSpace(comp.IconStateLit))
|
||||||
args.Sprite.LayerSetState(layerIdx, comp.IconStateLit);
|
_sprite.LayerSetRsiState((uid, args.Sprite), layerIdx, comp.IconStateLit);
|
||||||
if (!string.IsNullOrWhiteSpace(comp.SpriteShaderLit))
|
if (!string.IsNullOrWhiteSpace(comp.SpriteShaderLit))
|
||||||
args.Sprite.LayerSetShader(layerIdx, comp.SpriteShaderLit);
|
args.Sprite.LayerSetShader(layerIdx, comp.SpriteShaderLit);
|
||||||
else
|
else
|
||||||
args.Sprite.LayerSetShader(layerIdx, null, null);
|
args.Sprite.LayerSetShader(layerIdx, null, null);
|
||||||
if (comp.GlowColorLit.HasValue)
|
if (comp.GlowColorLit.HasValue)
|
||||||
args.Sprite.LayerSetColor(layerIdx, comp.GlowColorLit.Value);
|
_sprite.LayerSetColor((uid, args.Sprite), layerIdx, comp.GlowColorLit.Value);
|
||||||
args.Sprite.LayerSetVisible(layerIdx, true);
|
_sprite.LayerSetVisible((uid, args.Sprite), layerIdx, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comp.GlowColorLit.HasValue)
|
if (comp.GlowColorLit.HasValue)
|
||||||
args.Sprite.LayerSetColor(ExpendableLightVisualLayers.Glow, comp.GlowColorLit.Value);
|
_sprite.LayerSetColor((uid, args.Sprite), ExpendableLightVisualLayers.Glow, comp.GlowColorLit.Value);
|
||||||
args.Sprite.LayerSetVisible(ExpendableLightVisualLayers.Glow, true);
|
_sprite.LayerSetVisible((uid, args.Sprite), ExpendableLightVisualLayers.Glow, true);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ExpendableLightState.Dead:
|
case ExpendableLightState.Dead:
|
||||||
comp.PlayingStream = _audioSystem.Stop(comp.PlayingStream);
|
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))
|
if (!string.IsNullOrWhiteSpace(comp.IconStateSpent))
|
||||||
args.Sprite.LayerSetState(layerIdx, comp.IconStateSpent);
|
_sprite.LayerSetRsiState((uid, args.Sprite), layerIdx, comp.IconStateSpent);
|
||||||
if (!string.IsNullOrWhiteSpace(comp.SpriteShaderSpent))
|
if (!string.IsNullOrWhiteSpace(comp.SpriteShaderSpent))
|
||||||
args.Sprite.LayerSetShader(layerIdx, comp.SpriteShaderSpent);
|
args.Sprite.LayerSetShader(layerIdx, comp.SpriteShaderSpent);
|
||||||
else
|
else
|
||||||
args.Sprite.LayerSetShader(layerIdx, null, null);
|
args.Sprite.LayerSetShader(layerIdx, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
args.Sprite.LayerSetVisible(ExpendableLightVisualLayers.Glow, false);
|
_sprite.LayerSetVisible((uid, args.Sprite), ExpendableLightVisualLayers.Glow, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user