using Content.Server.Audio;
using Content.Server.Chat.Systems;
using Content.Server.Explosion.EntitySystems;
+using Content.Server.Pinpointer;
using Content.Server.Popups;
using Content.Server.Station.Systems;
using Content.Shared.Audio;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
[Dependency] private readonly ItemSlotsSystem _itemSlots = default!;
+ [Dependency] private readonly NavMapSystem _navMap = default!;
[Dependency] private readonly PointLightSystem _pointLight = default!;
[Dependency] private readonly PopupSystem _popups = default!;
[Dependency] private readonly ServerGlobalSoundSystem _sound = default!;
// turn on the spinny light
_pointLight.SetEnabled(uid, true);
+ // enable the navmap beacon for people to find it
+ _navMap.SetBeaconEnabled(uid, true);
_itemSlots.SetLock(uid, component.DiskSlot, true);
if (!nukeXform.Anchored)
// turn off the spinny light
_pointLight.SetEnabled(uid, false);
+ // disable the navmap beacon now that its disarmed
+ _navMap.SetBeaconEnabled(uid, false);
// start bomb cooldown
_itemSlots.SetLock(uid, component.DiskSlot, false);
while (beaconQuery.MoveNext(out var beaconUid, out var beacon, out var xform))
{
- if (xform.GridUid != uid || !CanBeacon(beaconUid, xform))
+ if (!beacon.Enabled || xform.GridUid != uid || !CanBeacon(beaconUid, xform))
continue;
// TODO: Make warp points use metadata name instead.
Dirty(component);
}
+
+ /// <summary>
+ /// Sets the beacon's Enabled field and refreshes the grid.
+ /// </summary>
+ public void SetBeaconEnabled(EntityUid uid, bool enabled, NavMapBeaconComponent? comp = null)
+ {
+ if (!Resolve(uid, ref comp) || comp.Enabled == enabled)
+ return;
+
+ comp.Enabled = enabled;
+
+ RefreshNavGrid(uid);
+ }
+
+ /// <summary>
+ /// Toggles the beacon's Enabled field and refreshes the grid.
+ /// </summary>
+ public void ToggleBeacon(EntityUid uid, NavMapBeaconComponent? comp = null)
+ {
+ if (!Resolve(uid, ref comp))
+ return;
+
+ SetBeaconEnabled(uid, !comp.Enabled, comp);
+ }
}
/// <summary>
/// Will show a marker on a NavMap.
/// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, Access(typeof(SharedNavMapSystem))]
public sealed partial class NavMapBeaconComponent : Component
{
/// <summary>
/// Defaults to entity name if nothing found.
/// </summary>
- [ViewVariables(VVAccess.ReadWrite), DataField("text"), AutoNetworkedField]
+ [ViewVariables(VVAccess.ReadWrite), DataField]
public string? Text;
- [ViewVariables(VVAccess.ReadWrite), DataField("color"), AutoNetworkedField]
+ [ViewVariables(VVAccess.ReadWrite), DataField]
public Color Color = Color.Orange;
+
+ /// <summary>
+ /// Only enabled beacons can be seen on a station map.
+ /// </summary>
+ [ViewVariables(VVAccess.ReadWrite), DataField]
+ public bool Enabled = true;
}
mask: /Textures/Effects/LightMasks/double_cone.png
- type: RotatingLight
speed: 120
+ - type: NavMapBeacon
+ color: "#ff0000"
+ text: nuclear fission explosive
+ enabled: false
- type: NukeLabel
- type: Nuke
explosionType: Default