Cleanup more SpriteComponent warnings (part 2) (#37527)

* Cleanup warnings in MagazineVisualsSpriteTest

* Cleanup warnings in WiresVisualizerSystem

* Cleanup warnings in GunSystem.SpentAmmo

* Cleanup warnings in GunSystem

* Cleanup warnings in GunSystem.ChamberMagazine

* Cleanup warnings in MeleeWeaponSystem.Effects

* Cleanup warnings in ToggleableLightVisualsSystem

* Cleanup warnings in StatusIconOverlay

* Cleanup warnings in SpriteFadeSystem

* Cleanup warnings in PdaVisualizerSystem

* Cleanup warnings in EnvelopeSystem

* Cleanup warnings in MechSystem

* Cleanup warnings in MappingOverlay

* Cleanup warnings in LockVisualizerSystem

* Cleanup warnings in DragDropSystem

* Cleanup warnings in GhostSystem

* Cleanup warnings in TriggerSystem.Proximity

* Cleanup warnings in DragonSystem

* Cleanup warnings in PortableScrubberVisualsSystem

* File-scoped namespace for PortableScrubberVisualsSystem
This commit is contained in:
Tayrtahn
2025-05-16 23:29:03 -04:00
committed by GitHub
parent 33f111c090
commit bd22361a6a
20 changed files with 108 additions and 92 deletions

View File

@@ -10,6 +10,7 @@ namespace Content.Client.Mech;
public sealed class MechSystem : SharedMechSystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -24,7 +25,7 @@ public sealed class MechSystem : SharedMechSystem
if (args.Sprite == null)
return;
if (!args.Sprite.TryGetLayer((int) MechVisualLayers.Base, out var layer))
if (!_sprite.LayerExists((uid, args.Sprite), MechVisualLayers.Base))
return;
var state = component.BaseState;
@@ -40,7 +41,7 @@ public sealed class MechSystem : SharedMechSystem
drawDepth = DrawDepth.SmallMobs;
}
layer.SetState(state);
args.Sprite.DrawDepth = (int) drawDepth;
_sprite.LayerSetRsiState((uid, args.Sprite), MechVisualLayers.Base, state);
_sprite.SetDrawDepth((uid, args.Sprite), (int)drawDepth);
}
}