1
0

ClusterGrenadeVisualizerSystem.cs 657 B

1234567891011121314151617
  1. using Content.Shared.Explosion;
  2. using Content.Shared.Explosion.Components;
  3. using Robust.Client.GameObjects;
  4. namespace Content.Client.Explosion;
  5. public sealed class ClusterGrenadeVisualizerSystem : VisualizerSystem<ClusterGrenadeVisualsComponent>
  6. {
  7. protected override void OnAppearanceChange(EntityUid uid, ClusterGrenadeVisualsComponent comp, ref AppearanceChangeEvent args)
  8. {
  9. if (args.Sprite == null)
  10. return;
  11. if (AppearanceSystem.TryGetData<int>(uid, ClusterGrenadeVisuals.GrenadesCounter, out var grenadesCounter, args.Component))
  12. args.Sprite.LayerSetState(0, $"{comp.State}-{grenadesCounter}");
  13. }
  14. }