Add copy threshold button to air alarms (#34346)

This commit is contained in:
Southbridge
2025-01-10 01:55:05 -05:00
committed by GitHub
parent 0b1ed3ec7e
commit edbc861c78
8 changed files with 72 additions and 17 deletions

View File

@@ -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;
}
}