diff --git a/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs b/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs index 013f70a991..8823ff8b3c 100644 --- a/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs +++ b/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs @@ -30,6 +30,7 @@ namespace Content.Client.Atmos.Monitor.UI _window.AtmosAlarmThresholdChanged += OnThresholdChanged; _window.AirAlarmModeChanged += OnAirAlarmModeChanged; _window.ResyncAllRequested += ResyncAllDevices; + _window.AirAlarmTabChange += OnTabChanged; } private void ResyncAllDevices() @@ -52,6 +53,11 @@ namespace Content.Client.Atmos.Monitor.UI SendMessage(new AirAlarmUpdateAlarmThresholdMessage(address, type, threshold, gas)); } + private void OnTabChanged(AirAlarmTab tab) + { + SendMessage(new AirAlarmTabSetMessage(tab)); + } + protected override void UpdateState(BoundUserInterfaceState state) { base.UpdateState(state); diff --git a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs index 56dc363d38..44068c1879 100644 --- a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs @@ -32,7 +32,6 @@ namespace Content.Client.Atmos.Monitor.UI private RichTextLabel _alarmState => CStatusLabel; private TabContainer _tabContainer => CTabContainer; - private BoxContainer _gasReadout => CGasContainer; private BoxContainer _ventDevices => CVentContainer; private BoxContainer _scrubberDevices => CScrubberContainer; @@ -61,12 +60,14 @@ namespace Content.Client.Atmos.Monitor.UI AirAlarmModeChanged!.Invoke((AirAlarmMode) args.Id); }; + /* foreach (var gas in Enum.GetValues()) { var gasLabel = new Label(); _gasReadout.AddChild(gasLabel); _gasLabels.Add(gas, gasLabel); } + */ _tabContainer.SetTabTitle(0, Loc.GetString("air-alarm-ui-window-tab-vents")); _tabContainer.SetTabTitle(1, Loc.GetString("air-alarm-ui-window-tab-scrubbers")); diff --git a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs index ffd2c9e37c..d43c93fcbb 100644 --- a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs @@ -212,11 +212,18 @@ namespace Content.Server.Atmos.Monitor.Systems SubscribeLocalEvent(OnUpdateAlarmMode); SubscribeLocalEvent(OnUpdateThreshold); SubscribeLocalEvent(OnUpdateDeviceData); + SubscribeLocalEvent(OnTabChange); SubscribeLocalEvent(OnClose); SubscribeLocalEvent(OnShutdown); SubscribeLocalEvent(OnInteract); } + private void OnTabChange(EntityUid uid, AirAlarmComponent component, AirAlarmTabSetMessage msg) + { + component.CurrentTab = msg.Tab; + UpdateUI(uid, component); + } + private void OnPowerChanged(EntityUid uid, AirAlarmComponent component, PowerChangedEvent args) { if (!args.Powered)