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

@@ -48,7 +48,7 @@ public sealed class StatusIconOverlay : Overlay
if (xform.MapID != args.MapId || !sprite.Visible)
continue;
var bounds = comp.Bounds ?? sprite.Bounds;
var bounds = comp.Bounds ?? _sprite.GetLocalBounds((uid, sprite));
var worldPos = _transform.GetWorldPosition(xform, xformQuery);
@@ -86,28 +86,28 @@ public sealed class StatusIconOverlay : Overlay
if (proto.LocationPreference == StatusIconLocationPreference.Left ||
proto.LocationPreference == StatusIconLocationPreference.None && countL <= countR)
{
if (accOffsetL + texture.Height > sprite.Bounds.Height * EyeManager.PixelsPerMeter)
if (accOffsetL + texture.Height > _sprite.GetLocalBounds((uid, sprite)).Height * EyeManager.PixelsPerMeter)
break;
if (proto.Layer == StatusIconLayer.Base)
{
accOffsetL += texture.Height;
countL++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetL - proto.Offset) / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float)(accOffsetL - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = -(bounds.Width + sprite.Offset.X) / 2f;
}
else
{
if (accOffsetR + texture.Height > sprite.Bounds.Height * EyeManager.PixelsPerMeter)
if (accOffsetR + texture.Height > _sprite.GetLocalBounds((uid, sprite)).Height * EyeManager.PixelsPerMeter)
break;
if (proto.Layer == StatusIconLayer.Base)
{
accOffsetR += texture.Height;
countR++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetR - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float) texture.Width / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float)(accOffsetR - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float)texture.Width / EyeManager.PixelsPerMeter;
}