Add debug foundation

This commit is contained in:
2026-04-21 21:16:30 +02:00
parent 693f31dd50
commit cc51f4a6e8
22 changed files with 1246 additions and 12 deletions

View File

@@ -15,6 +15,9 @@ public partial class GameRoot : Node
GD.Print($"Debug boot: {m_Settings.BootMode}");
GD.Print($"Seed: {m_Settings.Seed}");
m_CommandNode = GetNodeOrNull<DebugCommandNode>("DebugCommandNode");
m_CommandNode?.Initialize(m_Settings);
LoadBootScene(m_Settings.BootMode);
}
@@ -24,6 +27,7 @@ public partial class GameRoot : Node
{
DebugBootMode.Smoke => SmokeScene,
DebugBootMode.ContentBrowser => ContentBrowserScene,
DebugBootMode.DebugSandbox => DebugSandboxScene,
_ => MenuScene
};
@@ -45,7 +49,14 @@ public partial class GameRoot : Node
DebugOverlay? overlay = GetNodeOrNull<DebugOverlay>("DebugOverlay");
if (overlay is not null && m_Settings is not null)
{
overlay.SetStatus(m_Settings, loadedSceneId);
if (m_CommandNode is not null)
{
overlay.Bind(m_CommandNode.Service, m_Settings, loadedSceneId);
}
else
{
overlay.SetStatus(m_Settings, loadedSceneId);
}
}
}
@@ -58,6 +69,10 @@ public partial class GameRoot : Node
[Export]
public PackedScene? ContentBrowserScene { get; set; }
[Export]
public PackedScene? DebugSandboxScene { get; set; }
private Node? m_LoadedScene;
private DebugSettings? m_Settings;
private DebugCommandNode? m_CommandNode;
}