Cleanup redundant SpriteSystem dependencies in VisualizerSystems (#37758)

Cleanup redundant SpriteSystem dependencies in VisualizerSystems
This commit is contained in:
Tayrtahn
2025-05-23 14:12:20 -04:00
committed by GitHub
parent f3f655a8f9
commit bd6645b021
29 changed files with 193 additions and 239 deletions

View File

@@ -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