mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-06-09 13:26:34 +02:00
e7edf44ed3
* Implants-System-Predicted * popup * review * cleanup * I * ftl * fix test --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
35 lines
977 B
C#
35 lines
977 B
C#
using Content.Client.Implants.UI;
|
|
using Content.Client.Items;
|
|
using Content.Shared.Implants;
|
|
using Content.Shared.Implants.Components;
|
|
|
|
namespace Content.Client.Implants;
|
|
|
|
public sealed partial class ImplanterSystem : SharedImplanterSystem
|
|
{
|
|
[Dependency] private SharedUserInterfaceSystem _uiSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ImplanterComponent, AfterAutoHandleStateEvent>(OnHandleImplanterState);
|
|
Subs.ItemStatus<ImplanterComponent>(ent => new ImplanterStatusControl(ent));
|
|
}
|
|
|
|
private void OnHandleImplanterState(Entity<ImplanterComponent> ent, ref AfterAutoHandleStateEvent args)
|
|
{
|
|
UpdateUi(ent);
|
|
}
|
|
|
|
protected override void UpdateUi(Entity<ImplanterComponent> ent)
|
|
{
|
|
if (_uiSystem.TryGetOpenUi(ent.Owner, DeimplantUiKey.Key, out var bui))
|
|
{
|
|
bui.Update();
|
|
}
|
|
|
|
ent.Comp.UiUpdateNeeded = true;
|
|
}
|
|
}
|