using Content.Shared.Atmos.Components; namespace Content.Client.Atmos.Consoles; public sealed class AtmosAlertsComputerBoundUserInterface : BoundUserInterface { [ViewVariables] private AtmosAlertsComputerWindow? _menu; public AtmosAlertsComputerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { } protected override void Open() { _menu = new AtmosAlertsComputerWindow(this, Owner); _menu.OpenCentered(); _menu.OnClose += Close; } protected override void UpdateState(BoundUserInterfaceState state) { base.UpdateState(state); var castState = (AtmosAlertsComputerBoundInterfaceState) state; EntMan.TryGetComponent(Owner, out var xform); _menu?.UpdateUI(xform?.Coordinates, castState.AirAlarms, castState.FireAlarms, castState.FocusData); } public void SendFocusChangeMessage(NetEntity? netEntity) { SendMessage(new AtmosAlertsComputerFocusChangeMessage(netEntity)); } public void SendDeviceSilencedMessage(NetEntity netEntity, bool silenceDevice) { SendMessage(new AtmosAlertsComputerDeviceSilencedMessage(netEntity, silenceDevice)); } protected override void Dispose(bool disposing) { base.Dispose(disposing); if (!disposing) return; _menu?.Dispose(); } }