]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup more `SpriteComponent` warnings (part 4) (#37550)
authorTayrtahn <tayrtahn@gmail.com>
Sun, 18 May 2025 01:48:11 +0000 (21:48 -0400)
committerGitHub <noreply@github.com>
Sun, 18 May 2025 01:48:11 +0000 (03:48 +0200)
* Cleanup warnings in ClickableSystem

* Cleanup warnings in FultonSystem

* Cleanup warning in HolidaySystem

* Cleanup warning in DoAfterOverlay

* Cleanup warning in EntityHealthBarOverlay

* Cleanup warning in SmokeVisualizerSystem

* Cleanup warning in VaporVisualizerSystem

* Cleanup warning in ColorFlashEffectSystem

* Cleanup warnings in StealthSystem

* Cleanup warnings in TrayScannerSystem

* Cleanup warnings in InventoryUIController

* Cleanup warnings in HideMechanismsCommand

* Cleanup warning in ShowMechanismsCommand

* Cleanup warnings in EntityPickupAnimationSystem

* Cleanup warnings in PointingSystem

* Cleanup warning in StickyVisualizerSystem

* Cleanup warnings in TabletopSystem

* Cleanup warnings in PillSystem

* Cleanup warnings in DiceSystem

* Cleanup warnings in ProjectileSystem

20 files changed:
Content.Client/Animations/EntityPickupAnimationSystem.cs
Content.Client/Chemistry/EntitySystems/PillSystem.cs
Content.Client/Chemistry/Visualizers/SmokeVisualizerSystem.cs
Content.Client/Chemistry/Visualizers/VaporVisualizerSystem.cs
Content.Client/Clickable/ClickableSystem.cs
Content.Client/Commands/HideMechanismsCommand.cs
Content.Client/Commands/ShowMechanismsCommand.cs
Content.Client/Dice/DiceSystem.cs
Content.Client/DoAfter/DoAfterOverlay.cs
Content.Client/Effects/ColorFlashEffectSystem.cs
Content.Client/Holiday/HolidaySystem.cs
Content.Client/Overlays/EntityHealthBarOverlay.cs
Content.Client/Pointing/PointingSystem.cs
Content.Client/Projectiles/ProjectileSystem.cs
Content.Client/Salvage/FultonSystem.cs
Content.Client/Stealth/StealthSystem.cs
Content.Client/Sticky/Visualizers/StickyVisualizerSystem.cs
Content.Client/SubFloor/TrayScannerSystem.cs
Content.Client/Tabletop/TabletopSystem.cs
Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs

index abeac664c75c77476e96e8fc6c51ae8c8335dc4b..58f1740e3c98ae6e1bcfca956a9254f309123618 100644 (file)
@@ -15,6 +15,7 @@ public sealed class EntityPickupAnimationSystem : EntitySystem
 {
     [Dependency] private readonly AnimationPlayerSystem _animations = default!;
     [Dependency] private readonly MetaDataSystem _metaData = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
     [Dependency] private readonly TransformSystem _transform = default!;
 
     public override void Initialize()
@@ -56,8 +57,8 @@ public sealed class EntityPickupAnimationSystem : EntitySystem
         }
 
         var sprite = Comp<SpriteComponent>(animatableClone);
-        sprite.CopyFrom(sprite0);
-        sprite.Visible = true;
+        _sprite.CopySprite((uid, sprite0), (animatableClone, sprite));
+        _sprite.SetVisible((animatableClone, sprite), true);
 
         var animations = Comp<AnimationPlayerComponent>(animatableClone);
 
index 390a4857a27e612cc935718760cf5ba7af95917e..a5d02740be75633b55b848597689432b8247bbd8 100644 (file)
@@ -5,6 +5,8 @@ namespace Content.Client.Chemistry.EntitySystems;
 
 public sealed class PillSystem : EntitySystem
 {
+    [Dependency] private readonly SpriteSystem _sprite = default!;
+
     public override void Initialize()
     {
         base.Initialize();
@@ -16,9 +18,9 @@ public sealed class PillSystem : EntitySystem
         if (!TryComp(uid, out SpriteComponent? sprite))
             return;
 
-        if (!sprite.TryGetLayer(0, out var layer))
+        if (!_sprite.TryGetLayer((uid, sprite), 0, out var layer, false))
             return;
 
-        layer.SetState($"pill{component.PillType + 1}");
+        _sprite.LayerSetRsiState(layer, $"pill{component.PillType + 1}");
     }
 }
index 1cc57ca259d96f8bbd13acc7249e10673d2184aa..83d8f6b52517bcc1893f985e1ca8b38c820edcf8 100644 (file)
@@ -15,8 +15,8 @@ public sealed class SmokeVisualizerSystem : VisualizerSystem<SmokeVisualsCompone
     {
         if (args.Sprite == null)
             return;
-        if(!AppearanceSystem.TryGetData<Color>(uid, SmokeVisuals.Color, out var color))
+        if (!AppearanceSystem.TryGetData<Color>(uid, SmokeVisuals.Color, out var color))
             return;
-        args.Sprite.Color = color;
+        SpriteSystem.SetColor((uid, args.Sprite), color);
     }
 }
index 95373077f9b38c91886732291d0855863f04c81c..699bd14e851cc3785ba9793116d2cd2bf6937334 100644 (file)
@@ -52,7 +52,7 @@ public sealed class VaporVisualizerSystem : VisualizerSystem<VaporVisualsCompone
     {
         if (AppearanceSystem.TryGetData<Color>(uid, VaporVisuals.Color, out var color, args.Component) && args.Sprite != null)
         {
-            args.Sprite.Color = color;
+            SpriteSystem.SetColor((uid, args.Sprite), color);
         }
     }
 }
index 454bff4349269f3df7224e37259e4f8b18754b7b..8834f023f41111c69a28c00264248e97c3391297 100644 (file)
@@ -77,10 +77,10 @@ public sealed class ClickableSystem : EntitySystem
         drawDepth = sprite.DrawDepth;
         renderOrder = sprite.RenderOrder;
         var (spritePos, spriteRot) = _transforms.GetWorldPositionRotation(transform);
-        var spriteBB = sprite.CalculateRotatedBoundingBox(spritePos, spriteRot, eye.Rotation);
+        var spriteBB = _sprites.CalculateBounds((entity.Owner, sprite), spritePos, spriteRot, eye.Rotation);
         bottom = Matrix3Helpers.CreateRotation(eye.Rotation).TransformBox(spriteBB).Bottom;
 
-        Matrix3x2.Invert(sprite.GetLocalMatrix(), out var invSpriteMatrix);
+        Matrix3x2.Invert(sprite.LocalMatrix, out var invSpriteMatrix);
 
         // This should have been the rotation of the sprite relative to the screen, but this is not the case with no-rot or directional sprites.
         var relativeRotation = (spriteRot + eye.Rotation).Reduced().FlipPositive();
@@ -107,7 +107,7 @@ public sealed class ClickableSystem : EntitySystem
             if (layer.Texture != null)
             {
                 // Convert to image coordinates
-                var imagePos = (Vector2i) (localPos * EyeManager.PixelsPerMeter * new Vector2(1, -1) + layer.Texture.Size / 2f);
+                var imagePos = (Vector2i)(localPos * EyeManager.PixelsPerMeter * new Vector2(1, -1) + layer.Texture.Size / 2f);
 
                 if (_clickMapManager.IsOccluding(layer.Texture, imagePos))
                     return true;
@@ -125,7 +125,7 @@ public sealed class ClickableSystem : EntitySystem
             var layerLocal = Vector2.Transform(localPos, inverseMatrix);
 
             // Convert to image coordinates
-            var layerImagePos = (Vector2i) (layerLocal * EyeManager.PixelsPerMeter * new Vector2(1, -1) + rsiState.Size / 2f);
+            var layerImagePos = (Vector2i)(layerLocal * EyeManager.PixelsPerMeter * new Vector2(1, -1) + rsiState.Size / 2f);
 
             // Next, to get the right click map we need the "direction" of this layer that is actually being used to draw the sprite on the screen.
             // This **can** differ from the dir defined before, but can also just be the same.
index 97d792628a62089de37610f9da44867b4858ed66..db68a562576ad8f597bb885af651776291e2f9b1 100644 (file)
@@ -18,23 +18,19 @@ public sealed class HideMechanismsCommand : LocalizedCommands
     public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         var containerSys = _entityManager.System<SharedContainerSystem>();
-        var query = _entityManager.AllEntityQueryEnumerator<OrganComponent>();
+        var spriteSys = _entityManager.System<SpriteSystem>();
+        var query = _entityManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
 
-        while (query.MoveNext(out var uid, out _))
+        while (query.MoveNext(out var uid, out _, out var sprite))
         {
-            if (!_entityManager.TryGetComponent(uid, out SpriteComponent? sprite))
-            {
-                continue;
-            }
-
-            sprite.ContainerOccluded = false;
+            spriteSys.SetContainerOccluded((uid, sprite), false);
 
             var tempParent = uid;
             while (containerSys.TryGetContainingContainer((tempParent, null, null), out var container))
             {
                 if (!container.ShowContents)
                 {
-                    sprite.ContainerOccluded = true;
+                    spriteSys.SetContainerOccluded((uid, sprite), true);
                     break;
                 }
 
index 4e3bb17cb6e777343a6f89139caf95459c46a77c..19305b207c8117700d67fb3e3c8e7fce652bbbe3 100644 (file)
@@ -16,11 +16,12 @@ public sealed class ShowMechanismsCommand : LocalizedCommands
 
     public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
+        var spriteSys = _entManager.System<SpriteSystem>();
         var query = _entManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
 
-        while (query.MoveNext(out _, out var sprite))
+        while (query.MoveNext(out var uid, out _, out var sprite))
         {
-            sprite.ContainerOccluded = false;
+            spriteSys.SetContainerOccluded((uid, sprite), false);
         }
     }
 }
index 2890de5f2f1d28ca6f04ada3070e907c041264da..2de552f375b8957b7180193572857cd2d5e4462f 100644 (file)
@@ -5,6 +5,8 @@ namespace Content.Client.Dice;
 
 public sealed class DiceSystem : SharedDiceSystem
 {
+    [Dependency] private readonly SpriteSystem _sprite = default!;
+
     public override void Initialize()
     {
         base.Initialize();
@@ -18,11 +20,11 @@ public sealed class DiceSystem : SharedDiceSystem
             return;
 
         // TODO maybe just move each die to its own RSI?
-        var state = sprite.LayerGetState(0).Name;
+        var state = _sprite.LayerGetRsiState((entity.Owner, sprite), 0).Name;
         if (state == null)
             return;
 
         var prefix = state.Substring(0, state.IndexOf('_'));
-        sprite.LayerSetState(0, $"{prefix}_{entity.Comp.CurrentValue}");
+        _sprite.LayerSetRsiState((entity.Owner, sprite), 0, $"{prefix}_{entity.Comp.CurrentValue}");
     }
 }
index a4565bb71a6ba6c4c69eb7095cb419309d794638..6ecd7584615f18c8c8528dff2ecedb665f4d9000 100644 (file)
@@ -21,6 +21,7 @@ public sealed class DoAfterOverlay : Overlay
     private readonly MetaDataSystem _meta;
     private readonly ProgressColorSystem _progressColor;
     private readonly SharedContainerSystem _container;
+    private readonly SpriteSystem _sprite;
 
     private readonly Texture _barTexture;
     private readonly ShaderInstance _unshadedShader;
@@ -45,6 +46,7 @@ public sealed class DoAfterOverlay : Overlay
         _meta = _entManager.EntitySysManager.GetEntitySystem<MetaDataSystem>();
         _container = _entManager.EntitySysManager.GetEntitySystem<SharedContainerSystem>();
         _progressColor = _entManager.System<ProgressColorSystem>();
+        _sprite = _entManager.System<SpriteSystem>();
         var sprite = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/progress_bar.rsi"), "icon");
         _barTexture = _entManager.EntitySysManager.GetEntitySystem<SpriteSystem>().Frame0(sprite);
 
@@ -118,7 +120,7 @@ public sealed class DoAfterOverlay : Overlay
 
                 // Use the sprite itself if we know its bounds. This means short or tall sprites don't get overlapped
                 // by the bar.
-                float yOffset = sprite.Bounds.Height / 2f + 0.05f;
+                var yOffset = _sprite.GetLocalBounds((uid, sprite)).Height / 2f + 0.05f;
 
                 // Position above the entity (we've already applied the matrix transform to the entity itself)
                 // Offset by the texture size for every do_after we have.
@@ -135,7 +137,7 @@ public sealed class DoAfterOverlay : Overlay
                 if (doAfter.CancelledTime != null)
                 {
                     var elapsed = doAfter.CancelledTime.Value - doAfter.StartTime;
-                    elapsedRatio = (float) Math.Min(1, elapsed.TotalSeconds / doAfter.Args.Delay.TotalSeconds);
+                    elapsedRatio = (float)Math.Min(1, elapsed.TotalSeconds / doAfter.Args.Delay.TotalSeconds);
                     var cancelElapsed = (time - doAfter.CancelledTime.Value).TotalSeconds;
                     var flash = Math.Floor(cancelElapsed / FlashTime) % 2 == 0;
                     color = GetProgressColor(0, flash ? alpha : 0);
@@ -143,7 +145,7 @@ public sealed class DoAfterOverlay : Overlay
                 else
                 {
                     var elapsed = time - doAfter.StartTime;
-                    elapsedRatio = (float) Math.Min(1, elapsed.TotalSeconds / doAfter.Args.Delay.TotalSeconds);
+                    elapsedRatio = (float)Math.Min(1, elapsed.TotalSeconds / doAfter.Args.Delay.TotalSeconds);
                     color = GetProgressColor(elapsedRatio, alpha);
                 }
 
index b584aa9ad1bd35a689f638b3e935b878be9a612f..10a0fbbc11ca3b90520be2068daae3dc8dd5ace1 100644 (file)
@@ -13,6 +13,7 @@ public sealed class ColorFlashEffectSystem : SharedColorFlashEffectSystem
 {
     [Dependency] private readonly IGameTiming _timing = default!;
     [Dependency] private readonly AnimationPlayerSystem _animation = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
 
     /// <summary>
     /// It's a little on the long side but given we use multiple colours denoting what happened it makes it easier to register.
@@ -44,7 +45,7 @@ public sealed class ColorFlashEffectSystem : SharedColorFlashEffectSystem
 
         if (TryComp<SpriteComponent>(uid, out var sprite))
         {
-            sprite.Color = component.Color;
+            _sprite.SetColor((uid, sprite), component.Color);
         }
     }
 
index 07ae98f44900882c000d58f684cbee413487b26c..8424d5ec44852bec444f592b47b14db65148b626 100644 (file)
@@ -11,6 +11,7 @@ public sealed class HolidaySystem : EntitySystem
 {
     [Dependency] private readonly IResourceCache _rescache = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
 
     /// <inheritdoc/>
     public override void Initialize()
@@ -29,6 +30,6 @@ public sealed class HolidaySystem : EntitySystem
 
         var path = SpriteSpecifierSerializer.TextureRoot / rsistring;
         if (_rescache.TryGetResource(path, out RSIResource? rsi))
-            args.Sprite.BaseRSI = rsi.RSI;
+            _sprite.SetBaseRsi((ent.Owner, args.Sprite), rsi.RSI);
     }
 }
index 193635bda7b6ba19be20f6e758565776ccd244fa..9ff0422aba0f41f055f747d3bb9c60b70220a86d 100644 (file)
@@ -28,6 +28,7 @@ public sealed class EntityHealthBarOverlay : Overlay
     private readonly MobStateSystem _mobStateSystem;
     private readonly MobThresholdSystem _mobThresholdSystem;
     private readonly StatusIconSystem _statusIconSystem;
+    private readonly SpriteSystem _spriteSystem;
     private readonly ProgressColorSystem _progressColor;
 
 
@@ -43,6 +44,7 @@ public sealed class EntityHealthBarOverlay : Overlay
         _mobStateSystem = _entManager.System<MobStateSystem>();
         _mobThresholdSystem = _entManager.System<MobThresholdSystem>();
         _statusIconSystem = _entManager.System<StatusIconSystem>();
+        _spriteSystem = _entManager.System<SpriteSystem>();
         _progressColor = _entManager.System<ProgressColorSystem>();
     }
 
@@ -76,7 +78,7 @@ public sealed class EntityHealthBarOverlay : Overlay
                 continue;
 
             // we use the status icon component bounds if specified otherwise use sprite
-            var bounds = _entManager.GetComponentOrNull<StatusIconComponent>(uid)?.Bounds ?? spriteComponent.Bounds;
+            var bounds = _entManager.GetComponentOrNull<StatusIconComponent>(uid)?.Bounds ?? _spriteSystem.GetLocalBounds((uid, spriteComponent));
             var worldPos = _transform.GetWorldPosition(xform, xformQuery);
 
             if (!bounds.Translated(worldPos).Intersects(args.WorldAABB))
@@ -136,7 +138,7 @@ public sealed class EntityHealthBarOverlay : Overlay
                 !_mobThresholdSystem.TryGetThresholdForState(uid, MobState.Dead, out threshold, thresholds))
                 return (1, false);
 
-            var ratio = 1 - ((FixedPoint2) (dmg.TotalDamage / threshold)).Float();
+            var ratio = 1 - ((FixedPoint2)(dmg.TotalDamage / threshold)).Float();
             return (ratio, false);
         }
 
index a86b6e21b52261fe167ac169a40613af609a8300..12c1aa69c5a9df23d9c10ac1dfa2edd9ba89b639 100644 (file)
@@ -10,6 +10,8 @@ namespace Content.Client.Pointing;
 
 public sealed partial class PointingSystem : SharedPointingSystem
 {
+    [Dependency] private readonly SpriteSystem _sprite = default!;
+
     public override void Initialize()
     {
         base.Initialize();
@@ -44,7 +46,7 @@ public sealed partial class PointingSystem : SharedPointingSystem
         Verb verb = new()
         {
             Text = Loc.GetString("pointing-verb-get-data-text"),
-            Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/point.svg.192dpi.png")),
+            Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/point.svg.192dpi.png")),
             ClientExclusive = true,
             Act = () => RaiseNetworkEvent(new PointingAttemptEvent(GetNetEntity(args.Target)))
         };
@@ -55,7 +57,7 @@ public sealed partial class PointingSystem : SharedPointingSystem
     private void OnArrowStartup(EntityUid uid, PointingArrowComponent component, ComponentStartup args)
     {
         if (TryComp<SpriteComponent>(uid, out var sprite))
-            sprite.DrawDepth = (int) DrawDepth.Overlays;
+            _sprite.SetDrawDepth((uid, sprite), (int)DrawDepth.Overlays);
 
         BeginPointAnimation(uid, component.StartPosition, component.Offset, component.AnimationKey);
     }
@@ -64,7 +66,7 @@ public sealed partial class PointingSystem : SharedPointingSystem
     {
         if (TryComp<SpriteComponent>(uid, out var sprite))
         {
-            sprite.DrawDepth = (int) DrawDepth.Overlays;
+            _sprite.SetDrawDepth((uid, sprite), (int)DrawDepth.Overlays);
             sprite.NoRotation = false;
         }
     }
index 2132256b1bd47263dd5549da8048402958b34e71..2adafdce3065272204a80a15048a94ee240940f0 100644 (file)
@@ -1,9 +1,7 @@
 using Content.Shared.Projectiles;
-using Robust.Shared.Spawners;
 using Content.Shared.Weapons.Ranged.Systems;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
-using Robust.Shared.GameStates;
 using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
 
 namespace Content.Client.Projectiles;
@@ -11,6 +9,7 @@ namespace Content.Client.Projectiles;
 public sealed class ProjectileSystem : SharedProjectileSystem
 {
     [Dependency] private readonly AnimationPlayerSystem _player = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
 
     public override void Initialize()
     {
@@ -30,8 +29,8 @@ public sealed class ProjectileSystem : SharedProjectileSystem
         if (TryComp<SpriteComponent>(ent, out var sprite))
         {
             sprite[EffectLayers.Unshaded].AutoAnimated = false;
-            sprite.LayerMapTryGet(EffectLayers.Unshaded, out var layer);
-            var state = sprite.LayerGetState(layer);
+            _sprite.LayerMapTryGet((ent, sprite), EffectLayers.Unshaded, out var layer, false);
+            var state = _sprite.LayerGetRsiState((ent, sprite), layer);
             var lifetime = 0.5f;
 
             if (TryComp<TimedDespawnComponent>(ent, out var despawn))
index 7e31fbb1808b666d95ba9da6ec0154420fccae90..2d323841cef3c31a82b6a7e68fc4efca6c38957a 100644 (file)
@@ -1,11 +1,9 @@
 using System.Numerics;
 using Content.Shared.Salvage.Fulton;
-using Robust.Shared.Spawners;
 using JetBrains.Annotations;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
-using Robust.Shared.Animations;
 using Robust.Shared.Serialization.Manager;
 using Robust.Shared.Utility;
 using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
@@ -16,6 +14,7 @@ public sealed class FultonSystem : SharedFultonSystem
 {
     [Dependency] private readonly ISerializationManager _serManager = default!;
     [Dependency] private readonly AnimationPlayerSystem _player = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
 
     private static readonly TimeSpan AnimationDuration = TimeSpan.FromSeconds(0.4);
 
@@ -82,8 +81,8 @@ public sealed class FultonSystem : SharedFultonSystem
         }
 
         sprite.NoRotation = true;
-        var effectLayer = sprite.AddLayer(new SpriteSpecifier.Rsi(new ResPath("Objects/Tools/fulton_balloon.rsi"), "fulton_balloon"));
-        sprite.LayerSetOffset(effectLayer, EffectOffset + new Vector2(0f, 0.5f));
+        var effectLayer = _sprite.AddLayer((animationEnt, sprite), new SpriteSpecifier.Rsi(new ResPath("Objects/Tools/fulton_balloon.rsi"), "fulton_balloon"));
+        _sprite.LayerSetOffset((animationEnt, sprite), effectLayer, EffectOffset + new Vector2(0f, 0.5f));
 
         var despawn = AddComp<TimedDespawnComponent>(animationEnt);
         despawn.Lifetime = 1.5f;
index adb25e1ef63b09e65f92ce4b4702eb579b4657e0..940f8f154d7af7817ee480afa6407c3a865a5cc7 100644 (file)
@@ -12,6 +12,7 @@ public sealed class StealthSystem : SharedStealthSystem
 {
     [Dependency] private readonly IPrototypeManager _protoMan = default!;
     [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
 
     private ShaderInstance _shader = default!;
 
@@ -40,7 +41,7 @@ public sealed class StealthSystem : SharedStealthSystem
         if (!Resolve(uid, ref component, ref sprite, false))
             return;
 
-        sprite.Color = Color.White;
+        _sprite.SetColor((uid, sprite), Color.White);
         sprite.PostShader = enabled ? _shader : null;
         sprite.GetScreenTexture = enabled;
         sprite.RaiseShaderEvent = enabled;
@@ -93,6 +94,6 @@ public sealed class StealthSystem : SharedStealthSystem
         _shader.SetParameter("visibility", visibility);
 
         visibility = MathF.Max(0, visibility);
-        args.Sprite.Color = new Color(visibility, visibility, 1, 1);
+        _sprite.SetColor((uid, args.Sprite), new Color(visibility, visibility, 1, 1));
     }
 }
index f7764479c01838efeb2d022b426213e57003689a..85c6b8e0660a99d3da71b2c93d656087b294c8cc 100644 (file)
@@ -33,6 +33,6 @@ public sealed class StickyVisualizerSystem : VisualizerSystem<StickyVisualizerCo
             return;
 
         var drawDepth = isStuck ? comp.StuckDrawDepth : comp.OriginalDrawDepth;
-        args.Sprite.DrawDepth = drawDepth;
+        SpriteSystem.SetDrawDepth((uid, args.Sprite), drawDepth);
     }
 }
index f65c7840256f5caf42882f0a9a3cadc188f6b0cb..194453ab75a64b1db707d07c558bf8fc5faa979e 100644 (file)
@@ -4,7 +4,6 @@ using Content.Shared.SubFloor;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
 using Robust.Client.Player;
-using Robust.Shared.Map;
 using Robust.Shared.Timing;
 
 namespace Content.Client.SubFloor;
@@ -19,6 +18,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
     [Dependency] private readonly SharedHandsSystem _hands = default!;
     [Dependency] private readonly SharedTransformSystem _transform = default!;
+    [Dependency] private readonly SpriteSystem _sprite = default!;
     [Dependency] private readonly TrayScanRevealSystem _trayScanReveal = default!;
 
     private const string TRayAnimationKey = "trays";
@@ -102,7 +102,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
                 if ((!_appearance.TryGetData(uid, SubFloorVisuals.ScannerRevealed, out bool value) || !value) &&
                     sprite.Color.A > SubfloorRevealAlpha)
                 {
-                    sprite.Color = sprite.Color.WithAlpha(0f);
+                    _sprite.SetColor((uid, sprite), sprite.Color.WithAlpha(0f));
                 }
 
                 SetRevealed(uid, true);
@@ -136,7 +136,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
                 {
                     SetRevealed(uid, false);
                     RemCompDeferred<TrayRevealedComponent>(uid);
-                    sprite.Color = sprite.Color.WithAlpha(1f);
+                    _sprite.SetColor((uid, sprite), sprite.Color.WithAlpha(1f));
                     continue;
                 }
 
index 034d3e4f02c6a90c84cd25787c6fc712e1642dcd..f83b0e0bd02f30c9465b3a37705b8141a2ed8252 100644 (file)
@@ -28,6 +28,7 @@ namespace Content.Client.Tabletop
         [Dependency] private readonly IGameTiming _gameTiming = default!;
         [Dependency] private readonly AppearanceSystem _appearance = default!;
         [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
+        [Dependency] private readonly SpriteSystem _sprite = default!;
 
         // Time in seconds to wait until sending the location of a dragged entity to the server again
         private const float Delay = 1f / 10; // 10 Hz
@@ -224,12 +225,12 @@ namespace Content.Client.Tabletop
             //  the appearance handle the rest
             if (_appearance.TryGetData<Vector2>(uid, TabletopItemVisuals.Scale, out var scale, args.Component))
             {
-                args.Sprite.Scale = scale;
+                _sprite.SetScale((uid, args.Sprite), scale);
             }
 
             if (_appearance.TryGetData<int>(uid, TabletopItemVisuals.DrawDepth, out var drawDepth, args.Component))
             {
-                args.Sprite.DrawDepth = drawDepth;
+                _sprite.SetDrawDepth((uid, args.Sprite), drawDepth);
             }
         }
 
@@ -281,7 +282,7 @@ namespace Content.Client.Tabletop
             if (eye == null)
                 return MapCoordinates.Nullspace;
 
-            var size = (Vector2) viewport.ViewportSize / EyeManager.PixelsPerMeter; // Convert to tiles instead of pixels
+            var size = (Vector2)viewport.ViewportSize / EyeManager.PixelsPerMeter; // Convert to tiles instead of pixels
             var eyePosition = eye.Position.Position;
             var eyeRotation = eye.Rotation;
             var eyeScale = eye.Scale;
index 49a2fba89812dc316f90c46e19279d47a3ee72c7..1b872484ae6a275ac497b58ea033f4d2b9ef3fe5 100644 (file)
@@ -21,7 +21,6 @@ using Robust.Client.UserInterface.Controls;
 using Robust.Shared.Input;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
-using Robust.Shared.Player;
 using Robust.Shared.Utility;
 using static Content.Client.Inventory.ClientInventorySystem;
 
@@ -35,6 +34,7 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
     [UISystemDependency] private readonly ClientInventorySystem _inventorySystem = default!;
     [UISystemDependency] private readonly HandsSystem _handsSystem = default!;
     [UISystemDependency] private readonly ContainerSystem _container = default!;
+    [UISystemDependency] private readonly SpriteSystem _sprite = default!;
 
     private EntityUid? _playerUid;
     private InventorySlotsComponent? _playerInventory;
@@ -364,8 +364,8 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
             }
         }
 
-        hoverSprite.CopyFrom(sprite);
-        hoverSprite.Color = fits ? new Color(0, 255, 0, 127) : new Color(255, 0, 0, 127);
+        _sprite.CopySprite((held, sprite), (hoverEntity, hoverSprite));
+        _sprite.SetColor((hoverEntity, hoverSprite), fits ? new Color(0, 255, 0, 127) : new Color(255, 0, 0, 127));
 
         control.HoverSpriteView.SetEntity(hoverEntity);
     }