From 20be8298b7d7b8132d26f6386c2110b8b3dc9d06 Mon Sep 17 00:00:00 2001 From: SpaceManiac Date: Sat, 7 Dec 2024 10:13:56 -0800 Subject: [PATCH] Organize the Sandbox Panel window (#33684) * 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 | 7 +------ .../Systems/Sandbox/SandboxUIController.cs | 16 +++++++++------- .../Systems/Sandbox/Windows/SandboxWindow.xaml | 18 +++++++++++------- .../Locale/en-US/sandbox/sandbox-manager.ftl | 8 ++++++-- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Content.Client/Sandbox/SandboxSystem.cs b/Content.Client/Sandbox/SandboxSystem.cs index 8a4c93fa35..abc717642c 100644 --- a/Content.Client/Sandbox/SandboxSystem.cs +++ b/Content.Client/Sandbox/SandboxSystem.cs @@ -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"); - } } } diff --git a/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs b/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs index 58c8a1451b..1924bf2b24 100644 --- a/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs +++ b/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs @@ -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(); + // 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 _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 -