diff --git a/Content.Client/GameObjects/Components/StackVisualizer.cs b/Content.Client/GameObjects/Components/StackVisualizer.cs index d409e79f0f..01d2a62eaa 100644 --- a/Content.Client/GameObjects/Components/StackVisualizer.cs +++ b/Content.Client/GameObjects/Components/StackVisualizer.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable using System.Collections.Generic; using Content.Shared.GameObjects.Components; @@ -75,6 +75,7 @@ namespace Content.Client.GameObjects.Components /// /// private bool _isComposite; + private ResourcePath? _spritePath; public override void LoadData(YamlMappingNode mapping) { @@ -92,6 +93,11 @@ namespace Content.Client.GameObjects.Components { _isComposite = transparent.AsBool(); } + + if (mapping.TryGetNode("sprite", out var spritePath)) + { + _spritePath = spritePath.AsResourcePath(); + } } public override void InitializeEntity(IEntity entity) @@ -102,9 +108,11 @@ namespace Content.Client.GameObjects.Components && _spriteLayers.Count > 0 && entity.TryGetComponent(out var spriteComponent)) { + _spritePath ??= spriteComponent.BaseRSI!.Path!; + foreach (var sprite in _spriteLayers) { - var rsiPath = spriteComponent.BaseRSI!.Path!; + var rsiPath = _spritePath; spriteComponent.LayerMapReserveBlank(sprite); spriteComponent.LayerSetSprite(sprite, new SpriteSpecifier.Rsi(rsiPath, sprite)); spriteComponent.LayerSetVisible(sprite, false);