Cleanup more SpriteComponent warnings (part 1) (#37508)

* Cleanup warnings in PuddleSystem

* Cleanup warnings in HandsSystem

* Cleanup warnings in EnsnareableSystem

* Cleanup warnings in ElectrocutionHUDVisualizerSystem
Also simplify some if statements

* Cleanup warnings in PlantHolderVisualizerSystem

* Cleanup warnings in AlertLevelDisplaySystem

* Cleanup warnings in TetherGunSystem

* Fix error in PlantHolderVisualizerSystem

* I hate var _
This commit is contained in:
Tayrtahn
2025-05-16 17:42:05 -04:00
committed by GitHub
parent 53e317ba61
commit 5267725aff
7 changed files with 53 additions and 48 deletions

View File

@@ -10,6 +10,7 @@ namespace Content.Client.Fluids;
public sealed class PuddleSystem : SharedPuddleSystem
{
[Dependency] private readonly IconSmoothSystem _smooth = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize()
{
@@ -27,7 +28,7 @@ public sealed class PuddleSystem : SharedPuddleSystem
if (args.AppearanceData.TryGetValue(PuddleVisuals.CurrentVolume, out var volumeObj))
{
volume = (float) volumeObj;
volume = (float)volumeObj;
}
// Update smoothing and sprite based on volume.
@@ -35,19 +36,19 @@ public sealed class PuddleSystem : SharedPuddleSystem
{
if (volume < LowThreshold)
{
args.Sprite.LayerSetState(0, $"{smooth.StateBase}a");
_sprite.LayerSetRsiState((uid, args.Sprite), 0, $"{smooth.StateBase}a");
_smooth.SetEnabled(uid, false, smooth);
}
else if (volume < MediumThreshold)
{
args.Sprite.LayerSetState(0, $"{smooth.StateBase}b");
_sprite.LayerSetRsiState((uid, args.Sprite), 0, $"{smooth.StateBase}b");
_smooth.SetEnabled(uid, false, smooth);
}
else
{
if (!smooth.Enabled)
{
args.Sprite.LayerSetState(0, $"{smooth.StateBase}0");
_sprite.LayerSetRsiState((uid, args.Sprite), 0, $"{smooth.StateBase}0");
_smooth.SetEnabled(uid, true, smooth);
_smooth.DirtyNeighbours(uid);
}
@@ -58,12 +59,12 @@ public sealed class PuddleSystem : SharedPuddleSystem
if (args.AppearanceData.TryGetValue(PuddleVisuals.SolutionColor, out var colorObj))
{
var color = (Color) colorObj;
args.Sprite.Color = color * baseColor;
var color = (Color)colorObj;
_sprite.SetColor((uid, args.Sprite), color * baseColor);
}
else
{
args.Sprite.Color *= baseColor;
_sprite.SetColor((uid, args.Sprite), args.Sprite.Color * baseColor);
}
}