some backend stuff for air alarms
finally, some UI states!!!
This commit is contained in:
@@ -3,11 +3,13 @@ using Content.Server.DeviceNetwork;
|
||||
using Content.Server.DeviceNetwork.Components;
|
||||
using Content.Server.DeviceNetwork.Systems;
|
||||
using Content.Shared.Atmos.Monitor;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Atmos.Monitor.Systems
|
||||
{
|
||||
public sealed class AtmosAlarmableSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<AtmosAlarmableComponent, DeviceNetworkPacketEvent>(OnPacketRecv);
|
||||
@@ -34,9 +36,15 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
{
|
||||
component.LastAlarmState = state;
|
||||
component.HighestNetworkState = netMax;
|
||||
UpdateAppearance(uid, netMax);
|
||||
RaiseLocalEvent(component.Owner, new AtmosMonitorAlarmEvent(state, netMax), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateAppearance(EntityUid uid, AtmosMonitorAlarmType alarm)
|
||||
{
|
||||
_appearance.SetData(uid, AtmosMonitorVisuals.AlarmType, alarm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user