Cleanup warnings in SubFloorHideSystem (#37488)

Cleanup warnings in SubFloorHideSystem
This commit is contained in:
Tayrtahn
2025-05-15 16:04:43 -04:00
committed by GitHub
parent b9337693d3
commit ff4644c6c9

View File

@@ -9,6 +9,7 @@ namespace Content.Client.SubFloor;
public sealed class SubFloorHideSystem : SharedSubFloorHideSystem public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
{ {
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
[Dependency] private readonly IUserInterfaceManager _ui = default!; [Dependency] private readonly IUserInterfaceManager _ui = default!;
private bool _showAll; private bool _showAll;
@@ -75,7 +76,7 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
var hasVisibleLayer = false; var hasVisibleLayer = false;
foreach (var layerKey in component.VisibleLayers) foreach (var layerKey in component.VisibleLayers)
{ {
if (!args.Sprite.LayerMapTryGet(layerKey, out var layerIndex)) if (!_sprite.LayerMapTryGet((uid, args.Sprite), layerKey, out var layerIndex, false))
continue; continue;
var layer = args.Sprite[layerIndex]; var layer = args.Sprite[layerIndex];
@@ -84,13 +85,13 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
hasVisibleLayer = true; hasVisibleLayer = true;
} }
args.Sprite.Visible = hasVisibleLayer || revealed; _sprite.SetVisible((uid, args.Sprite), hasVisibleLayer || revealed);
if (ShowAll) if (ShowAll)
{ {
// Allows sandbox mode to make wires visible over other stuff. // Allows sandbox mode to make wires visible over other stuff.
component.OriginalDrawDepth ??= args.Sprite.DrawDepth; component.OriginalDrawDepth ??= args.Sprite.DrawDepth;
args.Sprite.DrawDepth = (int)Shared.DrawDepth.DrawDepth.Overdoors; _sprite.SetDrawDepth((uid, args.Sprite), (int)Shared.DrawDepth.DrawDepth.Overdoors);
} }
else if (scannerRevealed) else if (scannerRevealed)
{ {
@@ -99,11 +100,11 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
return; return;
component.OriginalDrawDepth = args.Sprite.DrawDepth; component.OriginalDrawDepth = args.Sprite.DrawDepth;
var drawDepthDifference = Shared.DrawDepth.DrawDepth.ThickPipe - Shared.DrawDepth.DrawDepth.Puddles; var drawDepthDifference = Shared.DrawDepth.DrawDepth.ThickPipe - Shared.DrawDepth.DrawDepth.Puddles;
args.Sprite.DrawDepth -= drawDepthDifference - 1; _sprite.SetDrawDepth((uid, args.Sprite), args.Sprite.DrawDepth - (drawDepthDifference - 1));
} }
else if (component.OriginalDrawDepth.HasValue) else if (component.OriginalDrawDepth.HasValue)
{ {
args.Sprite.DrawDepth = component.OriginalDrawDepth.Value; _sprite.SetDrawDepth((uid, args.Sprite), component.OriginalDrawDepth.Value);
component.OriginalDrawDepth = null; component.OriginalDrawDepth = null;
} }
} }