mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
17 lines
614 B
C#
17 lines
614 B
C#
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}");
|
|
}
|
|
}
|