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,4 +1,3 @@
using Content.Client.Gameplay;
using Content.Client.UserInterface.Systems.Actions;
using Content.Client.UserInterface.Systems.Admin;
using Content.Client.UserInterface.Systems.Bwoink;
@@ -6,6 +5,7 @@ using Content.Client.UserInterface.Systems.Character;
using Content.Client.UserInterface.Systems.Crafting;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Content.Client.UserInterface.Systems.Gameplay;
using Content.Client.UserInterface.Systems.Guidebook;
using Content.Client.UserInterface.Systems.Inventory;
using Content.Client.UserInterface.Systems.MenuBar.Widgets;
using Content.Client.UserInterface.Systems.Sandbox;
@@ -23,6 +23,7 @@ public sealed class GameTopMenuBarUIController : UIController
[Dependency] private readonly AHelpUIController _ahelp = default!;
[Dependency] private readonly ActionUIController _action = default!;
[Dependency] private readonly SandboxUIController _sandbox = default!;
[Dependency] private readonly GuidebookUIController _guidebook = default!;
private GameTopMenuBar? GameTopMenuBar => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>();
@@ -38,6 +39,7 @@ public sealed class GameTopMenuBarUIController : UIController
public void UnloadButtons()
{
_escape.UnloadButton();
_guidebook.UnloadButton();
_inventory.UnloadButton();
_admin.UnloadButton();
_character.UnloadButton();
@@ -50,6 +52,7 @@ public sealed class GameTopMenuBarUIController : UIController
public void LoadButtons()
{
_escape.LoadButton();
_guidebook.LoadButton();
_inventory.LoadButton();
_admin.LoadButton();
_character.LoadButton();

View File

@@ -23,6 +23,16 @@
HorizontalExpand="True"
AppendStyleClass="{x:Static style:StyleBase.ButtonOpenRight}"
/>
<ui:MenuButton
Name="GuidebookButton"
Access="Internal"
Icon="{xe:Tex '/Textures/Interface/VerbIcons/information.svg.192dpi.png'}"
ToolTip="{Loc 'game-hud-open-guide-menu-button-tooltip'}"
BoundKey = "{x:Static is:ContentKeyFunctions.OpenGuidebook}"
MinSize="42 64"
HorizontalExpand="True"
AppendStyleClass="{x:Static style:StyleBase.ButtonSquare}"
/>
<ui:MenuButton
Name="CharacterButton"
Access="Internal"