feat(ui): D.2b-A — F12 toggles placeholder inventory window
UiHost RegisterWindow/ToggleWindow forwarders to UiRoot. A default-hidden placeholder inventory window mounts in the RetailUi block + registers as WindowNames.Inventory. OnInputAction handles the existing F12-bound ToggleInventoryPanel action -> _uiHost.ToggleWindow (no-op when retail UI off; gated by WantsKeyboard so it can't fire while typing in chat). Placeholder is throwaway scaffolding; Sub-phase B swaps in the real gmInventoryUI (0x21000023) under the same registry name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
036db8b8ab
commit
882b4dd5d3
2 changed files with 28 additions and 0 deletions
|
|
@ -2137,6 +2137,19 @@ public sealed class GameWindow : IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Phase D.2b-A — placeholder inventory window. Starts HIDDEN; F12
|
||||||
|
// (InputAction.ToggleInventoryPanel) reveals it via the UiRoot window
|
||||||
|
// manager. Throwaway scaffolding: Sub-phase B replaces the body with the
|
||||||
|
// real gmInventoryUI (0x21000023) nested layout, keeping the same name.
|
||||||
|
var inventoryWindow = new AcDream.App.UI.UiNineSlicePanel(ResolveChrome)
|
||||||
|
{
|
||||||
|
Left = 220, Top = 120, Width = 320, Height = 400,
|
||||||
|
Visible = false,
|
||||||
|
};
|
||||||
|
_uiHost.Root.AddChild(inventoryWindow);
|
||||||
|
_uiHost.RegisterWindow(AcDream.App.UI.WindowNames.Inventory, inventoryWindow);
|
||||||
|
Console.WriteLine("[D.2b-A] placeholder inventory window registered (F12 toggles).");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phase N.4+N.5 — WB rendering pipeline foundation. The modern path is
|
// Phase N.4+N.5 — WB rendering pipeline foundation. The modern path is
|
||||||
|
|
@ -11420,6 +11433,13 @@ public sealed class GameWindow : IDisposable
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
case AcDream.UI.Abstractions.Input.InputAction.ToggleInventoryPanel:
|
||||||
|
// Retail F12 (rebindable). Gated upstream by WantsKeyboard, so it
|
||||||
|
// does not fire while the chat input holds focus. Null _uiHost =
|
||||||
|
// retail UI off (ACDREAM_RETAIL_UI unset) → no-op.
|
||||||
|
_uiHost?.ToggleWindow(AcDream.App.UI.WindowNames.Inventory);
|
||||||
|
break;
|
||||||
|
|
||||||
case AcDream.UI.Abstractions.Input.InputAction.AcdreamToggleDebugPanel:
|
case AcDream.UI.Abstractions.Input.InputAction.AcdreamToggleDebugPanel:
|
||||||
foreach (var panel in EnumerateDebugPanel())
|
foreach (var panel in EnumerateDebugPanel())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,14 @@ public sealed class UiHost : System.IDisposable
|
||||||
_ => UiMouseButton.Left,
|
_ => UiMouseButton.Left,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ── Window manager forwarders (delegate to UiRoot) ─────────────────
|
||||||
|
|
||||||
|
/// <summary>Register a top-level window for Show/Hide/Toggle. See <see cref="UiRoot.RegisterWindow"/>.</summary>
|
||||||
|
public void RegisterWindow(string name, UiElement window) => Root.RegisterWindow(name, window);
|
||||||
|
|
||||||
|
/// <summary>Toggle a registered window's visibility; returns the new IsVisible.</summary>
|
||||||
|
public bool ToggleWindow(string name) => Root.ToggleWindow(name);
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
TextRenderer.Dispose();
|
TextRenderer.Dispose();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue