CatStation/Content.Client/Storage/Visualizers/StorageFillVisualizerSystem.cs
Whatstone d9ffbf1d03
Cleanup: AppearanceSystem.TryGetData to AppearanceChangeEvent.TryGetData (#45373)
* First impl. of appearance TryGetData cleanup

* Handful of fixes

* DamageVisuals: fix HandleDamage call, inheritdoc

* bunch of unused AppearanceSystem instances

* Handful more unused appearance systems, inheritdoc

* JetpackSystem: Ent<T>

* cleanup roundup, more Ent<T>

* a few lingering AppearanceSystem.TryGetData calls

* more lingering AppearanceData access

* Remove unnecessary inheritdoc

* once again, with feeling
2026-10-05 00:45:37 +00:00

19 lines
683 B
C#

using Content.Shared.Storage.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Storage.Visualizers;
public sealed partial class StorageFillVisualizerSystem : VisualizerSystem<StorageFillVisualizerComponent>
{
protected override void OnAppearanceChange(EntityUid uid, StorageFillVisualizerComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
if (!args.TryGetData<int>(StorageFillVisuals.FillLevel, out var level))
return;
var state = $"{component.FillBaseName}-{level}";
SpriteSystem.LayerSetRsiState((uid, args.Sprite), StorageFillLayers.Fill, state);
}
}