SubscribeLocalEvent<NavMapBeaconComponent, AnchorStateChangedEvent>(OnNavMapBeaconAnchor);
SubscribeLocalEvent<ConfigurableNavMapBeaconComponent, NavMapBeaconConfigureBuiMessage>(OnConfigureMessage);
SubscribeLocalEvent<ConfigurableNavMapBeaconComponent, MapInitEvent>(OnConfigurableMapInit);
- SubscribeLocalEvent<ConfigurableNavMapBeaconComponent, ExaminedEvent>(OnConfigurableExamined);
}
private void OnStationInit(StationGridAddedEvent ev)
UpdateBeaconEnabledVisuals((ent, navMap));
}
- 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: Grid functions
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedNavMapSystem))]
-public sealed partial class ConfigurableNavMapBeaconComponent : Component
-{
-
-}
+public sealed partial class ConfigurableNavMapBeaconComponent : Component;
[Serializable, NetSerializable]
public sealed class NavMapBeaconConfigureBuiMessage : BoundUserInterfaceMessage
[Serializable, NetSerializable]
public enum NavMapBeaconUiKey : byte
{
- Key
+ Key,
}
[Serializable, NetSerializable]
public enum NavMapBeaconVisuals : byte
{
- Enabled
+ Enabled,
}
/// <summary>
/// Defaults to entity name if nothing found.
/// </summary>
- [ViewVariables(VVAccess.ReadWrite), DataField]
- [AutoNetworkedField]
+ [DataField, AutoNetworkedField]
public string? Text;
/// <summary>
[DataField]
public LocId? DefaultText;
- [ViewVariables(VVAccess.ReadWrite), DataField]
- [AutoNetworkedField]
+ [DataField, AutoNetworkedField]
public Color Color = Color.Orange;
/// <summary>
/// Only enabled beacons can be seen on a station map.
/// </summary>
- [ViewVariables(VVAccess.ReadWrite), DataField]
- [AutoNetworkedField]
+ [DataField, AutoNetworkedField]
public bool Enabled = true;
}
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;
// Data handling events
SubscribeLocalEvent<NavMapComponent, ComponentGetState>(OnGetState);
+ SubscribeLocalEvent<ConfigurableNavMapBeaconComponent, ExaminedEvent>(OnConfigurableExamined);
+
_doorQuery = GetEntityQuery<NavMapDoorComponent>();
}
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