using Content.Shared.Weapons.Ranged.Components; namespace Content.Client.Weapons.Ranged.Systems; public sealed partial class GunSystem { protected override void InitializeBattery() { base.InitializeBattery(); SubscribeLocalEvent(OnAmmoCountUpdate); SubscribeLocalEvent(OnControl); } private void OnAmmoCountUpdate(Entity ent, ref UpdateAmmoCounterEvent args) { if (args.Control is not BoxesStatusControl boxes) return; boxes.Update(ent.Comp.Shots, ent.Comp.Capacity); } private void OnControl(Entity ent, ref AmmoCounterControlEvent args) { args.Control = new BoxesStatusControl(); } }