Resolve ClustergrenadeVisualizer is Obsolete (#13890)

This commit is contained in:
TemporalOroboros
2023-02-05 10:33:29 -08:00
committed by GitHub
parent 53fc53ebd3
commit c398076620
4 changed files with 27 additions and 37 deletions

View File

@@ -0,0 +1,16 @@
using Content.Shared.Explosion;
using Robust.Client.GameObjects;
namespace Content.Client.Explosion;
public sealed class ClusterGrenadeVisualizerSystem : VisualizerSystem<ClusterGrenadeVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, ClusterGrenadeVisualsComponent comp, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
if (AppearanceSystem.TryGetData<int>(uid, ClusterGrenadeVisuals.GrenadesCounter, out var grenadesCounter, args.Component))
args.Sprite.LayerSetState(0, $"{comp.State}-{grenadesCounter}");
}
}