Moves guidebook UI logic to a UI Controller, some tweaks (#14601)

This commit is contained in:
AJCM-git
2023-03-22 23:41:43 -04:00
committed by GitHub
parent 6b2558456b
commit 7a6fddce4f
10 changed files with 268 additions and 127 deletions

View File

@@ -1,5 +1,6 @@
using Content.Client.Changelog;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Content.Client.UserInterface.Systems.Guidebook;
using Content.Shared.CCVar;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
@@ -34,6 +35,14 @@ namespace Content.Client.Info
AddInfoButton("server-info-wiki-button", CCVars.InfoLinksWiki);
AddInfoButton("server-info-forum-button", CCVars.InfoLinksForum);
var guidebookController = UserInterfaceManager.GetUIController<GuidebookUIController>();
var guidebookButton = new Button() { Text = Loc.GetString("server-info-guidebook-button") };
guidebookButton.OnPressed += _ =>
{
guidebookController.ToggleGuidebook();
};
buttons.AddChild(guidebookButton);
var changelogButton = new ChangelogButton();
changelogButton.OnPressed += args => UserInterfaceManager.GetUIController<ChangelogUIController>().ToggleWindow();
buttons.AddChild(changelogButton);