private void OnOpenRouterUIAttempt(EntityUid uid, DisposalRouterComponent router, ActivatableUIOpenAttemptEvent args) { if (!TryComp<HandsComponent>(args.User, out var hands)) { uid.PopupMessage(args.User, Loc.GetString("disposal-router-window-tag-input-activate-no-hands")); return; } var activeHandEntity = hands.ActiveHandEntity; if (activeHandEntity != null) { args.Cancel(); } }
private void OnActivate(EntityUid uid, ActivatableUIRequiresPowerComponent component, ActivatableUIOpenAttemptEvent args) { if (args.Cancelled) { return; } if (this.IsPowered(uid, EntityManager)) { return; } if (TryComp <WiresComponent>(uid, out var wires) && wires.IsPanelOpen) { return; } args.User.PopupMessageCursor(Loc.GetString("base-computer-ui-component-not-powered", ("machine", uid))); args.Cancel(); }
private void OnConsoleUIOpenAttempt(EntityUid uid, ShuttleConsoleComponent component, ActivatableUIOpenAttemptEvent args) { if (!TryPilot(args.User, uid)) { args.Cancel(); } }
private void OnActivate(EntityUid uid, ActivatableUIRequiresPowerComponent component, ActivatableUIOpenAttemptEvent args) { if (args.Cancelled) { return; } if (EntityManager.TryGetComponent <ApcPowerReceiverComponent>(uid, out var power) && !power.Powered) { args.User.PopupMessageCursor(Loc.GetString("base-computer-ui-component-not-powered")); args.Cancel(); } }