feat(ui): D.2b inventory finish — window chrome frame (UiNineSlicePanel)
Wrap the gmInventoryUI content in the universal 8-piece beveled chrome (same UiNineSlicePanel as vitals/chat/toolbar), so the inventory has a proper window frame like every other window. The frame is the draggable window + the F12- toggled registered window; the dat content sits inside it offset by the border. Reused as the base for the vertical-resize step next. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
14ea938c7f
commit
06c4288282
1 changed files with 25 additions and 6 deletions
|
|
@ -2150,12 +2150,31 @@ public sealed class GameWindow : IDisposable
|
||||||
_dats!, 0x21000023u, ResolveChrome, vitalsDatFont);
|
_dats!, 0x21000023u, ResolveChrome, vitalsDatFont);
|
||||||
if (invLayout is not null)
|
if (invLayout is not null)
|
||||||
{
|
{
|
||||||
var inventoryWindow = invLayout.Root;
|
var inventoryRoot = invLayout.Root;
|
||||||
inventoryWindow.Visible = false;
|
// Wrap the dat content in the universal 8-piece beveled window chrome — the
|
||||||
inventoryWindow.Anchors = AcDream.App.UI.AnchorEdges.None; // user-positioned
|
// SAME UiNineSlicePanel the vitals/chat/toolbar windows use. The gmInventoryUI
|
||||||
inventoryWindow.Draggable = true;
|
// LayoutDesc (0x21000023) is 300×362; the frame adds one border thickness on
|
||||||
_uiHost.Root.AddChild(inventoryWindow);
|
// every side. The frame is the draggable window; the dat content sits inside it.
|
||||||
_uiHost.RegisterWindow(AcDream.App.UI.WindowNames.Inventory, inventoryWindow);
|
const int invBorder = AcDream.App.UI.RetailChromeSprites.Border;
|
||||||
|
float invContentW = inventoryRoot.Width, invContentH = inventoryRoot.Height;
|
||||||
|
var inventoryFrame = new AcDream.App.UI.UiNineSlicePanel(ResolveChrome)
|
||||||
|
{
|
||||||
|
Left = inventoryRoot.Left, Top = inventoryRoot.Top, // keep the dat window position
|
||||||
|
Width = invContentW + 2 * invBorder,
|
||||||
|
Height = invContentH + 2 * invBorder,
|
||||||
|
Opacity = 1.0f,
|
||||||
|
Visible = false, // F12 toggles it
|
||||||
|
Anchors = AcDream.App.UI.AnchorEdges.None, // user-positioned
|
||||||
|
Draggable = true,
|
||||||
|
};
|
||||||
|
// Content offset by the border so it sits inside the chrome.
|
||||||
|
inventoryRoot.Left = invBorder; inventoryRoot.Top = invBorder;
|
||||||
|
inventoryRoot.Width = invContentW; inventoryRoot.Height = invContentH;
|
||||||
|
inventoryRoot.Anchors = AcDream.App.UI.AnchorEdges.Left | AcDream.App.UI.AnchorEdges.Top;
|
||||||
|
inventoryRoot.Draggable = false;
|
||||||
|
inventoryFrame.AddChild(inventoryRoot);
|
||||||
|
_uiHost.Root.AddChild(inventoryFrame);
|
||||||
|
_uiHost.RegisterWindow(AcDream.App.UI.WindowNames.Inventory, inventoryFrame);
|
||||||
|
|
||||||
// Phase D.2b-B — populate the inventory from ClientObjectTable: the
|
// Phase D.2b-B — populate the inventory from ClientObjectTable: the
|
||||||
// "Contents of Backpack" grid + the pack-selector strip + the burden meter +
|
// "Contents of Backpack" grid + the pack-selector strip + the burden meter +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue