Update battery-gun item status when charge changes (#6579)

Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
Leon Friedrich
2022-02-16 19:57:16 +13:00
committed by GitHub
parent f88cbbac11
commit 4dfcacb86a
5 changed files with 34 additions and 73 deletions

View File

@@ -0,0 +1,19 @@
using Content.Client.Weapons.Ranged.Barrels.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Weapons.Ranged.Barrels.EntitySystems;
public sealed class ClientBatteryBarrelSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ClientBatteryBarrelComponent, AppearanceChangeEvent>(OnAppearanceChange);
}
private void OnAppearanceChange(EntityUid uid, ClientBatteryBarrelComponent component, ref AppearanceChangeEvent args)
{
component.ItemStatus?.Update(args.Component);
}
}