6
StarHorizon_Public/Content.Shared/Implants/SharedChameleonControllerSystem.cs
2026-01-13 18:31:02 +02:00

29 lines
774 B
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.Implants;
public abstract partial class SharedChameleonControllerSystem : EntitySystem
{
[Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ChameleonControllerOpenMenuEvent>(OpenUI);
}
private void OpenUI(ChameleonControllerOpenMenuEvent ev)
{
var implant = ev.Action.Comp.Container;
if (!HasComp<ChameleonControllerImplantComponent>(implant))
return;
if (!_uiSystem.HasUi(implant.Value, ChameleonControllerKey.Key))
return;
_uiSystem.OpenUi(implant.Value, ChameleonControllerKey.Key, ev.Performer);
}
}