Knowledge UI (#779)

* knowledge button in HUD

* ui controller

* bugfixes

* finish

* all-knowing ghosts

* Create knowledge-ui.ftl
This commit is contained in:
Ed
2025-01-18 14:43:11 +03:00
committed by GitHub
parent 734d12cfac
commit 68ab77d4d4
17 changed files with 308 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ public sealed class GameTopMenuBarUIController : UIController
[Dependency] private readonly SandboxUIController _sandbox = default!;
[Dependency] private readonly GuidebookUIController _guidebook = default!;
[Dependency] private readonly EmotesUIController _emotes = default!;
[Dependency] private readonly CP14KnowledgeUIController _knowledge = default!; //CP14
private GameTopMenuBar? GameTopMenuBar => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>();
@@ -47,6 +48,7 @@ public sealed class GameTopMenuBarUIController : UIController
_action.UnloadButton();
_sandbox.UnloadButton();
_emotes.UnloadButton();
_knowledge.UnloadButton(); //CP14
}
public void LoadButtons()
@@ -60,5 +62,6 @@ public sealed class GameTopMenuBarUIController : UIController
_action.LoadButton();
_sandbox.LoadButton();
_emotes.LoadButton();
_knowledge.LoadButton(); //CP14
}
}

View File

@@ -33,6 +33,18 @@
HorizontalExpand="True"
AppendStyleClass="{x:Static style:StyleBase.ButtonSquare}"
/>
<!-- CP14 UI part -->
<ui:MenuButton
Name="CP14KnowledgeButton"
Access="Internal"
Icon="{xe:Tex '/Textures/Interface/students-cap.svg.192dpi.png'}"
ToolTip="{Loc 'cp14-game-hud-open-knowledge-menu-button-tooltip'}"
BoundKey = "{x:Static is:ContentKeyFunctions.CP14OpenKnowledgeMenu}"
MinSize="42 64"
HorizontalExpand="True"
AppendStyleClass="{x:Static style:StyleBase.ButtonSquare}"
/>
<!-- CP14 UI part end -->
<ui:MenuButton
Name="CharacterButton"
Access="Internal"