fix(ui): #145 — importer honors ZLevel so the backdrop sits behind panels
The factory mapped ZOrder from ReadOrder only, so the gmInventoryUI full-window backdrop (0x100001D0, ReadOrder 4) painted over the nested panels (ReadOrder 1-3). Wire ElementDesc.ZLevel through ElementInfo / ToInfo / Merge and fold it into ZOrder = ReadOrder - ZLevel*10000 (higher ZLevel = further back, ReadOrder the within-layer tiebreaker). Vitals (all ZLevel 0) are unchanged; chat (ZLevel 900) + toolbar (1,2) shift to their dat layering — verify visually. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d81ea11a31
commit
45a5cc5bb6
4 changed files with 56 additions and 2 deletions
|
|
@ -77,8 +77,11 @@ public static class DatWidgetFactory
|
|||
e.Width = info.Width;
|
||||
e.Height = info.Height;
|
||||
|
||||
// Honor the dat's draw order so overlapping pieces (grip overlay over bevel chrome) layer correctly.
|
||||
e.ZOrder = (int)info.ReadOrder;
|
||||
// Honor the dat's draw order. ZLevel is the primary layer (higher = further BACK — e.g. the
|
||||
// gmInventoryUI full-window backdrop at ZLevel 100 sits behind the ZLevel-0 panels, #145);
|
||||
// ReadOrder is the within-layer tiebreaker (higher = on top). K=10000 exceeds any window's
|
||||
// element count so ZLevel always dominates. Vitals (all ZLevel 0) keep ZOrder == ReadOrder.
|
||||
e.ZOrder = (int)info.ReadOrder - (int)info.ZLevel * 10000;
|
||||
|
||||
// Map the four raw edge-anchor values to the AnchorEdges bit-flag that the
|
||||
// UI layout engine uses for reflow.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,12 @@ public sealed class ElementInfo
|
|||
/// <summary>Draw order within the parent (lower = drawn first / behind).</summary>
|
||||
public uint ReadOrder;
|
||||
|
||||
/// <summary>Layer level from the dat (<c>ElementDesc.ZLevel</c>). Higher = drawn further
|
||||
/// BACK (a full-window backdrop at ZLevel 100 sits behind ZLevel-0 panels). The factory
|
||||
/// folds it into <see cref="UiElement.ZOrder"/> so ZLevel dominates and ReadOrder is the
|
||||
/// within-layer tiebreaker. Issue #145 (vitals are all ZLevel 0, so they're unaffected).</summary>
|
||||
public uint ZLevel;
|
||||
|
||||
/// <summary>
|
||||
/// Font dat object id inherited from the base element's <c>Properties[0x1A]</c>
|
||||
/// (<c>ArrayBaseProperty → DataIdBaseProperty</c>). 0 = none / not inherited.
|
||||
|
|
@ -152,6 +158,7 @@ public static class ElementReader
|
|||
Right = derived.Right,
|
||||
Bottom = derived.Bottom,
|
||||
ReadOrder = derived.ReadOrder,
|
||||
ZLevel = derived.ZLevel != 0 ? derived.ZLevel : base_.ZLevel,
|
||||
FontDid = derived.FontDid != 0 ? derived.FontDid : base_.FontDid,
|
||||
// DefaultStateName: derived wins if set; otherwise inherit the base's default.
|
||||
DefaultStateName = !string.IsNullOrEmpty(derived.DefaultStateName) ? derived.DefaultStateName : base_.DefaultStateName,
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ public static class LayoutImporter
|
|||
Right = d.RightEdge,
|
||||
Bottom = d.BottomEdge,
|
||||
ReadOrder = d.ReadOrder,
|
||||
ZLevel = d.ZLevel,
|
||||
DefaultStateName = (defState is "Undef" or "Undefined" or "0") ? "" : defState,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue