102 lines
6.6 KiB
C#
102 lines
6.6 KiB
C#
using System.Numerics;
|
|
using GamePort.Application;
|
|
|
|
var menu = new DebugMenu([new("level1b.gam", "LV1B", ["STARTEXP", "riverlab"]),
|
|
new("VR04.gam", "VR04", ["PHONEBOOTH"])], "LEVEL1B.GAM", "startexp");
|
|
Require(!menu.Open && menu.Key(40) == DebugAction.None, "Closed menu cannot issue commands");
|
|
menu.Toggle(30);
|
|
Require(menu.Open && menu.SceneTask == 30 && menu.Start == "STARTEXP", "F1 opens current context");
|
|
menu.Key(82);
|
|
Require(menu.Selected == 11 && menu.Key(40) == DebugAction.ToggleOverlay,
|
|
"Live overlay has an independent menu toggle");
|
|
menu.Key(82);
|
|
Require(menu.Selected == 10 && menu.Key(40) == DebugAction.ForceControl && menu.Key(40, true) == DebugAction.None,
|
|
"Force-control row emits one command per Enter press");
|
|
menu.Key(82);
|
|
Require(menu.Selected == 9 && menu.Key(40) == DebugAction.Reset, "Navigation wraps to reset");
|
|
menu.Key(81); menu.Key(81); menu.Key(81);
|
|
Require(menu.Selected == 0 && menu.Key(40, true) == DebugAction.None && menu.Key(40) == DebugAction.Resume,
|
|
"Enter repeats cannot repeat commands");
|
|
for (var i = 0; i < 5; i++) menu.Key(81);
|
|
menu.Key(79); menu.Key(75);
|
|
Require(menu.SceneTask == 41 && menu.Key(40) == DebugAction.ApplySceneTask, "SCENE edit is staged until apply");
|
|
menu.Key(78); menu.Key(80);
|
|
Require(menu.SceneTask == 30, "SCENE coarse/fine editing is reversible");
|
|
for (var i = 0; i < 110; i++) menu.Key(78);
|
|
Require(menu.SceneTask == 0, "SCENE lower bound");
|
|
for (var i = 0; i < 110; i++) menu.Key(75);
|
|
Require(menu.SceneTask == 999, "SCENE upper bound");
|
|
menu.Key(81); menu.Key(79);
|
|
Require(menu.Scene?.Code == "VR04" && menu.Start == "PHONEBOOTH", "Scene selection updates starts");
|
|
menu.Key(80); menu.Key(81); menu.Key(79);
|
|
Require(menu.Scene?.Code == "LV1B" && menu.Start == "riverlab", "Original named starts can be selected");
|
|
menu.Key(81);
|
|
Require(menu.Key(40) == DebugAction.LoadScene, "Load action is explicit");
|
|
var view = menu.View(new("LV1B", "STARTEXP", new(1, 2, 3), 155, 0, true, 20, 50, 30, "NONE", true, 0, 10000, false));
|
|
Require(view.Lines.Length <= 32 && view.SelectedLine == 17 && view.Lines.Any(s => s.Contains("riverlab")), "Bounded menu view highlights its action");
|
|
menu.Key(41);
|
|
Require(!menu.Open && menu.View(new("", "", Vector3.Zero, 0, 0, false, 0, 0, 0, "", false, 0, 0, false)).Lines.Length == 0,
|
|
"Escape closes and hides the menu");
|
|
menu.Toggle(65);
|
|
Require(menu.SceneTask == 65, "Reopening refreshes live task state");
|
|
Console.WriteLine("PASS debug navigation, input repeat, staged tasks, scene/start selection and view");
|
|
|
|
menu.Key(43);
|
|
Require(menu.Page == 1 && menu.Selected == 0 && menu.Key(40) == DebugAction.Noclip, "Tab reaches player tools and noclip");
|
|
menu.Key(43, true); Require(menu.Page == 1, "Tab repeat cannot change pages");
|
|
menu.Key(81); menu.Key(79);
|
|
Require(menu.FlySpeed == 1200 && menu.Key(40) == DebugAction.NoclipSpeed, "Fly speed is bounded and staged");
|
|
for (var i = 0; i < 6; i++) menu.Key(81);
|
|
menu.Key(79); Require(menu.JetpackState == 4, "Jetpack ownership/availability editor includes disabled state");
|
|
menu.Key(81); Require(menu.Key(40) == DebugAction.ApplyJetpackState, "Availability requires explicit apply");
|
|
menu.Key(43);
|
|
Require(menu.Page == 2 && menu.Selected == 0 && menu.Key(40) == DebugAction.CameraObstruction, "Systems page exposes existing static ray");
|
|
for (var i = 0; i < 6; i++) menu.Key(81);
|
|
Require(menu.Key(40) == DebugAction.SaveCheckpoint, "Systems checkpoint save action");
|
|
menu.Key(81); Require(menu.Key(40) == DebugAction.LoadCheckpoint, "Systems checkpoint load action");
|
|
for (var page = 0; page < 3; page++)
|
|
{
|
|
var pageView = menu.View(new("LV1B", "STARTEXP", Vector3.Zero, 0, 0, true, 20, 0, 30, "NONE", true, 0, 10000, false));
|
|
Require(pageView.Lines.Length <= 32 && pageView.SelectedLine >= 0 && pageView.SelectedLine < pageView.Lines.Length,
|
|
"Every menu page fits the fixed widescreen-aware overlay");
|
|
menu.Key(43);
|
|
}
|
|
menu.Key(43); // Return from systems to general.
|
|
Require(menu.Page == 0, "Tab cycles all three pages");
|
|
Require(menu.FindScene("VR04")?.LevelFile == "VR04.gam" && menu.FindScene("MISSING") == null, "Checkpoint resolution only uses prepared catalog");
|
|
Console.WriteLine("PASS paged player/systems tools, noclip, staged settings and bounded overlay views");
|
|
|
|
menu.Key(43);
|
|
for(var i=0;i<10;i++)menu.Key(81);
|
|
Require(menu.Key(40)==DebugAction.GiveInvisible,"Player tools can grant/select implemented Invisible device");
|
|
menu.Key(81);Require(menu.Key(40)==DebugAction.UnequipGadget,"Explicit gadget unequip");
|
|
menu.Key(81);Require(menu.Key(40)==DebugAction.GiveBubble,"Player tools grant/select the implemented Bubble");
|
|
var invisibleView=menu.View(new("LV1B","STARTEXP",Vector3.Zero,0,0,true,20,0,30,"NONE",true,0,10000,false,
|
|
Systems:new(){InvisibleRemaining=4.5f,InvisibleRecharge=0,Targetable=false}));
|
|
Require(invisibleView.Lines.Length<=32 && invisibleView.Lines.Any(s=>s.Contains("INVISIBLE 4.5")),"Bounded Invisible timer/target diagnostics");
|
|
Console.WriteLine("PASS Invisible debug commands and live phase diagnostics");
|
|
|
|
menu.Key(81); Require(menu.Key(40)==DebugAction.GiveBaseball,"Player tools grant/select Baseball");
|
|
menu.Key(81);
|
|
Require(menu.Key(40)==DebugAction.GiveAllGadgets && menu.Key(40,true)==DebugAction.None,
|
|
"Give All Gadgets has an explicit action with Enter repeat suppressed");
|
|
var allGadgetsView=menu.View(new("LV1B","STARTEXP",Vector3.Zero,0,0,true,20,0,30,"NONE",true,0,10000,false));
|
|
Require(allGadgetsView.Lines.Length<=32 && allGadgetsView.Lines[allGadgetsView.SelectedLine]=="GIVE ALL GADGETS",
|
|
"Last player action remains visible within the widescreen overlay capacity");
|
|
menu.Key(81);Require(menu.Key(40)==DebugAction.GiveRocketship,"Player tools expose Rocketship after Give All Gadgets");
|
|
menu.Key(81); Require(menu.Key(40)==DebugAction.GiveGrappler,"Player tools expose Grappler after Rocketship");
|
|
menu.Key(81); Require(menu.Selected==0,"Player navigation wraps after Grappler");
|
|
Console.WriteLine("PASS Give All Gadgets navigation, repeat handling and overlay bounds");
|
|
|
|
var original = Path.GetFullPath(args.Length == 1 ? args[0] : "../Original");
|
|
var catalog = DebugMenu.AvailableScenes(original, Path.GetFullPath("artifacts/extracted"));
|
|
Require(catalog.Length == 33 && catalog.All(s => s.Starts.Length > 0), "Only33 supplied scenes with prepared geometry are offered");
|
|
Require(catalog.All(s => s.Code is not ("LV3B" or "LV3E")), "Absent geometry is not substituted into the menu");
|
|
Require(catalog.Single(s => s.Code == "LV1B").Starts.Contains("riverlab"), "Actual underground STRT is available");
|
|
Console.WriteLine("PASS original33-scene debug catalog and source startpoint coverage");
|
|
|
|
static void Require(bool condition, string message)
|
|
{
|
|
if (!condition) throw new InvalidOperationException(message);
|
|
}
|