protected override void Open()
{
base.Open();
-
_window = new NavMapBeaconWindow(Owner);
_window.OpenCentered();
_window.OnClose += Close;
--- /dev/null
+using Robust.Client.GameObjects;
+
+namespace Content.Client.Pinpointer.UI;
+
+public sealed class UntrackedStationMapBoundUserInterface : BoundUserInterface
+{
+ [ViewVariables]
+ private StationMapWindow? _window;
+
+ public UntrackedStationMapBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
+ {
+ }
+
+ protected override void Open()
+ {
+ base.Open();
+ _window?.Close();
+ EntityUid? gridUid = null;
+
+ if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform))
+ {
+ gridUid = xform.GridUid;
+ }
+
+ _window = new StationMapWindow(gridUid, null);
+ _window.OpenCentered();
+ _window.OnClose += Close;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ base.Dispose(disposing);
+ _window?.Dispose();
+ }
+}
/// and there's not always enough players and ghost roles to justify it.
/// All logic in PAISystem.
/// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class PAIComponent : Component
{
/// <summary>
/// The last person who activated this PAI.
/// Used for assigning the name.
/// </summary>
- [DataField("lastUser"), ViewVariables(VVAccess.ReadWrite)]
+ [DataField, ViewVariables(VVAccess.ReadWrite)]
public EntityUid? LastUser;
- [DataField("midiActionId", serverOnly: true,
- customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
- public string? MidiActionId = "ActionPAIPlayMidi";
+ [DataField(serverOnly: true)]
+ public EntProtoId? MidiActionId = "ActionPAIPlayMidi";
- [DataField("midiAction", serverOnly: true)] // server only, as it uses a server-BUI event !type
+ [DataField(serverOnly: true)] // server only, as it uses a server-BUI event !type
public EntityUid? MidiAction;
+ [DataField]
+ public ProtoId<EntityPrototype> MapActionId = "ActionPAIOpenMap";
+
+ [DataField, AutoNetworkedField]
+ public EntityUid? MapAction;
+
/// <summary>
/// When microwaved there is this chance to brick the pai, kicking out its player and preventing it from being used again.
/// </summary>
- [DataField("brickChance")]
+ [DataField]
public float BrickChance = 0.5f;
/// <summary>
/// Locale id for the popup shown when the pai gets bricked.
/// </summary>
- [DataField("brickPopup")]
+ [DataField]
public string BrickPopup = "pai-system-brick-popup";
/// <summary>
/// Locale id for the popup shown when the pai is microwaved but does not get bricked.
/// </summary>
- [DataField("scramblePopup")]
+ [DataField]
public string ScramblePopup = "pai-system-scramble-popup";
}
private void OnMapInit(EntityUid uid, PAIComponent component, MapInitEvent args)
{
_actionsSystem.AddAction(uid, ref component.MidiAction, component.MidiActionId);
+ _actionsSystem.AddAction(uid, ref component.MapAction, component.MapActionId);
}
private void OnShutdown(EntityUid uid, PAIComponent component, ComponentShutdown args)
{
_actionsSystem.RemoveAction(uid, component.MidiAction);
+ _actionsSystem.RemoveAction(uid, component.MapAction);
}
}
}
interfaces:
- key: enum.InstrumentUiKey.Key
type: InstrumentBoundUserInterface
+ - key: enum.StationMapUiKey.Key
+ type: UntrackedStationMapBoundUserInterface
- type: Sprite
sprite: Objects/Fun/pai.rsi
layers:
Off: { state: pai-off-overlay }
Searching: { state: pai-searching-overlay }
On: { state: pai-on-overlay }
+ - type: StationMap
- type: entity
parent: PersonalAI
icon: Interface/Actions/pai-midi.png
event: !type:OpenUiActionEvent
key: enum.InstrumentUiKey.Key
+
+- type: entity
+ id: ActionPAIOpenMap
+ name: Open Map
+ description: Open your map interface and guide your owner.
+ noSpawn: true
+ components:
+ - type: InstantAction
+ checkCanInteract: false
+ icon: Interface/home.png
+ event: !type:OpenUiActionEvent
+ key: enum.StationMapUiKey.Key