Files
space-station-14/Content.Client/Implants/ImplanterSystem.cs
T
Pok e7edf44ed3 Predict ImplantsSystem (#43993)
* Implants-System-Predicted

* popup

* review

* cleanup

* I

* ftl

* fix test

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-05-28 18:09:47 +00:00

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;
}
}