adds examinable text for address to some device networked entities (#11455)
This commit is contained in:
@@ -6,6 +6,7 @@ using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
using System.Buffers;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Examine;
|
||||
using static Content.Server.DeviceNetwork.Components.DeviceNetworkComponent;
|
||||
|
||||
namespace Content.Server.DeviceNetwork.Systems
|
||||
@@ -28,6 +29,7 @@ namespace Content.Server.DeviceNetwork.Systems
|
||||
{
|
||||
SubscribeLocalEvent<DeviceNetworkComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<DeviceNetworkComponent, ComponentShutdown>(OnNetworkShutdown);
|
||||
SubscribeLocalEvent<DeviceNetworkComponent, ExaminedEvent>(OnExamine);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -59,6 +61,15 @@ namespace Content.Server.DeviceNetwork.Systems
|
||||
if (frequency != null)
|
||||
_packets.Enqueue(new DeviceNetworkPacketEvent(device.DeviceNetId, address, frequency.Value, device.Address, uid, data));
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, DeviceNetworkComponent device, ExaminedEvent args)
|
||||
{
|
||||
if (device.ExaminableAddress)
|
||||
{
|
||||
args.PushText(Loc.GetString("device-address-examine-message", ("address", device.Address)));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automatically attempt to connect some devices when a map starts.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user