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

@@ -5,8 +5,6 @@ namespace Content.Client.Light.Visualizers;
public sealed class LightBulbSystem : VisualizerSystem<LightBulbComponent>
{
[Dependency] private readonly SpriteSystem _sprite = default!;
protected override void OnAppearanceChange(EntityUid uid, LightBulbComponent comp, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
@@ -18,13 +16,13 @@ public sealed class LightBulbSystem : VisualizerSystem<LightBulbComponent>
switch (state)
{
case LightBulbState.Normal:
_sprite.LayerSetRsiState((uid, args.Sprite), LightBulbVisualLayers.Base, comp.NormalSpriteState);
SpriteSystem.LayerSetRsiState((uid, args.Sprite), LightBulbVisualLayers.Base, comp.NormalSpriteState);
break;
case LightBulbState.Broken:
_sprite.LayerSetRsiState((uid, args.Sprite), LightBulbVisualLayers.Base, comp.BrokenSpriteState);
SpriteSystem.LayerSetRsiState((uid, args.Sprite), LightBulbVisualLayers.Base, comp.BrokenSpriteState);
break;
case LightBulbState.Burned:
_sprite.LayerSetRsiState((uid, args.Sprite), LightBulbVisualLayers.Base, comp.BurnedSpriteState);
SpriteSystem.LayerSetRsiState((uid, args.Sprite), LightBulbVisualLayers.Base, comp.BurnedSpriteState);
break;
}
}
@@ -32,7 +30,7 @@ public sealed class LightBulbSystem : VisualizerSystem<LightBulbComponent>
// also update sprites color
if (AppearanceSystem.TryGetData<Color>(uid, LightBulbVisuals.Color, out var color, args.Component))
{
_sprite.SetColor((uid, args.Sprite), color);
SpriteSystem.SetColor((uid, args.Sprite), color);
}
}
}