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
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user