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
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
[Dependency] private readonly IUserInterfaceManager _ui = default!;
private bool _showAll;
@@ -75,7 +76,7 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
var hasVisibleLayer = false;
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;
var layer = args.Sprite[layerIndex];
@@ -84,13 +85,13 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
hasVisibleLayer = true;
}
args.Sprite.Visible = hasVisibleLayer || revealed;
_sprite.SetVisible((uid, args.Sprite), hasVisibleLayer || revealed);
if (ShowAll)
{
// Allows sandbox mode to make wires visible over other stuff.
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)
{
@@ -99,11 +100,11 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
return;
component.OriginalDrawDepth = args.Sprite.DrawDepth;
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)
{
args.Sprite.DrawDepth = component.OriginalDrawDepth.Value;
_sprite.SetDrawDepth((uid, args.Sprite), component.OriginalDrawDepth.Value);
component.OriginalDrawDepth = null;
}
}