Cleanup warnings in EntityStorageVisualizerSystem (#37385)

Cleanup warnings in EntityStorageVisualizerSystem
This commit is contained in:
Tayrtahn
2025-05-12 17:16:26 -04:00
committed by GitHub
parent a8255196f4
commit 848d176651

View File

@@ -5,6 +5,8 @@ namespace Content.Client.Storage.Visualizers;
public sealed class EntityStorageVisualizerSystem : VisualizerSystem<EntityStorageVisualsComponent> public sealed class EntityStorageVisualizerSystem : VisualizerSystem<EntityStorageVisualsComponent>
{ {
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
@@ -23,7 +25,7 @@ public sealed class EntityStorageVisualizerSystem : VisualizerSystem<EntityStora
if (!TryComp<SpriteComponent>(uid, out var sprite)) if (!TryComp<SpriteComponent>(uid, out var sprite))
return; return;
sprite.LayerSetState(StorageVisualLayers.Base, comp.StateBaseClosed); _sprite.LayerSetRsiState((uid, sprite), StorageVisualLayers.Base, comp.StateBaseClosed);
} }
protected override void OnAppearanceChange(EntityUid uid, EntityStorageVisualsComponent comp, ref AppearanceChangeEvent args) protected override void OnAppearanceChange(EntityUid uid, EntityStorageVisualsComponent comp, ref AppearanceChangeEvent args)
@@ -33,41 +35,41 @@ public sealed class EntityStorageVisualizerSystem : VisualizerSystem<EntityStora
return; return;
// Open/Closed state for the storage entity. // Open/Closed state for the storage entity.
if (args.Sprite.LayerMapTryGet(StorageVisualLayers.Door, out _)) if (_sprite.LayerMapTryGet((uid, args.Sprite), StorageVisualLayers.Door, out _, false))
{ {
if (open) if (open)
{ {
if (comp.OpenDrawDepth != null) if (comp.OpenDrawDepth != null)
args.Sprite.DrawDepth = comp.OpenDrawDepth.Value; _sprite.SetDrawDepth((uid, args.Sprite), comp.OpenDrawDepth.Value);
if (comp.StateDoorOpen != null) if (comp.StateDoorOpen != null)
{ {
args.Sprite.LayerSetState(StorageVisualLayers.Door, comp.StateDoorOpen); _sprite.LayerSetRsiState((uid, args.Sprite), StorageVisualLayers.Door, comp.StateDoorOpen);
args.Sprite.LayerSetVisible(StorageVisualLayers.Door, true); _sprite.LayerSetVisible((uid, args.Sprite), StorageVisualLayers.Door, true);
} }
else else
{ {
args.Sprite.LayerSetVisible(StorageVisualLayers.Door, false); _sprite.LayerSetVisible((uid, args.Sprite), StorageVisualLayers.Door, false);
} }
if (comp.StateBaseOpen != null) if (comp.StateBaseOpen != null)
args.Sprite.LayerSetState(StorageVisualLayers.Base, comp.StateBaseOpen); _sprite.LayerSetRsiState((uid, args.Sprite), StorageVisualLayers.Base, comp.StateBaseOpen);
} }
else else
{ {
if (comp.ClosedDrawDepth != null) if (comp.ClosedDrawDepth != null)
args.Sprite.DrawDepth = comp.ClosedDrawDepth.Value; _sprite.SetDrawDepth((uid, args.Sprite), comp.ClosedDrawDepth.Value);
if (comp.StateDoorClosed != null) if (comp.StateDoorClosed != null)
{ {
args.Sprite.LayerSetState(StorageVisualLayers.Door, comp.StateDoorClosed); _sprite.LayerSetRsiState((uid, args.Sprite), StorageVisualLayers.Door, comp.StateDoorClosed);
args.Sprite.LayerSetVisible(StorageVisualLayers.Door, true); _sprite.LayerSetVisible((uid, args.Sprite), StorageVisualLayers.Door, true);
} }
else else
args.Sprite.LayerSetVisible(StorageVisualLayers.Door, false); _sprite.LayerSetVisible((uid, args.Sprite), StorageVisualLayers.Door, false);
if (comp.StateBaseClosed != null) if (comp.StateBaseClosed != null)
args.Sprite.LayerSetState(StorageVisualLayers.Base, comp.StateBaseClosed); _sprite.LayerSetRsiState((uid, args.Sprite), StorageVisualLayers.Base, comp.StateBaseClosed);
} }
} }
} }