From: Tayrtahn Date: Sun, 18 May 2025 01:48:11 +0000 (-0400) Subject: Cleanup more `SpriteComponent` warnings (part 4) (#37550) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=3dcfc3a99e77a45ff5b4e650516511980a5cdc9d;p=space-station-14.git Cleanup more `SpriteComponent` warnings (part 4) (#37550) * 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 --- diff --git a/Content.Client/Animations/EntityPickupAnimationSystem.cs b/Content.Client/Animations/EntityPickupAnimationSystem.cs index abeac664c7..58f1740e3c 100644 --- a/Content.Client/Animations/EntityPickupAnimationSystem.cs +++ b/Content.Client/Animations/EntityPickupAnimationSystem.cs @@ -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(animatableClone); - sprite.CopyFrom(sprite0); - sprite.Visible = true; + _sprite.CopySprite((uid, sprite0), (animatableClone, sprite)); + _sprite.SetVisible((animatableClone, sprite), true); var animations = Comp(animatableClone); diff --git a/Content.Client/Chemistry/EntitySystems/PillSystem.cs b/Content.Client/Chemistry/EntitySystems/PillSystem.cs index 390a4857a2..a5d02740be 100644 --- a/Content.Client/Chemistry/EntitySystems/PillSystem.cs +++ b/Content.Client/Chemistry/EntitySystems/PillSystem.cs @@ -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}"); } } diff --git a/Content.Client/Chemistry/Visualizers/SmokeVisualizerSystem.cs b/Content.Client/Chemistry/Visualizers/SmokeVisualizerSystem.cs index 1cc57ca259..83d8f6b525 100644 --- a/Content.Client/Chemistry/Visualizers/SmokeVisualizerSystem.cs +++ b/Content.Client/Chemistry/Visualizers/SmokeVisualizerSystem.cs @@ -15,8 +15,8 @@ public sealed class SmokeVisualizerSystem : VisualizerSystem(uid, SmokeVisuals.Color, out var color)) + if (!AppearanceSystem.TryGetData(uid, SmokeVisuals.Color, out var color)) return; - args.Sprite.Color = color; + SpriteSystem.SetColor((uid, args.Sprite), color); } } diff --git a/Content.Client/Chemistry/Visualizers/VaporVisualizerSystem.cs b/Content.Client/Chemistry/Visualizers/VaporVisualizerSystem.cs index 95373077f9..699bd14e85 100644 --- a/Content.Client/Chemistry/Visualizers/VaporVisualizerSystem.cs +++ b/Content.Client/Chemistry/Visualizers/VaporVisualizerSystem.cs @@ -52,7 +52,7 @@ public sealed class VaporVisualizerSystem : VisualizerSystem(uid, VaporVisuals.Color, out var color, args.Component) && args.Sprite != null) { - args.Sprite.Color = color; + SpriteSystem.SetColor((uid, args.Sprite), color); } } } diff --git a/Content.Client/Clickable/ClickableSystem.cs b/Content.Client/Clickable/ClickableSystem.cs index 454bff4349..8834f023f4 100644 --- a/Content.Client/Clickable/ClickableSystem.cs +++ b/Content.Client/Clickable/ClickableSystem.cs @@ -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. diff --git a/Content.Client/Commands/HideMechanismsCommand.cs b/Content.Client/Commands/HideMechanismsCommand.cs index 97d792628a..db68a56257 100644 --- a/Content.Client/Commands/HideMechanismsCommand.cs +++ b/Content.Client/Commands/HideMechanismsCommand.cs @@ -18,23 +18,19 @@ public sealed class HideMechanismsCommand : LocalizedCommands public override void Execute(IConsoleShell shell, string argStr, string[] args) { var containerSys = _entityManager.System(); - var query = _entityManager.AllEntityQueryEnumerator(); + var spriteSys = _entityManager.System(); + var query = _entityManager.AllEntityQueryEnumerator(); - 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; } diff --git a/Content.Client/Commands/ShowMechanismsCommand.cs b/Content.Client/Commands/ShowMechanismsCommand.cs index 4e3bb17cb6..19305b207c 100644 --- a/Content.Client/Commands/ShowMechanismsCommand.cs +++ b/Content.Client/Commands/ShowMechanismsCommand.cs @@ -16,11 +16,12 @@ public sealed class ShowMechanismsCommand : LocalizedCommands public override void Execute(IConsoleShell shell, string argStr, string[] args) { + var spriteSys = _entManager.System(); var query = _entManager.AllEntityQueryEnumerator(); - 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); } } } diff --git a/Content.Client/Dice/DiceSystem.cs b/Content.Client/Dice/DiceSystem.cs index 2890de5f2f..2de552f375 100644 --- a/Content.Client/Dice/DiceSystem.cs +++ b/Content.Client/Dice/DiceSystem.cs @@ -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}"); } } diff --git a/Content.Client/DoAfter/DoAfterOverlay.cs b/Content.Client/DoAfter/DoAfterOverlay.cs index a4565bb71a..6ecd758461 100644 --- a/Content.Client/DoAfter/DoAfterOverlay.cs +++ b/Content.Client/DoAfter/DoAfterOverlay.cs @@ -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(); _container = _entManager.EntitySysManager.GetEntitySystem(); _progressColor = _entManager.System(); + _sprite = _entManager.System(); var sprite = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/progress_bar.rsi"), "icon"); _barTexture = _entManager.EntitySysManager.GetEntitySystem().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); } diff --git a/Content.Client/Effects/ColorFlashEffectSystem.cs b/Content.Client/Effects/ColorFlashEffectSystem.cs index b584aa9ad1..10a0fbbc11 100644 --- a/Content.Client/Effects/ColorFlashEffectSystem.cs +++ b/Content.Client/Effects/ColorFlashEffectSystem.cs @@ -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!; /// /// 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(uid, out var sprite)) { - sprite.Color = component.Color; + _sprite.SetColor((uid, sprite), component.Color); } } diff --git a/Content.Client/Holiday/HolidaySystem.cs b/Content.Client/Holiday/HolidaySystem.cs index 07ae98f449..8424d5ec44 100644 --- a/Content.Client/Holiday/HolidaySystem.cs +++ b/Content.Client/Holiday/HolidaySystem.cs @@ -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!; /// 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); } } diff --git a/Content.Client/Overlays/EntityHealthBarOverlay.cs b/Content.Client/Overlays/EntityHealthBarOverlay.cs index 193635bda7..9ff0422aba 100644 --- a/Content.Client/Overlays/EntityHealthBarOverlay.cs +++ b/Content.Client/Overlays/EntityHealthBarOverlay.cs @@ -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(); _mobThresholdSystem = _entManager.System(); _statusIconSystem = _entManager.System(); + _spriteSystem = _entManager.System(); _progressColor = _entManager.System(); } @@ -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(uid)?.Bounds ?? spriteComponent.Bounds; + var bounds = _entManager.GetComponentOrNull(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); } diff --git a/Content.Client/Pointing/PointingSystem.cs b/Content.Client/Pointing/PointingSystem.cs index a86b6e21b5..12c1aa69c5 100644 --- a/Content.Client/Pointing/PointingSystem.cs +++ b/Content.Client/Pointing/PointingSystem.cs @@ -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(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(uid, out var sprite)) { - sprite.DrawDepth = (int) DrawDepth.Overlays; + _sprite.SetDrawDepth((uid, sprite), (int)DrawDepth.Overlays); sprite.NoRotation = false; } } diff --git a/Content.Client/Projectiles/ProjectileSystem.cs b/Content.Client/Projectiles/ProjectileSystem.cs index 2132256b1b..2adafdce30 100644 --- a/Content.Client/Projectiles/ProjectileSystem.cs +++ b/Content.Client/Projectiles/ProjectileSystem.cs @@ -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(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(ent, out var despawn)) diff --git a/Content.Client/Salvage/FultonSystem.cs b/Content.Client/Salvage/FultonSystem.cs index 7e31fbb180..2d323841ce 100644 --- a/Content.Client/Salvage/FultonSystem.cs +++ b/Content.Client/Salvage/FultonSystem.cs @@ -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(animationEnt); despawn.Lifetime = 1.5f; diff --git a/Content.Client/Stealth/StealthSystem.cs b/Content.Client/Stealth/StealthSystem.cs index adb25e1ef6..940f8f154d 100644 --- a/Content.Client/Stealth/StealthSystem.cs +++ b/Content.Client/Stealth/StealthSystem.cs @@ -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)); } } diff --git a/Content.Client/Sticky/Visualizers/StickyVisualizerSystem.cs b/Content.Client/Sticky/Visualizers/StickyVisualizerSystem.cs index f7764479c0..85c6b8e066 100644 --- a/Content.Client/Sticky/Visualizers/StickyVisualizerSystem.cs +++ b/Content.Client/Sticky/Visualizers/StickyVisualizerSystem.cs @@ -33,6 +33,6 @@ public sealed class StickyVisualizerSystem : VisualizerSystem 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(uid); - sprite.Color = sprite.Color.WithAlpha(1f); + _sprite.SetColor((uid, sprite), sprite.Color.WithAlpha(1f)); continue; } diff --git a/Content.Client/Tabletop/TabletopSystem.cs b/Content.Client/Tabletop/TabletopSystem.cs index 034d3e4f02..f83b0e0bd0 100644 --- a/Content.Client/Tabletop/TabletopSystem.cs +++ b/Content.Client/Tabletop/TabletopSystem.cs @@ -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(uid, TabletopItemVisuals.Scale, out var scale, args.Component)) { - args.Sprite.Scale = scale; + _sprite.SetScale((uid, args.Sprite), scale); } if (_appearance.TryGetData(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; diff --git a/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs b/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs index 49a2fba898..1b872484ae 100644 --- a/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs +++ b/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs @@ -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