air alarm now sends the count of known devices, rather than all types of devices
This commit is contained in:
@@ -15,10 +15,10 @@ public sealed class AirAlarmComponent : Component
|
||||
|
||||
[ViewVariables] public AirAlarmTab CurrentTab { get; set; }
|
||||
|
||||
public Dictionary<string, IAtmosDeviceData> DeviceData = new();
|
||||
public Dictionary<string, GasVentPumpData> VentData = new();
|
||||
public Dictionary<string, GasVentScrubberData> ScrubberData = new();
|
||||
public Dictionary<string, AtmosSensorData> SensorData = new();
|
||||
public readonly HashSet<string> KnownDevices = new();
|
||||
public readonly Dictionary<string, GasVentPumpData> VentData = new();
|
||||
public readonly Dictionary<string, GasVentScrubberData> ScrubberData = new();
|
||||
public readonly Dictionary<string, AtmosSensorData> SensorData = new();
|
||||
|
||||
public HashSet<NetUserId> ActivePlayers = new();
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ public sealed class AirAlarmSystem : EntitySystem
|
||||
{
|
||||
ForceCloseAllInterfaces(uid);
|
||||
component.CurrentModeUpdater = null;
|
||||
component.KnownDevices.Clear();
|
||||
component.ScrubberData.Clear();
|
||||
component.SensorData.Clear();
|
||||
component.VentData.Clear();
|
||||
@@ -232,6 +233,7 @@ public sealed class AirAlarmSystem : EntitySystem
|
||||
{
|
||||
if (AccessCheck(uid, args.Session.AttachedEntity, component))
|
||||
{
|
||||
component.KnownDevices.Clear();
|
||||
component.VentData.Clear();
|
||||
component.ScrubberData.Clear();
|
||||
component.SensorData.Clear();
|
||||
@@ -384,8 +386,6 @@ public sealed class AirAlarmSystem : EntitySystem
|
||||
|
||||
// Save into component.
|
||||
// Sync data to interface.
|
||||
// _airAlarmDataSystem.UpdateDeviceData(uid, args.SenderAddress, data);
|
||||
//
|
||||
switch (data)
|
||||
{
|
||||
case GasVentPumpData ventData:
|
||||
@@ -402,6 +402,8 @@ public sealed class AirAlarmSystem : EntitySystem
|
||||
break;
|
||||
}
|
||||
|
||||
controller.KnownDevices.Add(args.SenderAddress);
|
||||
|
||||
UpdateUI(uid, controller);
|
||||
|
||||
return;
|
||||
@@ -500,7 +502,7 @@ public sealed class AirAlarmSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
var deviceCount = alarm.VentData.Count + alarm.ScrubberData.Count + alarm.SensorData.Count;
|
||||
var deviceCount = alarm.KnownDevices.Count;
|
||||
|
||||
if (!_atmosAlarmable.TryGetHighestAlert(uid, out var highestAlarm))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user