Visualizer systems update (#8203)

* optimize appearance updating for subfloor entities

* sprite event args

* a

* stop double appearance update.
This commit is contained in:
Leon Friedrich
2022-05-16 14:41:23 +10:00
committed by GitHub
parent 920b4e5689
commit 25b9e048e5
22 changed files with 135 additions and 112 deletions

View File

@@ -1,4 +1,4 @@
using Content.Shared.Storage;
using Content.Shared.Storage;
using Content.Shared.Storage.Components;
using Robust.Client.GameObjects;
@@ -8,7 +8,8 @@ public sealed class StorageFillVisualizerSystem : VisualizerSystem<StorageFillVi
{
protected override void OnAppearanceChange(EntityUid uid, StorageFillVisualizerComponent component, ref AppearanceChangeEvent args)
{
base.OnAppearanceChange(uid, component, ref args);
if (args.Sprite == null)
return;
if (!TryComp(uid, out SpriteComponent? sprite))
return;
@@ -17,6 +18,6 @@ public sealed class StorageFillVisualizerSystem : VisualizerSystem<StorageFillVi
return;
var state = $"{component.FillBaseName}-{level}";
sprite.LayerSetState(StorageFillLayers.Fill, state);
args.Sprite.LayerSetState(StorageFillLayers.Fill, state);
}
}