vv for tripped thresholds, device list update event for air alarms

This commit is contained in:
vulppine
2022-08-22 18:41:24 -07:00
parent b8d011f8f4
commit 83cac4de1e
2 changed files with 7 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ namespace Content.Server.Atmos.Monitor.Components
[ViewVariables] [ViewVariables]
public AtmosMonitorAlarmType LastAlarmState = AtmosMonitorAlarmType.Normal; public AtmosMonitorAlarmType LastAlarmState = AtmosMonitorAlarmType.Normal;
public HashSet<AtmosMonitorThresholdType> TrippedThresholds = new(); [ViewVariables] public HashSet<AtmosMonitorThresholdType> TrippedThresholds = new();
/// <summary> /// <summary>
/// Registered devices in this atmos monitor. Alerts will be sent directly /// Registered devices in this atmos monitor. Alerts will be sent directly

View File

@@ -159,11 +159,17 @@ namespace Content.Server.Atmos.Monitor.Systems
SubscribeLocalEvent<AirAlarmComponent, AirAlarmUpdateAlarmThresholdMessage>(OnUpdateThreshold); SubscribeLocalEvent<AirAlarmComponent, AirAlarmUpdateAlarmThresholdMessage>(OnUpdateThreshold);
SubscribeLocalEvent<AirAlarmComponent, AirAlarmUpdateDeviceDataMessage>(OnUpdateDeviceData); SubscribeLocalEvent<AirAlarmComponent, AirAlarmUpdateDeviceDataMessage>(OnUpdateDeviceData);
SubscribeLocalEvent<AirAlarmComponent, AirAlarmTabSetMessage>(OnTabChange); SubscribeLocalEvent<AirAlarmComponent, AirAlarmTabSetMessage>(OnTabChange);
SubscribeLocalEvent<AirAlarmComponent, DeviceListUpdateEvent>(OnDeviceListUpdate);
SubscribeLocalEvent<AirAlarmComponent, BoundUIClosedEvent>(OnClose); SubscribeLocalEvent<AirAlarmComponent, BoundUIClosedEvent>(OnClose);
SubscribeLocalEvent<AirAlarmComponent, ComponentShutdown>(OnShutdown); SubscribeLocalEvent<AirAlarmComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<AirAlarmComponent, InteractHandEvent>(OnInteract); SubscribeLocalEvent<AirAlarmComponent, InteractHandEvent>(OnInteract);
} }
private void OnDeviceListUpdate(EntityUid uid, AirAlarmComponent component, DeviceListUpdateEvent args)
{
SyncRegisterAllDevices(uid);
}
private void OnTabChange(EntityUid uid, AirAlarmComponent component, AirAlarmTabSetMessage msg) private void OnTabChange(EntityUid uid, AirAlarmComponent component, AirAlarmTabSetMessage msg)
{ {
component.CurrentTab = msg.Tab; component.CurrentTab = msg.Tab;