From: Tayrtahn Date: Tue, 13 May 2025 22:19:57 +0000 (-0400) Subject: Cleanup warnings in `AnomalySystem` (#37429) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=f81d0fa502a72385b0185e13dba454c9ba3b8a5f;p=space-station-14.git Cleanup warnings in `AnomalySystem` (#37429) Cleanup warnings in AnomalySystem --- diff --git a/Content.Client/Anomaly/AnomalySystem.cs b/Content.Client/Anomaly/AnomalySystem.cs index 28c015f302..83f15a9086 100644 --- a/Content.Client/Anomaly/AnomalySystem.cs +++ b/Content.Client/Anomaly/AnomalySystem.cs @@ -11,6 +11,7 @@ public sealed class AnomalySystem : SharedAnomalySystem { [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly FloatingVisualizerSystem _floating = default!; + [Dependency] private readonly SpriteSystem _sprite = default!; /// public override void Initialize() @@ -49,12 +50,12 @@ public sealed class AnomalySystem : SharedAnomalySystem if (HasComp(uid)) pulsing = true; - if (!sprite.LayerMapTryGet(AnomalyVisualLayers.Base, out var layer) || - !sprite.LayerMapTryGet(AnomalyVisualLayers.Animated, out var animatedLayer)) + if (!_sprite.LayerMapTryGet((uid, sprite), AnomalyVisualLayers.Base, out var layer, false) || + !_sprite.LayerMapTryGet((uid, sprite), AnomalyVisualLayers.Animated, out var animatedLayer, false)) return; - sprite.LayerSetVisible(layer, !pulsing); - sprite.LayerSetVisible(animatedLayer, pulsing); + _sprite.LayerSetVisible((uid, sprite), layer, !pulsing); + _sprite.LayerSetVisible((uid, sprite), animatedLayer, pulsing); } public override void Update(float frameTime) @@ -63,16 +64,16 @@ public sealed class AnomalySystem : SharedAnomalySystem var query = EntityQueryEnumerator(); - while (query.MoveNext(out var super, out var sprite)) + while (query.MoveNext(out var uid, out var super, out var sprite)) { - var completion = 1f - (float) ((super.EndTime - _timing.CurTime) / super.SupercriticalDuration); + var completion = 1f - (float)((super.EndTime - _timing.CurTime) / super.SupercriticalDuration); var scale = completion * (super.MaxScaleAmount - 1f) + 1f; - sprite.Scale = new Vector2(scale, scale); + _sprite.SetScale((uid, sprite), new Vector2(scale, scale)); - var transparency = (byte) (65 * (1f - completion) + 190); + var transparency = (byte)(65 * (1f - completion) + 190); if (transparency < sprite.Color.AByte) { - sprite.Color = sprite.Color.WithAlpha(transparency); + _sprite.SetColor((uid, sprite), sprite.Color.WithAlpha(transparency)); } } } @@ -82,7 +83,7 @@ public sealed class AnomalySystem : SharedAnomalySystem if (!TryComp(ent, out var sprite)) return; - sprite.Scale = Vector2.One; - sprite.Color = sprite.Color.WithAlpha(1f); + _sprite.SetScale((ent.Owner, sprite), Vector2.One); + _sprite.SetColor((ent.Owner, sprite), sprite.Color.WithAlpha(1f)); } }