Files
OldThink/Content.Client/Chemistry/EntitySystems/InjectorSystem.cs

30 lines
1.0 KiB
C#
Raw Normal View History

2022-09-11 08:53:17 +02:00
using Content.Client.Chemistry.Components;
using Content.Client.Chemistry.UI;
using Content.Client.Items;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
2022-09-11 08:53:17 +02:00
using Robust.Shared.GameStates;
namespace Content.Client.Chemistry.EntitySystems;
public sealed class InjectorSystem : SharedInjectorSystem
2022-09-11 08:53:17 +02:00
{
public override void Initialize()
{
base.Initialize();
Subs.ItemStatus<InjectorComponent>(ent => new InjectorStatusControl(ent, SolutionContainers));
2022-09-11 08:53:17 +02:00
SubscribeLocalEvent<HyposprayComponent, ComponentHandleState>(OnHandleHyposprayState);
Subs.ItemStatus<HyposprayComponent>(ent => new HyposprayStatusControl(ent));
2022-09-11 08:53:17 +02:00
}
private void OnHandleHyposprayState(EntityUid uid, HyposprayComponent component, ref ComponentHandleState args)
{
if (args.Current is not HyposprayComponentState cState)
return;
component.CurrentVolume = cState.CurVolume;
component.TotalVolume = cState.MaxVolume;
component.UiUpdateNeeded = true;
}
}