]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Organize the Sandbox Panel window (#33684)
authorSpaceManiac <tad@platymuus.com>
Sat, 7 Dec 2024 18:13:56 +0000 (10:13 -0800)
committerGitHub <noreply@github.com>
Sat, 7 Dec 2024 18:13:56 +0000 (19:13 +0100)
* Organize Sandbox Panel

* Map Editing -> Editing

* Unset ToggleMode on Suicide button. Can hardly un-suicide, no?

* Remove 'Link machines' button that has done nothing for 3 years

* Remember Sandbox window's position instead of forcing to center

* Shows Spawns -> Show Spawns

* Remove SandboxSystem.MachineLinking

Content.Client/Sandbox/SandboxSystem.cs
Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs
Content.Client/UserInterface/Systems/Sandbox/Windows/SandboxWindow.xaml
Resources/Locale/en-US/sandbox/sandbox-manager.ftl

index 8a4c93fa354d8aaff7f778898549e5cd534068e8..abc717642c86cdbc7b999c6c7a93ba18aca42fca 100644 (file)
@@ -110,7 +110,7 @@ namespace Content.Client.Sandbox
             }
 
             // Try copy tile.
-            
+
             if (!_map.TryFindGridAt(_transform.ToMapCoordinates(coords), out var gridUid, out var grid) || !_mapSystem.TryGetTileRef(gridUid, grid, coords, out var tileRef))
                 return false;
 
@@ -157,10 +157,5 @@ namespace Content.Client.Sandbox
         {
             _consoleHost.ExecuteCommand("physics shapes");
         }
-
-        public void MachineLinking()
-        {
-            _consoleHost.ExecuteCommand("signallink");
-        }
     }
 }
index 58c8a1451bd6c93fa424507ad9b71e3b87731914..1924bf2b24c4883415771d4095c6bd2f530f3dda 100644 (file)
@@ -1,4 +1,5 @@
-using Content.Client.Administration.Managers;
+using System.Numerics;
+using Content.Client.Administration.Managers;
 using Content.Client.Gameplay;
 using Content.Client.Markers;
 using Content.Client.Sandbox;
@@ -7,9 +8,7 @@ using Content.Client.UserInterface.Controls;
 using Content.Client.UserInterface.Systems.DecalPlacer;
 using Content.Client.UserInterface.Systems.Sandbox.Windows;
 using Content.Shared.Input;
-using Content.Shared.Silicons.StationAi;
 using JetBrains.Annotations;
-using Robust.Client.Console;
 using Robust.Client.Debugging;
 using Robust.Client.Graphics;
 using Robust.Client.Input;
@@ -109,9 +108,13 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
 
     private void EnsureWindow()
     {
-        if(_window is { Disposed: false })
+        if (_window is { Disposed: false })
             return;
         _window = UIManager.CreateWindow<SandboxWindow>();
+        // Pre-center the window without forcing it to the center every time.
+        _window.OpenCentered();
+        _window.Close();
+
         _window.OnOpen += () => { SandboxButton!.Pressed = true; };
         _window.OnClose += () => { SandboxButton!.Pressed = false; };
         _window.ToggleLightButton.Pressed = !_light.Enabled;
@@ -149,7 +152,6 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
         _window.ToggleSubfloorButton.OnPressed += _ => _sandbox.ToggleSubFloor();
         _window.ShowMarkersButton.OnPressed += _ => _sandbox.ShowMarkers();
         _window.ShowBbButton.OnPressed += _ => _sandbox.ShowBb();
-        _window.MachineLinkingButton.OnPressed += _ => _sandbox.MachineLinking();
     }
 
     private void CheckSandboxVisibility()
@@ -164,7 +166,7 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
     {
         if (_window != null)
         {
-            _window.Dispose();
+            _window.Close();
             _window = null;
         }
 
@@ -209,7 +211,7 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
         if (_sandbox.SandboxAllowed && _window.IsOpen != true)
         {
             UIManager.ClickSound();
-            _window.OpenCentered();
+            _window.Open();
         }
         else
         {
index 05e65cf29c370ce4d94b739d8af3cf85e623b8eb..bec1d6b4d6f3858d2f8a45f265dbd46bc41fe8ce 100644 (file)
@@ -4,20 +4,24 @@
     Title="{Loc sandbox-window-title}"
     Resizable="False">
     <BoxContainer Orientation="Vertical" SeparationOverride="4">
-        <Button Name="AiOverlayButton" Access="Public" Text="{Loc sandbox-window-ai-overlay-button}" ToggleMode="True"/>
-        <Button Name="RespawnButton" Access="Public" Text="{Loc sandbox-window-respawn-button}"/>
-        <Button Name="SpawnEntitiesButton" Access="Public" Text="{Loc sandbox-window-spawn-entities-button}"/>
+        <Label Text="{Loc sandbox-window-map-editing-label}"/>
         <Button Name="SpawnTilesButton" Access="Public" Text="{Loc sandbox-window-spawn-tiles-button}"/>
+        <Button Name="SpawnEntitiesButton" Access="Public" Text="{Loc sandbox-window-spawn-entities-button}"/>
         <Button Name="SpawnDecalsButton" Access="Public" Text="{Loc sandbox-window-spawn-decals-button}"/>
-        <Button Name="GiveFullAccessButton" Access="Public" Text="{Loc sandbox-window-grant-full-access-button}"/>
-        <Button Name="GiveAghostButton" Access="Public" Text="{Loc sandbox-window-ghost-button}"/>
+
+        <Label Text="{Loc sandbox-window-visibility-label}"/>
         <Button Name="ToggleLightButton" Access="Public" Text="{Loc sandbox-window-toggle-lights-button}" ToggleMode="True"/>
         <Button Name="ToggleFovButton" Access="Public" Text="{Loc sandbox-window-toggle-fov-button}" ToggleMode="True"/>
         <Button Name="ToggleShadowsButton" Access="Public" Text="{Loc sandbox-window-toggle-shadows-button}" ToggleMode="True"/>
         <Button Name="ToggleSubfloorButton" Access="Public" Text="{Loc sandbox-window-toggle-subfloor-button}" ToggleMode="True"/>
-        <Button Name="SuicideButton" Access="Public" Text="{Loc sandbox-window-toggle-suicide-button}" ToggleMode="True"/>
+        <Button Name="AiOverlayButton" Access="Public" Text="{Loc sandbox-window-ai-overlay-button}" ToggleMode="True"/>
         <Button Name="ShowMarkersButton" Access="Public" Text="{Loc sandbox-window-show-spawns-button}" ToggleMode="True"/>
         <Button Name="ShowBbButton" Access="Public" Text="{Loc sandbox-window-show-bb-button}" ToggleMode="True"/>
-        <Button Name="MachineLinkingButton" Access="Public" Text="{Loc sandbox-window-link-machines-button}" ToggleMode="True"/>
+
+        <Label Text="{Loc sandbox-window-your-character-label}"/>
+        <Button Name="GiveAghostButton" Access="Public" Text="{Loc sandbox-window-ghost-button}"/>
+        <Button Name="GiveFullAccessButton" Access="Public" Text="{Loc sandbox-window-grant-full-access-button}"/>
+        <Button Name="SuicideButton" Access="Public" Text="{Loc sandbox-window-toggle-suicide-button}"/>
+        <Button Name="RespawnButton" Access="Public" Text="{Loc sandbox-window-respawn-button}"/>
     </BoxContainer>
 </windows:SandboxWindow>
index b6f973673234de6cba39851a4a92ee236d76f830..cc3c46ff5900439bb5a688e10bc10900e30ede69 100644 (file)
@@ -1,4 +1,9 @@
 sandbox-window-title = Sandbox Panel
+
+sandbox-window-map-editing-label = Editing
+sandbox-window-visibility-label = Visibility
+sandbox-window-your-character-label = Your Character
+
 sandbox-window-ai-overlay-button = AI Overlay
 sandbox-window-respawn-button = Respawn
 sandbox-window-spawn-entities-button = Spawn Entities
@@ -11,7 +16,6 @@ sandbox-window-toggle-fov-button = Toggle FOV
 sandbox-window-toggle-shadows-button = Toggle Shadows
 sandbox-window-toggle-subfloor-button = Toggle Subfloor
 sandbox-window-toggle-suicide-button = Suicide
-sandbox-window-show-spawns-button = Shows Spawns
+sandbox-window-show-spawns-button = Show Spawns
 sandbox-window-show-bb-button = Show BB
 sandbox-window-show-npc-button = Show NPC
-sandbox-window-link-machines-button = Link machines