private void OnClose(EntityUid uid, AirAlarmComponent component, BoundUIClosedEvent args) { component.ActivePlayers.Remove(args.Session.UserId); if (component.ActivePlayers.Count == 0) { RemoveActiveInterface(uid); } }
private void OnUIClose(EntityUid uid, ActivatableUIComponent component, BoundUIClosedEvent args) { if (args.Session != component.CurrentSingleUser) { return; } if (args.UiKey != component.Key) { return; } SetCurrentSingleUser(uid, null, component); }
private void OnBoundUIClosed(EntityUid uid, InstrumentComponent component, BoundUIClosedEvent args) { if (args.UiKey is not InstrumentUiKey) { return; } if (HasComp <ActiveInstrumentComponent>(uid) && _userInterfaceSystem.TryGetUi(uid, args.UiKey, out var bui) && bui.SubscribedSessions.Count == 0) { RemComp <ActiveInstrumentComponent>(uid); } Clean(uid, component); }
private void OnBoundUIClosed(EntityUid uid, ServerStorageComponent storageComp, BoundUIClosedEvent args) { if (TryComp <ActorComponent>(args.Session.AttachedEntity, out var actor) && actor?.PlayerSession != null) { CloseNestedInterfaces(uid, actor.PlayerSession, storageComp); } // If UI is closed for everyone if (!_uiSystem.IsUiOpen(uid, args.UiKey)) { storageComp.IsOpen = false; UpdateStorageVisualization(uid, storageComp); if (storageComp.StorageCloseSound is not null) { SoundSystem.Play(storageComp.StorageCloseSound.GetSound(), Filter.Pvs(uid, entityManager: EntityManager), uid, storageComp.StorageCloseSound.Params); } } }
private void OnCargoPilotConsoleClose(EntityUid uid, CargoPilotConsoleComponent component, BoundUIClosedEvent args) { component.Entity = null; }
/// <summary> /// Clears the active device list when the ui is closed /// </summary> private void OnUiClosed(EntityUid uid, NetworkConfiguratorComponent component, BoundUIClosedEvent args) { component.ActiveDeviceList = null; }
/// <summary> /// Stop piloting if the window is closed. /// </summary> private void OnConsoleUIClose(EntityUid uid, ShuttleConsoleComponent component, BoundUIClosedEvent args) { if ((ShuttleConsoleUiKey) args.UiKey != ShuttleConsoleUiKey.Key || args.Session.AttachedEntity is not { } user) { return; } // In case they D/C should still clean them up. foreach (var comp in EntityQuery <AutoDockComponent>(true)) { comp.Requesters.Remove(user); } RemovePilot(user); }
private void OnBoundUiClose(EntityUid uid, SurveillanceCameraMonitorComponent component, BoundUIClosedEvent args) { if (args.Session.AttachedEntity == null) { return; } RemoveViewer(uid, args.Session.AttachedEntity.Value, component); }