alarmables should now attempt to update appearance on init
This commit is contained in:
@@ -41,10 +41,20 @@ public sealed class AtmosAlarmableSystem : EntitySystem
|
|||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
|
SubscribeLocalEvent<AtmosAlarmableComponent, ComponentInit>(OnInit);
|
||||||
SubscribeLocalEvent<AtmosAlarmableComponent, DeviceNetworkPacketEvent>(OnPacketRecv);
|
SubscribeLocalEvent<AtmosAlarmableComponent, DeviceNetworkPacketEvent>(OnPacketRecv);
|
||||||
SubscribeLocalEvent<AtmosAlarmableComponent, PowerChangedEvent>(OnPowerChange);
|
SubscribeLocalEvent<AtmosAlarmableComponent, PowerChangedEvent>(OnPowerChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnInit(EntityUid uid, AtmosAlarmableComponent component, ComponentInit args)
|
||||||
|
{
|
||||||
|
TryUpdateAlert(
|
||||||
|
uid,
|
||||||
|
TryGetHighestAlert(uid, out var alarm) ? alarm.Value : AtmosAlarmType.Normal,
|
||||||
|
component,
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnPowerChange(EntityUid uid, AtmosAlarmableComponent component, PowerChangedEvent args)
|
private void OnPowerChange(EntityUid uid, AtmosAlarmableComponent component, PowerChangedEvent args)
|
||||||
{
|
{
|
||||||
if (!args.Powered)
|
if (!args.Powered)
|
||||||
|
|||||||
Reference in New Issue
Block a user