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

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