devicelistsystem now emits an event when a device list is updated
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.DeviceNetwork.Components;
|
||||
using System.Linq;
|
||||
using Content.Server.DeviceNetwork.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
@@ -25,7 +26,10 @@ public sealed class DeviceListSystem : EntitySystem
|
||||
if (!merge)
|
||||
deviceList.Devices.Clear();
|
||||
|
||||
deviceList.Devices.UnionWith(devices);
|
||||
var devicesList = devices.ToList();
|
||||
deviceList.Devices.UnionWith(devicesList);
|
||||
|
||||
RaiseLocalEvent(uid, new DeviceListUpdateEvent(devicesList));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,3 +95,13 @@ public sealed class DeviceListSystem : EntitySystem
|
||||
args.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DeviceListUpdateEvent : EntityEventArgs
|
||||
{
|
||||
public DeviceListUpdateEvent(List<EntityUid> devices)
|
||||
{
|
||||
Devices = devices;
|
||||
}
|
||||
|
||||
public List<EntityUid> Devices { get; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user