fire alarms (and anything that uses Reset/ForceAlert) should now update their appearance and play noises
This commit is contained in:
@@ -132,17 +132,21 @@ namespace Content.Server.Atmos.Monitor.Systems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TryUpdateAlert(EntityUid uid, AtmosMonitorAlarmType type, AtmosAlarmableComponent alarmable)
|
private void TryUpdateAlert(EntityUid uid, AtmosMonitorAlarmType type, AtmosAlarmableComponent alarmable, bool sync = true)
|
||||||
{
|
{
|
||||||
if (alarmable.LastAlarmState == type)
|
if (alarmable.LastAlarmState == type)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sync)
|
||||||
|
{
|
||||||
|
SyncAlertsToNetwork(uid, null, alarmable);
|
||||||
|
}
|
||||||
|
|
||||||
alarmable.LastAlarmState = type;
|
alarmable.LastAlarmState = type;
|
||||||
UpdateAppearance(uid, type);
|
UpdateAppearance(uid, type);
|
||||||
PlayAlertSound(uid, type, alarmable);
|
PlayAlertSound(uid, type, alarmable);
|
||||||
SyncAlertsToNetwork(uid, null, alarmable);
|
|
||||||
RaiseLocalEvent(uid, new AtmosMonitorAlarmEvent(type, type), true);
|
RaiseLocalEvent(uid, new AtmosMonitorAlarmEvent(type, type), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,9 +182,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
alarmable.LastAlarmState = alarmType;
|
TryUpdateAlert(uid, alarmType, alarmable, false);
|
||||||
|
|
||||||
RaiseLocalEvent(uid, new AtmosMonitorAlarmEvent(alarmType, alarmType));
|
|
||||||
|
|
||||||
if (alarmable.ReceiveOnly)
|
if (alarmable.ReceiveOnly)
|
||||||
{
|
{
|
||||||
@@ -214,10 +216,9 @@ namespace Content.Server.Atmos.Monitor.Systems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
alarmable.LastAlarmState = AtmosMonitorAlarmType.Normal;
|
TryUpdateAlert(uid, AtmosMonitorAlarmType.Normal, alarmable, false);
|
||||||
alarmable.NetworkAlarmStates.Clear();
|
|
||||||
|
|
||||||
RaiseLocalEvent(uid, new AtmosMonitorAlarmEvent(AtmosMonitorAlarmType.Normal, AtmosMonitorAlarmType.Normal));
|
alarmable.NetworkAlarmStates.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetAllOnNetwork(EntityUid uid, AtmosAlarmableComponent? alarmable = null, TagComponent? tags = null)
|
public void ResetAllOnNetwork(EntityUid uid, AtmosAlarmableComponent? alarmable = null, TagComponent? tags = null)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
transmitFrequencyId: AtmosMonitor
|
transmitFrequencyId: AtmosMonitor
|
||||||
sendBroadcastAttemptEvent: true
|
sendBroadcastAttemptEvent: true
|
||||||
- type: DeviceList
|
- type: DeviceList
|
||||||
- type: ApcNetworkConnection
|
- type: WiredNetworkConnection
|
||||||
- type: AtmosMonitor
|
- type: AtmosMonitor
|
||||||
monitorFire: true
|
monitorFire: true
|
||||||
displayMaxAlarmInNet: true
|
displayMaxAlarmInNet: true
|
||||||
|
|||||||
Reference in New Issue
Block a user