]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
remove UntrackedMapBoundUserInterface (#30752)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Fri, 9 Aug 2024 05:24:49 +0000 (07:24 +0200)
committerGitHub <noreply@github.com>
Fri, 9 Aug 2024 05:24:49 +0000 (15:24 +1000)
Content.Client/Pinpointer/UI/StationMapBoundUserInterface.cs
Content.Client/Pinpointer/UI/UntrackedMapBoundUserInterface.cs [deleted file]
Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs
Content.Server/Pinpointer/StationMapUserComponent.cs [moved from Content.Server/Pinpointer/StationMapComponent.cs with 77% similarity]
Content.Shared/Pinpointer/StationMapComponent.cs [new file with mode: 0644]
Resources/Prototypes/Entities/Objects/Fun/pai.yml

index 7417fafede526ee643b25a351f8a92366b267452..91fb4ef71bd6c99d1370d73e3fcb6ce12ea553af 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Pinpointer;
 using Robust.Client.UserInterface;
 
 namespace Content.Client.Pinpointer.UI;
@@ -23,6 +24,9 @@ public sealed class StationMapBoundUserInterface : BoundUserInterface
 
         _window = this.CreateWindow<StationMapWindow>();
         _window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
-        _window.Set(gridUid, Owner);
+        if (EntMan.TryGetComponent<StationMapComponent>(Owner, out var comp) && comp.ShowLocation)
+            _window.Set(gridUid, Owner);
+        else
+            _window.Set(gridUid, null);
     }
 }
diff --git a/Content.Client/Pinpointer/UI/UntrackedMapBoundUserInterface.cs b/Content.Client/Pinpointer/UI/UntrackedMapBoundUserInterface.cs
deleted file mode 100644 (file)
index a3ca6f6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-using Robust.Client.UserInterface;
-
-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();
-        EntityUid? gridUid = null;
-
-        // TODO: What this just looks like it's been copy-pasted wholesale from StationMapBoundUserInterface?
-        if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform))
-        {
-            gridUid = xform.GridUid;
-        }
-
-        _window = this.CreateWindow<StationMapWindow>();
-        _window.Set(gridUid, Owner);
-    }
-}
index 0ccb5e314b98b764a6897f7b1441a00b7edf0306..a4563aa37e6e64efdb3feeb8790cb400529f4641 100644 (file)
@@ -5,7 +5,6 @@ using Content.Server.GameTicking;
 using Content.Server.GameTicking.Presets;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Mind;
-using Content.Server.Pinpointer;
 using Content.Server.Roles;
 using Content.Server.RoundEnd;
 using Content.Server.Shuttles.Components;
@@ -18,6 +17,7 @@ using Content.Shared.Hands.Components;
 using Content.Shared.Inventory;
 using Content.Shared.NPC.Systems;
 using Content.Shared.NukeOps;
+using Content.Shared.Pinpointer;
 using Content.Shared.Station.Components;
 using Robust.Server.GameObjects;
 using Robust.Shared.GameObjects;
similarity index 77%
rename from Content.Server/Pinpointer/StationMapComponent.cs
rename to Content.Server/Pinpointer/StationMapUserComponent.cs
index 942ea1aba8e96f561c96d197e38f6786f717b1df..358e26d82e8e5bb9038ed928128019c23d4bc049 100644 (file)
@@ -1,11 +1,5 @@
 namespace Content.Server.Pinpointer;
 
-[RegisterComponent]
-public sealed partial class StationMapComponent : Component
-{
-
-}
-
 /// <summary>
 /// Added to an entity using station map so when its parent changes we reset it.
 /// </summary>
diff --git a/Content.Shared/Pinpointer/StationMapComponent.cs b/Content.Shared/Pinpointer/StationMapComponent.cs
new file mode 100644 (file)
index 0000000..07cc996
--- /dev/null
@@ -0,0 +1,11 @@
+namespace Content.Shared.Pinpointer;
+
+[RegisterComponent]
+public sealed partial class StationMapComponent : Component
+{
+    /// <summary>
+    /// Whether or not to show the user's location on the map.
+    /// </summary>
+    [DataField]
+    public bool ShowLocation = true;
+}
index c12f8a8d00884109b250cf4560f16e34f97bf194..77f16fcd412e87394d71217fad3fca40e21061c9 100644 (file)
@@ -17,7 +17,7 @@
         type: InstrumentBoundUserInterface
         requireInputValidation: false
       enum.StationMapUiKey.Key:
-        type: UntrackedStationMapBoundUserInterface
+        type: StationMapBoundUserInterface
         requireInputValidation: false
   - type: Sprite
     sprite: Objects/Fun/pai.rsi