fix #434: delete the unreachable DebugPanel/DebugVM surface and the comments that advertised it
DebugPanel and DebugVM have not been constructible since Campaign V slice
V11 removed the ImGui frontend that hosted them: nothing in src/ ever
called their constructors, only a test did. Two consequences, both fixed
here — 35 environment reads inside them were unreachable, and roughly forty
XML doc comments across the diagnostics owners promised a runtime checkbox
that no longer exists. A flag documented as runtime-toggleable when it is
startup-only sends the next investigation down a path that cannot work.
Deleted DebugPanel.cs (340 lines), DebugVM.cs (548) and DebugVMTests.cs
(327). Corrected the surviving claims in PhysicsDiagnostics,
RenderingDiagnostics, CameraDiagnostics, PhysicsEngine and GameWindow to say
what is actually true: these flags are set from the environment at startup
or by direct assignment.
The one real dependant was CombatFeedbackSlot, whose binding target was
DebugVM. It now takes a plain Action<string>, which removes the dependency
without changing behavior — and makes visible that there is no behavior:
nothing binds the slot, so the combat refusals it carries ("No monster
target", "Enter melee or missile combat first") have been discarded all
along. Filed as #436 and pinned by a test, rather than papered over with an
invented chat message; the retail text and channel need the oracle first.
Deliberately untouched: F1's AcdreamToggleDebugPanel binding, which
GameplayInputCommandController consumes as a documented no-op so the key
does not fall through to a lower input scope; and the
DebugVmRenderFactsPublisher / DevToolsRuntimeSources chain, which is still
wired into production composition and deserves its own dead-code pass
instead of being pulled into this one.
Full hermetic suite 15,333 passed / 0 failed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
e77dd7c413
commit
05bfe8d162
11 changed files with 129 additions and 1294 deletions
|
|
@ -1,7 +1,4 @@
|
|||
using System.Numerics;
|
||||
using AcDream.App.Combat;
|
||||
using AcDream.Core.Combat;
|
||||
using AcDream.UI.Abstractions.Panels.Debug;
|
||||
|
||||
namespace AcDream.App.Tests.Combat;
|
||||
|
||||
|
|
@ -11,49 +8,41 @@ public sealed class CombatFeedbackSlotTests
|
|||
public void ExpectedOwnerUnbindCannotClearReplacement()
|
||||
{
|
||||
var slot = new CombatFeedbackSlot();
|
||||
using DebugVM first = CreateViewModel();
|
||||
using DebugVM second = CreateViewModel();
|
||||
List<string> first = [];
|
||||
List<string> second = [];
|
||||
Action<string> firstTarget = first.Add;
|
||||
Action<string> secondTarget = second.Add;
|
||||
|
||||
slot.Bind(first);
|
||||
slot.Unbind(second);
|
||||
slot.Bind(firstTarget);
|
||||
slot.Unbind(secondTarget);
|
||||
slot.Show("first");
|
||||
Assert.Single(first.RecentToasts);
|
||||
Assert.Empty(second.RecentToasts);
|
||||
Assert.Equal(["first"], first);
|
||||
Assert.Empty(second);
|
||||
|
||||
slot.Unbind(first);
|
||||
slot.Bind(second);
|
||||
slot.Unbind(firstTarget);
|
||||
slot.Bind(secondTarget);
|
||||
slot.Show("second");
|
||||
Assert.Single(second.RecentToasts);
|
||||
Assert.Equal(["second"], second);
|
||||
}
|
||||
|
||||
private static DebugVM CreateViewModel() => new(
|
||||
static () => Vector3.Zero,
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => false,
|
||||
static () => false,
|
||||
static () => false,
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => float.PositiveInfinity,
|
||||
static () => "-",
|
||||
static () => false,
|
||||
static () => false,
|
||||
static () => 0,
|
||||
static () => 1,
|
||||
static () => 0,
|
||||
static () => false,
|
||||
static () => "0",
|
||||
static () => 0,
|
||||
static () => "Clear",
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => 0,
|
||||
static () => 60,
|
||||
static () => 16.7f,
|
||||
new CombatState());
|
||||
[Fact]
|
||||
public void RebindingADifferentTargetWhileBoundIsRejected()
|
||||
{
|
||||
var slot = new CombatFeedbackSlot();
|
||||
slot.Bind(_ => { });
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => slot.Bind(_ => { }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnUnboundSlotDropsItsMessages()
|
||||
{
|
||||
// #434/#436: this is the shipped behavior, not an aspiration —
|
||||
// nothing binds the slot in production, so combat refusal text
|
||||
// ("No monster target") is discarded. Pinned so the day it gets a
|
||||
// real binder, this test is the one that has to change.
|
||||
var slot = new CombatFeedbackSlot();
|
||||
|
||||
slot.Show("dropped");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue