Implanters and Subdermal Implants (#11840)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
33
Content.Client/Implants/ImplanterSystem.cs
Normal file
33
Content.Client/Implants/ImplanterSystem.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Content.Client.Implants.UI;
|
||||
using Content.Client.Items;
|
||||
using Content.Shared.Implants;
|
||||
using Content.Shared.Implants.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Client.Implants;
|
||||
|
||||
public sealed class ImplanterSystem : SharedImplanterSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ImplanterComponent, ComponentHandleState>(OnHandleImplanterState);
|
||||
SubscribeLocalEvent<ImplanterComponent, ItemStatusCollectMessage>(OnItemImplanterStatus);
|
||||
}
|
||||
|
||||
private void OnHandleImplanterState(EntityUid uid, ImplanterComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not ImplanterComponentState state)
|
||||
return;
|
||||
|
||||
component.CurrentMode = state.CurrentMode;
|
||||
component.ImplantOnly = state.ImplantOnly;
|
||||
component.UiUpdateNeeded = true;
|
||||
}
|
||||
|
||||
private void OnItemImplanterStatus(EntityUid uid, ImplanterComponent component, ItemStatusCollectMessage args)
|
||||
{
|
||||
args.Controls.Add(new ImplanterStatusControl(component));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user