mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
28 lines
765 B
C#
28 lines
765 B
C#
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Implants;
|
|
|
|
public abstract partial class SharedChameleonControllerSystem : EntitySystem
|
|
{
|
|
[Dependency] private 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);
|
|
}
|
|
}
|