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
This commit is contained in:
Tayrtahn
2025-05-17 21:48:11 -04:00
committed by GitHub
parent f098a8e6d5
commit 3dcfc3a99e
20 changed files with 64 additions and 54 deletions

View File

@@ -15,6 +15,7 @@ public sealed class EntityPickupAnimationSystem : EntitySystem
{ {
[Dependency] private readonly AnimationPlayerSystem _animations = default!; [Dependency] private readonly AnimationPlayerSystem _animations = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
[Dependency] private readonly TransformSystem _transform = default!; [Dependency] private readonly TransformSystem _transform = default!;
public override void Initialize() public override void Initialize()
@@ -56,8 +57,8 @@ public sealed class EntityPickupAnimationSystem : EntitySystem
} }
var sprite = Comp<SpriteComponent>(animatableClone); var sprite = Comp<SpriteComponent>(animatableClone);
sprite.CopyFrom(sprite0); _sprite.CopySprite((uid, sprite0), (animatableClone, sprite));
sprite.Visible = true; _sprite.SetVisible((animatableClone, sprite), true);
var animations = Comp<AnimationPlayerComponent>(animatableClone); var animations = Comp<AnimationPlayerComponent>(animatableClone);

View File

@@ -5,6 +5,8 @@ namespace Content.Client.Chemistry.EntitySystems;
public sealed class PillSystem : EntitySystem public sealed class PillSystem : EntitySystem
{ {
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
@@ -16,9 +18,9 @@ public sealed class PillSystem : EntitySystem
if (!TryComp(uid, out SpriteComponent? sprite)) if (!TryComp(uid, out SpriteComponent? sprite))
return; return;
if (!sprite.TryGetLayer(0, out var layer)) if (!_sprite.TryGetLayer((uid, sprite), 0, out var layer, false))
return; return;
layer.SetState($"pill{component.PillType + 1}"); _sprite.LayerSetRsiState(layer, $"pill{component.PillType + 1}");
} }
} }

View File

@@ -15,8 +15,8 @@ public sealed class SmokeVisualizerSystem : VisualizerSystem<SmokeVisualsCompone
{ {
if (args.Sprite == null) if (args.Sprite == null)
return; return;
if(!AppearanceSystem.TryGetData<Color>(uid, SmokeVisuals.Color, out var color)) if (!AppearanceSystem.TryGetData<Color>(uid, SmokeVisuals.Color, out var color))
return; return;
args.Sprite.Color = color; SpriteSystem.SetColor((uid, args.Sprite), color);
} }
} }

View 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) 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);
} }
} }
} }

View File

@@ -77,10 +77,10 @@ public sealed class ClickableSystem : EntitySystem
drawDepth = sprite.DrawDepth; drawDepth = sprite.DrawDepth;
renderOrder = sprite.RenderOrder; renderOrder = sprite.RenderOrder;
var (spritePos, spriteRot) = _transforms.GetWorldPositionRotation(transform); 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; 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. // 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(); var relativeRotation = (spriteRot + eye.Rotation).Reduced().FlipPositive();
@@ -107,7 +107,7 @@ public sealed class ClickableSystem : EntitySystem
if (layer.Texture != null) if (layer.Texture != null)
{ {
// Convert to image coordinates // 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)) if (_clickMapManager.IsOccluding(layer.Texture, imagePos))
return true; return true;
@@ -125,7 +125,7 @@ public sealed class ClickableSystem : EntitySystem
var layerLocal = Vector2.Transform(localPos, inverseMatrix); var layerLocal = Vector2.Transform(localPos, inverseMatrix);
// Convert to image coordinates // 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. // 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. // This **can** differ from the dir defined before, but can also just be the same.

View File

@@ -18,23 +18,19 @@ public sealed class HideMechanismsCommand : LocalizedCommands
public override void Execute(IConsoleShell shell, string argStr, string[] args) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var containerSys = _entityManager.System<SharedContainerSystem>(); 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)) spriteSys.SetContainerOccluded((uid, sprite), false);
{
continue;
}
sprite.ContainerOccluded = false;
var tempParent = uid; var tempParent = uid;
while (containerSys.TryGetContainingContainer((tempParent, null, null), out var container)) while (containerSys.TryGetContainingContainer((tempParent, null, null), out var container))
{ {
if (!container.ShowContents) if (!container.ShowContents)
{ {
sprite.ContainerOccluded = true; spriteSys.SetContainerOccluded((uid, sprite), true);
break; break;
} }

View File

@@ -16,11 +16,12 @@ public sealed class ShowMechanismsCommand : LocalizedCommands
public override void Execute(IConsoleShell shell, string argStr, string[] args) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var spriteSys = _entManager.System<SpriteSystem>();
var query = _entManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>(); 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);
} }
} }
} }

View File

@@ -5,6 +5,8 @@ namespace Content.Client.Dice;
public sealed class DiceSystem : SharedDiceSystem public sealed class DiceSystem : SharedDiceSystem
{ {
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
@@ -18,11 +20,11 @@ public sealed class DiceSystem : SharedDiceSystem
return; return;
// TODO maybe just move each die to its own RSI? // 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) if (state == null)
return; return;
var prefix = state.Substring(0, state.IndexOf('_')); var prefix = state.Substring(0, state.IndexOf('_'));
sprite.LayerSetState(0, $"{prefix}_{entity.Comp.CurrentValue}"); _sprite.LayerSetRsiState((entity.Owner, sprite), 0, $"{prefix}_{entity.Comp.CurrentValue}");
} }
} }

View File

@@ -21,6 +21,7 @@ public sealed class DoAfterOverlay : Overlay
private readonly MetaDataSystem _meta; private readonly MetaDataSystem _meta;
private readonly ProgressColorSystem _progressColor; private readonly ProgressColorSystem _progressColor;
private readonly SharedContainerSystem _container; private readonly SharedContainerSystem _container;
private readonly SpriteSystem _sprite;
private readonly Texture _barTexture; private readonly Texture _barTexture;
private readonly ShaderInstance _unshadedShader; private readonly ShaderInstance _unshadedShader;
@@ -45,6 +46,7 @@ public sealed class DoAfterOverlay : Overlay
_meta = _entManager.EntitySysManager.GetEntitySystem<MetaDataSystem>(); _meta = _entManager.EntitySysManager.GetEntitySystem<MetaDataSystem>();
_container = _entManager.EntitySysManager.GetEntitySystem<SharedContainerSystem>(); _container = _entManager.EntitySysManager.GetEntitySystem<SharedContainerSystem>();
_progressColor = _entManager.System<ProgressColorSystem>(); _progressColor = _entManager.System<ProgressColorSystem>();
_sprite = _entManager.System<SpriteSystem>();
var sprite = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/progress_bar.rsi"), "icon"); var sprite = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/progress_bar.rsi"), "icon");
_barTexture = _entManager.EntitySysManager.GetEntitySystem<SpriteSystem>().Frame0(sprite); _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 // Use the sprite itself if we know its bounds. This means short or tall sprites don't get overlapped
// by the bar. // 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) // 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. // Offset by the texture size for every do_after we have.
@@ -135,7 +137,7 @@ public sealed class DoAfterOverlay : Overlay
if (doAfter.CancelledTime != null) if (doAfter.CancelledTime != null)
{ {
var elapsed = doAfter.CancelledTime.Value - doAfter.StartTime; 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 cancelElapsed = (time - doAfter.CancelledTime.Value).TotalSeconds;
var flash = Math.Floor(cancelElapsed / FlashTime) % 2 == 0; var flash = Math.Floor(cancelElapsed / FlashTime) % 2 == 0;
color = GetProgressColor(0, flash ? alpha : 0); color = GetProgressColor(0, flash ? alpha : 0);
@@ -143,7 +145,7 @@ public sealed class DoAfterOverlay : Overlay
else else
{ {
var elapsed = time - doAfter.StartTime; 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); color = GetProgressColor(elapsedRatio, alpha);
} }

View File

@@ -13,6 +13,7 @@ public sealed class ColorFlashEffectSystem : SharedColorFlashEffectSystem
{ {
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly AnimationPlayerSystem _animation = default!; [Dependency] private readonly AnimationPlayerSystem _animation = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
/// <summary> /// <summary>
/// It's a little on the long side but given we use multiple colours denoting what happened it makes it easier to register. /// 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)) if (TryComp<SpriteComponent>(uid, out var sprite))
{ {
sprite.Color = component.Color; _sprite.SetColor((uid, sprite), component.Color);
} }
} }

View File

@@ -11,6 +11,7 @@ public sealed class HolidaySystem : EntitySystem
{ {
[Dependency] private readonly IResourceCache _rescache = default!; [Dependency] private readonly IResourceCache _rescache = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()
@@ -29,6 +30,6 @@ public sealed class HolidaySystem : EntitySystem
var path = SpriteSpecifierSerializer.TextureRoot / rsistring; var path = SpriteSpecifierSerializer.TextureRoot / rsistring;
if (_rescache.TryGetResource(path, out RSIResource? rsi)) if (_rescache.TryGetResource(path, out RSIResource? rsi))
args.Sprite.BaseRSI = rsi.RSI; _sprite.SetBaseRsi((ent.Owner, args.Sprite), rsi.RSI);
} }
} }

View File

@@ -28,6 +28,7 @@ public sealed class EntityHealthBarOverlay : Overlay
private readonly MobStateSystem _mobStateSystem; private readonly MobStateSystem _mobStateSystem;
private readonly MobThresholdSystem _mobThresholdSystem; private readonly MobThresholdSystem _mobThresholdSystem;
private readonly StatusIconSystem _statusIconSystem; private readonly StatusIconSystem _statusIconSystem;
private readonly SpriteSystem _spriteSystem;
private readonly ProgressColorSystem _progressColor; private readonly ProgressColorSystem _progressColor;
@@ -43,6 +44,7 @@ public sealed class EntityHealthBarOverlay : Overlay
_mobStateSystem = _entManager.System<MobStateSystem>(); _mobStateSystem = _entManager.System<MobStateSystem>();
_mobThresholdSystem = _entManager.System<MobThresholdSystem>(); _mobThresholdSystem = _entManager.System<MobThresholdSystem>();
_statusIconSystem = _entManager.System<StatusIconSystem>(); _statusIconSystem = _entManager.System<StatusIconSystem>();
_spriteSystem = _entManager.System<SpriteSystem>();
_progressColor = _entManager.System<ProgressColorSystem>(); _progressColor = _entManager.System<ProgressColorSystem>();
} }
@@ -76,7 +78,7 @@ public sealed class EntityHealthBarOverlay : Overlay
continue; continue;
// we use the status icon component bounds if specified otherwise use sprite // 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); var worldPos = _transform.GetWorldPosition(xform, xformQuery);
if (!bounds.Translated(worldPos).Intersects(args.WorldAABB)) if (!bounds.Translated(worldPos).Intersects(args.WorldAABB))
@@ -136,7 +138,7 @@ public sealed class EntityHealthBarOverlay : Overlay
!_mobThresholdSystem.TryGetThresholdForState(uid, MobState.Dead, out threshold, thresholds)) !_mobThresholdSystem.TryGetThresholdForState(uid, MobState.Dead, out threshold, thresholds))
return (1, false); return (1, false);
var ratio = 1 - ((FixedPoint2) (dmg.TotalDamage / threshold)).Float(); var ratio = 1 - ((FixedPoint2)(dmg.TotalDamage / threshold)).Float();
return (ratio, false); return (ratio, false);
} }

View File

@@ -10,6 +10,8 @@ namespace Content.Client.Pointing;
public sealed partial class PointingSystem : SharedPointingSystem public sealed partial class PointingSystem : SharedPointingSystem
{ {
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
@@ -44,7 +46,7 @@ public sealed partial class PointingSystem : SharedPointingSystem
Verb verb = new() Verb verb = new()
{ {
Text = Loc.GetString("pointing-verb-get-data-text"), 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, ClientExclusive = true,
Act = () => RaiseNetworkEvent(new PointingAttemptEvent(GetNetEntity(args.Target))) 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) private void OnArrowStartup(EntityUid uid, PointingArrowComponent component, ComponentStartup args)
{ {
if (TryComp<SpriteComponent>(uid, out var sprite)) 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); 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)) if (TryComp<SpriteComponent>(uid, out var sprite))
{ {
sprite.DrawDepth = (int) DrawDepth.Overlays; _sprite.SetDrawDepth((uid, sprite), (int)DrawDepth.Overlays);
sprite.NoRotation = false; sprite.NoRotation = false;
} }
} }

View File

@@ -1,9 +1,7 @@
using Content.Shared.Projectiles; using Content.Shared.Projectiles;
using Robust.Shared.Spawners;
using Content.Shared.Weapons.Ranged.Systems; using Content.Shared.Weapons.Ranged.Systems;
using Robust.Client.Animations; using Robust.Client.Animations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Shared.GameStates;
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent; using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
namespace Content.Client.Projectiles; namespace Content.Client.Projectiles;
@@ -11,6 +9,7 @@ namespace Content.Client.Projectiles;
public sealed class ProjectileSystem : SharedProjectileSystem public sealed class ProjectileSystem : SharedProjectileSystem
{ {
[Dependency] private readonly AnimationPlayerSystem _player = default!; [Dependency] private readonly AnimationPlayerSystem _player = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -30,8 +29,8 @@ public sealed class ProjectileSystem : SharedProjectileSystem
if (TryComp<SpriteComponent>(ent, out var sprite)) if (TryComp<SpriteComponent>(ent, out var sprite))
{ {
sprite[EffectLayers.Unshaded].AutoAnimated = false; sprite[EffectLayers.Unshaded].AutoAnimated = false;
sprite.LayerMapTryGet(EffectLayers.Unshaded, out var layer); _sprite.LayerMapTryGet((ent, sprite), EffectLayers.Unshaded, out var layer, false);
var state = sprite.LayerGetState(layer); var state = _sprite.LayerGetRsiState((ent, sprite), layer);
var lifetime = 0.5f; var lifetime = 0.5f;
if (TryComp<TimedDespawnComponent>(ent, out var despawn)) if (TryComp<TimedDespawnComponent>(ent, out var despawn))

View File

@@ -1,11 +1,9 @@
using System.Numerics; using System.Numerics;
using Content.Shared.Salvage.Fulton; using Content.Shared.Salvage.Fulton;
using Robust.Shared.Spawners;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.Animations; using Robust.Client.Animations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Shared.Animations;
using Robust.Shared.Serialization.Manager; using Robust.Shared.Serialization.Manager;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent; using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
@@ -16,6 +14,7 @@ public sealed class FultonSystem : SharedFultonSystem
{ {
[Dependency] private readonly ISerializationManager _serManager = default!; [Dependency] private readonly ISerializationManager _serManager = default!;
[Dependency] private readonly AnimationPlayerSystem _player = default!; [Dependency] private readonly AnimationPlayerSystem _player = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
private static readonly TimeSpan AnimationDuration = TimeSpan.FromSeconds(0.4); private static readonly TimeSpan AnimationDuration = TimeSpan.FromSeconds(0.4);
@@ -82,8 +81,8 @@ public sealed class FultonSystem : SharedFultonSystem
} }
sprite.NoRotation = true; sprite.NoRotation = true;
var effectLayer = sprite.AddLayer(new SpriteSpecifier.Rsi(new ResPath("Objects/Tools/fulton_balloon.rsi"), "fulton_balloon")); var effectLayer = _sprite.AddLayer((animationEnt, sprite), new SpriteSpecifier.Rsi(new ResPath("Objects/Tools/fulton_balloon.rsi"), "fulton_balloon"));
sprite.LayerSetOffset(effectLayer, EffectOffset + new Vector2(0f, 0.5f)); _sprite.LayerSetOffset((animationEnt, sprite), effectLayer, EffectOffset + new Vector2(0f, 0.5f));
var despawn = AddComp<TimedDespawnComponent>(animationEnt); var despawn = AddComp<TimedDespawnComponent>(animationEnt);
despawn.Lifetime = 1.5f; despawn.Lifetime = 1.5f;

View File

@@ -12,6 +12,7 @@ public sealed class StealthSystem : SharedStealthSystem
{ {
[Dependency] private readonly IPrototypeManager _protoMan = default!; [Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
private ShaderInstance _shader = default!; private ShaderInstance _shader = default!;
@@ -40,7 +41,7 @@ public sealed class StealthSystem : SharedStealthSystem
if (!Resolve(uid, ref component, ref sprite, false)) if (!Resolve(uid, ref component, ref sprite, false))
return; return;
sprite.Color = Color.White; _sprite.SetColor((uid, sprite), Color.White);
sprite.PostShader = enabled ? _shader : null; sprite.PostShader = enabled ? _shader : null;
sprite.GetScreenTexture = enabled; sprite.GetScreenTexture = enabled;
sprite.RaiseShaderEvent = enabled; sprite.RaiseShaderEvent = enabled;
@@ -93,6 +94,6 @@ public sealed class StealthSystem : SharedStealthSystem
_shader.SetParameter("visibility", visibility); _shader.SetParameter("visibility", visibility);
visibility = MathF.Max(0, 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));
} }
} }

View File

@@ -33,6 +33,6 @@ public sealed class StickyVisualizerSystem : VisualizerSystem<StickyVisualizerCo
return; return;
var drawDepth = isStuck ? comp.StuckDrawDepth : comp.OriginalDrawDepth; var drawDepth = isStuck ? comp.StuckDrawDepth : comp.OriginalDrawDepth;
args.Sprite.DrawDepth = drawDepth; SpriteSystem.SetDrawDepth((uid, args.Sprite), drawDepth);
} }
} }

View File

@@ -4,7 +4,6 @@ using Content.Shared.SubFloor;
using Robust.Client.Animations; using Robust.Client.Animations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.Player; using Robust.Client.Player;
using Robust.Shared.Map;
using Robust.Shared.Timing; using Robust.Shared.Timing;
namespace Content.Client.SubFloor; namespace Content.Client.SubFloor;
@@ -19,6 +18,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!; [Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
[Dependency] private readonly TrayScanRevealSystem _trayScanReveal = default!; [Dependency] private readonly TrayScanRevealSystem _trayScanReveal = default!;
private const string TRayAnimationKey = "trays"; private const string TRayAnimationKey = "trays";
@@ -102,7 +102,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
if ((!_appearance.TryGetData(uid, SubFloorVisuals.ScannerRevealed, out bool value) || !value) && if ((!_appearance.TryGetData(uid, SubFloorVisuals.ScannerRevealed, out bool value) || !value) &&
sprite.Color.A > SubfloorRevealAlpha) sprite.Color.A > SubfloorRevealAlpha)
{ {
sprite.Color = sprite.Color.WithAlpha(0f); _sprite.SetColor((uid, sprite), sprite.Color.WithAlpha(0f));
} }
SetRevealed(uid, true); SetRevealed(uid, true);
@@ -136,7 +136,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
{ {
SetRevealed(uid, false); SetRevealed(uid, false);
RemCompDeferred<TrayRevealedComponent>(uid); RemCompDeferred<TrayRevealedComponent>(uid);
sprite.Color = sprite.Color.WithAlpha(1f); _sprite.SetColor((uid, sprite), sprite.Color.WithAlpha(1f));
continue; continue;
} }

View File

@@ -28,6 +28,7 @@ namespace Content.Client.Tabletop
[Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!; [Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = 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 // 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 private const float Delay = 1f / 10; // 10 Hz
@@ -224,12 +225,12 @@ namespace Content.Client.Tabletop
// the appearance handle the rest // the appearance handle the rest
if (_appearance.TryGetData<Vector2>(uid, TabletopItemVisuals.Scale, out var scale, args.Component)) 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)) 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) if (eye == null)
return MapCoordinates.Nullspace; 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 eyePosition = eye.Position.Position;
var eyeRotation = eye.Rotation; var eyeRotation = eye.Rotation;
var eyeScale = eye.Scale; var eyeScale = eye.Scale;

View File

@@ -21,7 +21,6 @@ using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input; using Robust.Shared.Input;
using Robust.Shared.Input.Binding; using Robust.Shared.Input.Binding;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using static Content.Client.Inventory.ClientInventorySystem; 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 ClientInventorySystem _inventorySystem = default!;
[UISystemDependency] private readonly HandsSystem _handsSystem = default!; [UISystemDependency] private readonly HandsSystem _handsSystem = default!;
[UISystemDependency] private readonly ContainerSystem _container = default!; [UISystemDependency] private readonly ContainerSystem _container = default!;
[UISystemDependency] private readonly SpriteSystem _sprite = default!;
private EntityUid? _playerUid; private EntityUid? _playerUid;
private InventorySlotsComponent? _playerInventory; private InventorySlotsComponent? _playerInventory;
@@ -364,8 +364,8 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
} }
} }
hoverSprite.CopyFrom(sprite); _sprite.CopySprite((held, sprite), (hoverEntity, hoverSprite));
hoverSprite.Color = fits ? new Color(0, 255, 0, 127) : new Color(255, 0, 0, 127); _sprite.SetColor((hoverEntity, hoverSprite), fits ? new Color(0, 255, 0, 127) : new Color(255, 0, 0, 127));
control.HoverSpriteView.SetEntity(hoverEntity); control.HoverSpriteView.SetEntity(hoverEntity);
} }