Add persistent force-control toggle to F1 debug menu

This commit is contained in:
UnixNight committed 2026-10-25 02:00:55 -04:00
1 parent 3078b8afd0
commit 20aa1bc2b9
13 files changed
+96 -12

No files matched your search

+12 -2
View File
@@ -70,8 +70,15 @@ public sealed class SceneDirector
public List<DirectorActor> Actors { get; } = [];
public IReadOnlyList<DirectorIssue> Issues => issues;
private string? controlledTag;
/// <summary>Modern debug override; leaves authored control/camera transitions intact.</summary>
public bool DebugForceControl { get; set; }
public bool Controlled => Equal(ControlledTag, level.Player?.Tag);
public string? ControlledTag { get; private set; }
public string? ControlledTag
{
get => DebugForceControl ? level.Player?.Tag : controlledTag;
private set => controlledTag = value;
}
public bool InventoryEnabled { get; private set; } = true;
public bool Blocked { get; private set; }
public bool Playing => shot is not null;
@@ -116,6 +123,7 @@ public sealed class SceneDirector
public void Begin(GamEntity start, bool activateStartTrigger = true)
{
if (start.Kind != "STRT") throw new ArgumentException("Expected original STRT entity", nameof(start));
DebugForceControl = false;
shot = null; pending.Clear(); activations.Clear();
Blocked = skipping = false; blockedNext = blockedCaller = null;
CameraEye = CameraTarget = null;
@@ -492,7 +500,9 @@ public sealed class SceneDirector
private void RestoreControl()
{
var wasControlled = Controlled;
// Authored music handoff must use authored ownership even if debug input
// is forced during the cutscene. The override does not grant source control.
var wasControlled = Equal(controlledTag, level.Player?.Tag);
shot = null;
ControlledTag = level.Player?.Tag;
InventoryEnabled = true;