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

@@ -1,4 +1,5 @@
using Content.Client.Options.UI;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
@@ -15,13 +16,10 @@ namespace Content.Client.Info
[Dependency] private readonly IEntitySystemManager _sysMan = default!;
[Dependency] private readonly RulesManager _rules = default!;
private OptionsMenu optionsMenu;
public RulesAndInfoWindow()
{
IoCManager.InjectDependencies(this);
optionsMenu = new OptionsMenu();
Title = Loc.GetString("ui-info-title");
@@ -52,7 +50,12 @@ namespace Content.Client.Info
AddSection(tutorialList, Loc.GetString("ui-info-header-gameplay"), "Gameplay.txt", true);
AddSection(tutorialList, Loc.GetString("ui-info-header-sandbox"), "Sandbox.txt", true);
infoControlSection.ControlsButton.OnPressed += _ => optionsMenu.OpenCentered();
infoControlSection.ControlsButton.OnPressed += OnOptionsPressed;
}
private void OnOptionsPressed(BaseButton.ButtonEventArgs obj)
{
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<OptionsUIController>().ToggleWindow();
}
private static void AddSection(Info info, Control control)