Merge more UI refactor stuff (#11277)

* Changelog+options ui controller
* Sandbox UI controller
* Escape menu UI controller
This commit is contained in:
wrexbe
2022-09-14 14:34:48 -07:00
committed by GitHub
parent 8871c445b8
commit 018a96ee88
23 changed files with 591 additions and 573 deletions

View File

@@ -0,0 +1,42 @@
using Content.Client.Changelog;
using JetBrains.Annotations;
using Robust.Client.State;
using Robust.Client.UserInterface.Controllers;
namespace Content.Client.UserInterface.Systems.EscapeMenu;
[UsedImplicitly]
public sealed class ChangelogUIController : UIController
{
private ChangelogWindow _changeLogWindow = default!;
public void OpenWindow()
{
EnsureWindow();
_changeLogWindow.OpenCentered();
_changeLogWindow.MoveToFront();
}
private void EnsureWindow()
{
if (_changeLogWindow is { Disposed: false })
return;
_changeLogWindow = UIManager.CreateWindow<ChangelogWindow>();
}
public void ToggleWindow()
{
EnsureWindow();
if (_changeLogWindow.IsOpen)
{
_changeLogWindow.Close();
}
else
{
OpenWindow();
}
}
}