Skip to content

Commit

Permalink
Add UpdateAmmoCount
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirus59 committed Aug 15, 2024
1 parent 387c6fc commit 8cdd111
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Content.Client/Weapons/Ranged/Systems/GunSystem.Battery.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.Weapons.Ranged.Components;
using Robust.Client.GameObjects;

namespace Content.Client.Weapons.Ranged.Systems;

Expand All @@ -10,10 +11,12 @@ protected override void InitializeBattery()
// Hitscan
SubscribeLocalEvent<HitscanBatteryAmmoProviderComponent, AmmoCounterControlEvent>(OnControl);
SubscribeLocalEvent<HitscanBatteryAmmoProviderComponent, UpdateAmmoCounterEvent>(OnAmmoCountUpdate);
SubscribeLocalEvent<HitscanBatteryAmmoProviderComponent, AppearanceChangeEvent>(OnAppearanceChange); //SS220 Add Multifaze gun

// Projectile
SubscribeLocalEvent<ProjectileBatteryAmmoProviderComponent, AmmoCounterControlEvent>(OnControl);
SubscribeLocalEvent<ProjectileBatteryAmmoProviderComponent, UpdateAmmoCounterEvent>(OnAmmoCountUpdate);
SubscribeLocalEvent<ProjectileBatteryAmmoProviderComponent, AppearanceChangeEvent>(OnAppearanceChange); //SS220 Add Multifaze gun
}

private void OnAmmoCountUpdate(EntityUid uid, BatteryAmmoProviderComponent component, UpdateAmmoCounterEvent args)
Expand All @@ -27,4 +30,11 @@ private void OnControl(EntityUid uid, BatteryAmmoProviderComponent component, Am
{
args.Control = new BoxesStatusControl();
}

//SS220 Add Multifaze gun begin
private void OnAppearanceChange(EntityUid uid, BatteryAmmoProviderComponent component, ref AppearanceChangeEvent args)
{
UpdateAmmoCount(uid);
}
//SS220 Add Multifaze gun end
}

0 comments on commit 8cdd111

Please sign in to comment.