refactor: implement singleton pattern for key managers and improve resource access

This commit is contained in:
2026-03-19 02:00:56 +01:00
parent cfef49fbc7
commit 470b0c3a8c
14 changed files with 72 additions and 83 deletions

View File

@@ -4,7 +4,19 @@ namespace Mr.BrickAdventures.Autoloads;
public partial class UIManager : Node
{
public static UIManager Instance { get; private set; }
private readonly System.Collections.Generic.List<Control> UiStack = new();
public override void _Ready()
{
Instance = this;
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
[Signal] public delegate void ScreenPushedEventHandler(Control screen);
[Signal] public delegate void ScreenPoppedEventHandler(Control screen);