| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 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()
- {
- base.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<TransformComponent>(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();
- }
- }
|