Add passive F2 diagnostics overlay with persistent session visibility

This commit is contained in:
UnixNight committed 2026-10-25 02:17:40 -04:00
1 parent 20aa1bc2b9
commit 113e9a41cc
17 files changed
+414 -24

No files matched your search

+6 -4
View File
@@ -5,17 +5,17 @@ using GamePort.Assets;
namespace GamePort.Application;
public sealed record DebugScene(string LevelFile, string Code, string[] Starts);
public enum DebugAction { None, Resume, Camera, SkipCutscene, RefillEnergy, GiveJetpack, ApplySceneTask, LoadScene, Reset, ForceControl }
public enum DebugAction { None, Resume, Camera, SkipCutscene, RefillEnergy, GiveJetpack, ApplySceneTask, LoadScene, Reset, ForceControl, ToggleOverlay }
public sealed record DebugMenuView(string[] Lines, int SelectedLine);
public sealed record DebugStatus(string Level, string Start, Vector3 Root, float Yaw, float Speed,
bool Grounded, float Energy, int Score, int SceneTask, string Cutscene, bool Controlled,
int Issues, float FarPlane, bool Inspecting, bool ForcedControl = false);
int Issues, float FarPlane, bool Inspecting, bool ForcedControl = false, bool DiagnosticsVisible = false, string? CameraMode = null);
/// <summary>Modern investigation tools, deliberately separate from recovered game UI.</summary>
public sealed class DebugMenu
{
public const uint ToggleKey = 58; // SDL scancode F1; F11 remains fullscreen.
public const int ItemCount = 11;
public const int ItemCount = 12;
public bool Open { get; private set; }
public int Selected { get; private set; }
public int SceneTask { get; private set; }
@@ -66,6 +66,7 @@ public sealed class DebugMenu
3 => DebugAction.RefillEnergy, 4 => DebugAction.GiveJetpack, 5 => DebugAction.ApplySceneTask,
8 => Scene == null ? DebugAction.None : DebugAction.LoadScene, 9 => DebugAction.Reset,
10 => DebugAction.ForceControl,
11 => DebugAction.ToggleOverlay,
_ => DebugAction.None
};
return DebugAction.None;
@@ -84,7 +85,7 @@ public sealed class DebugMenu
$"YAW {F(status.Yaw)} SPEED {F(status.Speed)} GROUNDED {status.Grounded}",
$"ENERGY {F(status.Energy)} SCORE {status.Score} SCENE {status.SceneTask}",
$"CONTROL {status.Controlled} CUTSCENE {status.Cutscene}",
$"ISSUES {status.Issues} FAR {F(status.FarPlane)} CAMERA {(status.Inspecting ? "ORBIT" : "GAMEPLAY")}",
$"ISSUES {status.Issues} FAR {F(status.FarPlane)} CAMERA {status.CameraMode ?? (status.Inspecting ? "ORBIT" : "GAMEPLAY")}",
"",
"RESUME",
$"CAMERA: {(status.Inspecting ? "SWITCH TO GAMEPLAY" : "SWITCH TO ORBIT")}",
@@ -97,6 +98,7 @@ public sealed class DebugMenu
"LOAD SELECTED LEVEL / START",
"RESET CURRENT START",
$"FORCE CONTROL: {status.ForcedControl} (ENTER TOGGLE)",
$"LIVE OVERLAY: {status.DiagnosticsVisible} (F2 / ENTER TOGGLE)",
"",
"UP/DOWN SELECT LEFT/RIGHT CHANGE ENTER APPLY",
"SCENE TASK: PAGE UP/DOWN CHANGES BY 10",