mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-02-15 00:54:51 +01:00
* cleanup * fix fixtures * prediction * fix test * review * fix svalinn visuals * fix chargers * fix portable recharger and its unlit visuals * fix borgs * oomba review * fix examination prediction
28 lines
857 B
C#
28 lines
857 B
C#
using Content.Shared.Weapons.Ranged.Components;
|
|
|
|
namespace Content.Client.Weapons.Ranged.Systems;
|
|
|
|
public sealed partial class GunSystem
|
|
{
|
|
protected override void InitializeBattery()
|
|
{
|
|
base.InitializeBattery();
|
|
|
|
SubscribeLocalEvent<BatteryAmmoProviderComponent, UpdateAmmoCounterEvent>(OnAmmoCountUpdate);
|
|
SubscribeLocalEvent<BatteryAmmoProviderComponent, AmmoCounterControlEvent>(OnControl);
|
|
}
|
|
|
|
private void OnAmmoCountUpdate(Entity<BatteryAmmoProviderComponent> ent, ref UpdateAmmoCounterEvent args)
|
|
{
|
|
if (args.Control is not BoxesStatusControl boxes)
|
|
return;
|
|
|
|
boxes.Update(ent.Comp.Shots, ent.Comp.Capacity);
|
|
}
|
|
|
|
private void OnControl(Entity<BatteryAmmoProviderComponent> ent, ref AmmoCounterControlEvent args)
|
|
{
|
|
args.Control = new BoxesStatusControl();
|
|
}
|
|
}
|