Predict Nav Beacon Examine (#39408)
* commit * Update Content.Shared/Pinpointer/SharedNavMapSystem.cs Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Network;
|
||||
@@ -34,6 +35,8 @@ public abstract class SharedNavMapSystem : EntitySystem
|
||||
|
||||
// Data handling events
|
||||
SubscribeLocalEvent<NavMapComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<ConfigurableNavMapBeaconComponent, ExaminedEvent>(OnConfigurableExamined);
|
||||
|
||||
_doorQuery = GetEntityQuery<NavMapDoorComponent>();
|
||||
}
|
||||
|
||||
@@ -164,6 +167,17 @@ public abstract class SharedNavMapSystem : EntitySystem
|
||||
args.State = new NavMapDeltaState(chunks, component.Beacons, component.RegionProperties, new(component.Chunks.Keys));
|
||||
}
|
||||
|
||||
private void OnConfigurableExamined(Entity<ConfigurableNavMapBeaconComponent> ent, ref ExaminedEvent args)
|
||||
{
|
||||
if (!args.IsInDetailsRange || !TryComp<NavMapBeaconComponent>(ent, out var navMap))
|
||||
return;
|
||||
|
||||
args.PushMarkup(Loc.GetString("nav-beacon-examine-text",
|
||||
("enabled", navMap.Enabled),
|
||||
("color", navMap.Color.ToHexNoAlpha()),
|
||||
("label", navMap.Text ?? string.Empty)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region: System messages
|
||||
|
||||
Reference in New Issue
Block a user