The ImGui developer-tools stack (AcDream.UI.ImGui), UI Studio (src/AcDream.App/Studio), and the DevToolsFramePresenter/ SettingsDevToolsCompositionPhase ImGui composition machinery are removed. Vulkan never composed a DevTools frontend (DevToolsEnabled already forced false whenever the backend was Vulkan); this commit makes that permanent by deleting the only implementation rather than leaving a dead branch behind. What moved: Studio/SampleData.cs is a live production dependency (InteractionRetainedUiComposition's character-sheet fallback, plus three UI.Layout test files) - git mv'd to src/AcDream.App/UI/Layout/SampleData.cs, namespace AcDream.App.UI.Layout, and trimmed to the SampleCharacter API that is actually still called (BuildObjectTable/AddItem/AddEquipped/the item-guid and icon constants had zero callers left once the Studio fixture provider that used them was deleted). What survives as backend-neutral seams, per the tests that still exercise them: IDevToolsFrameLifecycle (moved into RenderFramePreparationController.cs, now always bound to null), IFramebufferDevToolsTarget/FramebufferDevToolsBinding in FramebufferResizeController.cs (its concrete DevToolsFramebufferTarget adapter is deleted), and IDevToolsGameplayCommands in GameplayInputCommandController.cs (DevToolsGameplayCommands becomes a documented no-op instead of forwarding to the deleted presenter). A follow-up re-homes Settings/Debug onto the retained UI through IPanelRenderer; until then keybind remapping falls back to editing keybinds.json. DevToolsEnabled is now `private const bool DevToolsEnabled = false`. RuntimeOptions.DevTools is unchanged and still reaches VulkanGraphicsContext for the optional debug-utils extensions; Program.cs now logs one line when ACDREAM_DEVTOOLS=1 explaining that the ImGui UI is gone and the flag is Vulkan-only now. Removed: AcDream.UI.ImGui (project + ImGui.NET/Silk.NET.OpenGL.Extensions.ImGui package refs), src/AcDream.App/Studio (minus SampleData.cs), DevToolsFramePresenter.cs and everything only it constructed (ISettingsDevToolsCompositionFactory, RetailSettingsDevToolsCompositionFactory, DevToolsCompositionOwner, IGameWindowSettingsDevToolsPublication, SettingsDevToolsOptionalDependencies, the "developer tools" shutdown-ledger stage and its DevTools-typed fields on IngressShutdownRoots/ RenderShutdownRoots), the ui-studio Program.cs verb, and the cimgui native manifest entries in GraphicalHostPlatformServices. GameWindow.cs's DevTools composition branch, its _vitalsVm/_debugVm/_devToolsComposition/ _devToolsFramePresenter/_devToolsCommandBus fields, and every settingsDevTools .DevTools?.* access across FrameRootComposition.cs/SessionPlayerComposition.cs are gone with it. Build green; complete Release solution suite 8,830 / 5 skips (App Tests 4,097/3 skips run standalone - one #250-family zero-allocation test flakes under the full parallel `dotnet test AcDream.slnx` run, a pre-existing, documented class unrelated to this change). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
88 lines
2.5 KiB
C#
88 lines
2.5 KiB
C#
using AcDream.App.UI;
|
|
|
|
namespace AcDream.App.Input;
|
|
|
|
internal interface IInputCaptureSource
|
|
{
|
|
bool WantCaptureMouse { get; }
|
|
bool WantCaptureKeyboard { get; }
|
|
bool DevToolsWantCaptureKeyboard { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// The ImGui developer-tools frontend this used to poll for focus capture was
|
|
/// removed at Campaign V slice V11; there is no developer UI to steal focus
|
|
/// from world/retained-UI input anymore, so this always reports false.
|
|
/// </summary>
|
|
internal sealed class DevToolsInputCaptureSource
|
|
{
|
|
public DevToolsInputCaptureSource(bool enabled)
|
|
{
|
|
_ = enabled;
|
|
}
|
|
|
|
public bool WantCaptureMouse => false;
|
|
|
|
public bool WantCaptureKeyboard => false;
|
|
}
|
|
|
|
internal sealed class RetainedUiInputCaptureSlot
|
|
{
|
|
public UiRoot? Root { get; private set; }
|
|
|
|
public IDisposable Bind(UiRoot root)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(root);
|
|
if (Root is not null)
|
|
throw new InvalidOperationException("Retained UI input capture is already bound.");
|
|
Root = root;
|
|
return new Binding(this, root);
|
|
}
|
|
|
|
public bool WantCaptureMouse => Root?.WantsMouse ?? false;
|
|
public bool WantCaptureKeyboard => Root?.WantsKeyboard ?? false;
|
|
|
|
private void Unbind(UiRoot expected)
|
|
{
|
|
if (ReferenceEquals(Root, expected))
|
|
Root = null;
|
|
}
|
|
|
|
private sealed class Binding : IDisposable
|
|
{
|
|
private RetainedUiInputCaptureSlot? _owner;
|
|
private readonly UiRoot _expected;
|
|
|
|
public Binding(RetainedUiInputCaptureSlot owner, UiRoot expected)
|
|
{
|
|
_owner = owner;
|
|
_expected = expected;
|
|
}
|
|
|
|
public void Dispose() =>
|
|
Interlocked.Exchange(ref _owner, null)?.Unbind(_expected);
|
|
}
|
|
}
|
|
|
|
internal sealed class CompositeInputCaptureSource : IInputCaptureSource
|
|
{
|
|
private readonly DevToolsInputCaptureSource _devTools;
|
|
private readonly RetainedUiInputCaptureSlot _retained;
|
|
|
|
public CompositeInputCaptureSource(
|
|
DevToolsInputCaptureSource devTools,
|
|
RetainedUiInputCaptureSlot retained)
|
|
{
|
|
_devTools = devTools ?? throw new ArgumentNullException(nameof(devTools));
|
|
_retained = retained ?? throw new ArgumentNullException(nameof(retained));
|
|
}
|
|
|
|
public bool WantCaptureMouse =>
|
|
_devTools.WantCaptureMouse || _retained.WantCaptureMouse;
|
|
|
|
public bool WantCaptureKeyboard =>
|
|
DevToolsWantCaptureKeyboard || _retained.WantCaptureKeyboard;
|
|
|
|
public bool DevToolsWantCaptureKeyboard =>
|
|
_devTools.WantCaptureKeyboard;
|
|
}
|