Add copy threshold button to air alarms (#34346)
This commit is contained in:
@@ -131,6 +131,19 @@ public sealed class AirAlarmSystem : EntitySystem
|
||||
SyncDevice(uid, address);
|
||||
}
|
||||
|
||||
private void SetAllThresholds(EntityUid uid, string address, AtmosSensorData data)
|
||||
{
|
||||
var payload = new NetworkPayload
|
||||
{
|
||||
[DeviceNetworkConstants.Command] = AtmosMonitorSystem.AtmosMonitorSetAllThresholdsCmd,
|
||||
[AtmosMonitorSystem.AtmosMonitorAllThresholdData] = data
|
||||
};
|
||||
|
||||
_deviceNet.QueuePacket(uid, address, payload);
|
||||
|
||||
SyncDevice(uid, address);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sync this air alarm's mode with the rest of the network.
|
||||
/// </summary>
|
||||
@@ -341,6 +354,13 @@ public sealed class AirAlarmSystem : EntitySystem
|
||||
SetData(uid, addr, args.Data);
|
||||
}
|
||||
break;
|
||||
|
||||
case AtmosSensorData sensorData:
|
||||
foreach (string addr in component.SensorData.Keys)
|
||||
{
|
||||
SetAllThresholds(uid, addr, sensorData);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user