Cleanup redundant SpriteSystem dependencies in VisualizerSystems (#37758)

Cleanup redundant SpriteSystem dependencies in VisualizerSystems
This commit is contained in:
Tayrtahn
2025-08-05 16:16:25 +02:00
committed by Quanteey
parent dfea48c445
commit 93ae609d84
29 changed files with 190 additions and 234 deletions
@@ -15,7 +15,6 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
{
[Dependency] private readonly SharedItemSystem _itemSys = default!;
[Dependency] private readonly SharedPointLightSystem _lights = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize()
{
@@ -32,11 +31,11 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
var modulate = AppearanceSystem.TryGetData<Color>(uid, ToggleableLightVisuals.Color, out var color, args.Component);
// Update the item's sprite
if (args.Sprite != null && component.SpriteLayer != null && _sprite.LayerMapTryGet((uid, args.Sprite), component.SpriteLayer, out var layer, false))
if (args.Sprite != null && component.SpriteLayer != null && SpriteSystem.LayerMapTryGet((uid, args.Sprite), component.SpriteLayer, out var layer, false))
{
_sprite.LayerSetVisible((uid, args.Sprite), layer, enabled);
SpriteSystem.LayerSetVisible((uid, args.Sprite), layer, enabled);
if (modulate)
_sprite.LayerSetColor((uid, args.Sprite), layer, color);
SpriteSystem.LayerSetColor((uid, args.Sprite), layer, color);
}
// Update any point-lights