Swap ChatWindowController's imported main-chat LayoutDesc from the wrong 0x21000006 (an unrelated layout whose root and 800px resize bar appear nowhere in the EoR gameplay UI) to retail's ACTUAL main chat window, 0x2100006F (window root 0x10000600, authored 410x100 — confirmed by a direct DAT dump, found in dats.Local not dats.Portal). Every downstream compensation that existed only to paper over the wrong import is deleted: the hand-cropped 490px content width, the dropped 800px resize bar, the 9px transcript patch, the orphan-sibling pruning, the max/min-vs-scrollbar overlap shift, and the scrollbar top-reclaim. The window now mounts with RetailWindowChrome.Imported (0x2100006F's own 8 border/corner elements are its complete chrome) instead of the universal nine-slice wrapper. LayoutImporter/DatWidgetFactory gain a Type-9 (UIElement_Resizebar) case: UiResizeGrip decodes retail's exact four-bool BorderLocation algorithm (0x2A=bottom/0x2B=left/0x2C=right/0x2D=top, UIElement_Resizebar::StartMouseResizing @0x0046B7E0) into a ResizeEdges bitmask. A direct DAT dump established the true shape: only 7 of the 8 grip-position ids are Type 9 — the straight top-EDGE strip (0x1000069C) is a Type-2 Dragbar (move handle), not a Resizebar, because the main window has no title bar. UiRoot now gives a directly-hit grip's own edges priority over its generic proximity heuristic, and a directly-hit move handle the same priority over ambient proximity — so the plain top strip moves the window while its two corner grips resize it including the Y axis, and all 4 edges + 4 corners work everywhere else. This also fixes the reported "no diagonal cursor at corners" (CursorFeedbackController's existing RetailCursorCatalog cursor ids already matched the DAT exactly; they just never received a genuine diagonal edge combination) and "cannot grow in Y from the bottom-right corner" (the old NineSlice+crop mount's indirection is gone; the Imported mount uses the DAT's real minH=100/maxH=2000/minW=300/maxW=2000 directly). The 8 cosmetic "_Locked" border-art twins default hidden (register row AP-185 — retail's UiLocked-driven art swap between the two skins is not ported; UiRoot.UiLocked continues to gate the underlying interaction correctly either way). The 4 chat-window-1..4 indicator buttons import generically (visible, inert) for CH6b to wire. The two hand-drawn translucent-black tints on the transcript/input are removed now that their parent panels draw their own authored background sprites. Filed #366 (chat window's new-unseen-text indicator 0x1000048C is swallowed by UiText.ConsumesDatChildren, pre-existing and out of scope). Corrected the research doc's "all eight grips" claim against the direct DAT dump. Full Release suite: 12,317 passed / 4 skipped / 0 failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
85 lines
3.9 KiB
C#
85 lines
3.9 KiB
C#
namespace AcDream.App.UI;
|
|
|
|
/// <summary>
|
|
/// Retail <c>UIElement_Resizebar</c> (element class 9,
|
|
/// <c>UIElement_Resizebar::Register @0x0046B920</c> registers class 9 with the
|
|
/// LayoutDesc element factory). A leaf grip authored at exactly one edge or
|
|
/// corner of a window; retail authors 4 edge grips + 4 corner grips per
|
|
/// resizable window (main chat: <c>0x1000069B</c>-<c>0x100006A2</c>, minus the
|
|
/// straight top strip which is a retail <c>UIElement_Dragbar</c> move handle
|
|
/// instead — see the class doc on <see cref="AcDream.App.UI.Layout.DatWidgetFactory"/>
|
|
/// and <c>docs/research/2026-08-09-chat-retail-window-shell.md</c> §2.1/§2.3).
|
|
///
|
|
/// <para>
|
|
/// <c>UIElement_Resizebar::StartMouseResizing @0x0046B7E0</c> reads four BOOL
|
|
/// attributes off the element — <c>0x2A</c>=bottom, <c>0x2B</c>=left,
|
|
/// <c>0x2C</c>=right, <c>0x2D</c>=top — and combines them into a
|
|
/// <c>BorderLocation</c> (<c>acclient.h:4327</c>). <see cref="DecodeBorderLocation"/>
|
|
/// is a verbatim port of that branch order. acdream's engine expresses resize
|
|
/// direction as an edge-flag bitmask (<see cref="ResizeEdges"/>) rather than
|
|
/// retail's nine-case enum; <see cref="Edges"/> is the lossless projection —
|
|
/// every <see cref="Border"/> value maps to exactly one <see cref="ResizeEdges"/>
|
|
/// combination and back.
|
|
/// </para>
|
|
///
|
|
/// <para>
|
|
/// A grip is a small (5px) leaf with no children and no authored background
|
|
/// media beyond its own cursor-feedback sprite; it exists purely as a precise
|
|
/// hit region. <see cref="AcDream.App.UI.UiRoot"/> gives a directly-hit grip's
|
|
/// own <see cref="Edges"/> priority over the generic proximity-based
|
|
/// <see cref="AcDream.App.UI.UiRoot.HitEdges"/> heuristic, so e.g. the chat
|
|
/// window's top-left/top-right CORNER grips resize (including the Y/top axis)
|
|
/// while the plain top EDGE strip in between remains a pure move handle.
|
|
/// </para>
|
|
/// </summary>
|
|
public sealed class UiResizeGrip : UiElement
|
|
{
|
|
/// <summary>Retail <c>BorderLocation</c> (<c>acclient.h:4327</c>):
|
|
/// <c>BORDER_NONE=0, BORDER_UL=1, BORDER_TOP=2, BORDER_UR=3, BORDER_RIGHT=4,
|
|
/// BORDER_LR=5, BORDER_BOTTOM=6, BORDER_LL=7, BORDER_LEFT=8</c>.</summary>
|
|
public enum Border
|
|
{
|
|
None = 0,
|
|
UpperLeft = 1,
|
|
Top = 2,
|
|
UpperRight = 3,
|
|
Right = 4,
|
|
LowerRight = 5,
|
|
Bottom = 6,
|
|
LowerLeft = 7,
|
|
Left = 8,
|
|
}
|
|
|
|
/// <summary>Decoded retail BorderLocation for this grip.</summary>
|
|
public Border BorderLocation { get; set; }
|
|
|
|
/// <summary>
|
|
/// Exact port of <c>UIElement_Resizebar::StartMouseResizing @0x0046B7E0</c>'s
|
|
/// if/else-if chain (right beats left beats top beats bottom when more than
|
|
/// two bools are set, which retail's authored data never does — corners set
|
|
/// exactly two adjacent bools, edges set exactly one).
|
|
/// </summary>
|
|
public static Border DecodeBorderLocation(bool bottom, bool left, bool right, bool top)
|
|
{
|
|
if (right) return top ? Border.UpperRight : bottom ? Border.LowerRight : Border.Right;
|
|
if (left) return top ? Border.UpperLeft : bottom ? Border.LowerLeft : Border.Left;
|
|
if (top) return Border.Top;
|
|
if (bottom) return Border.Bottom;
|
|
return Border.None;
|
|
}
|
|
|
|
/// <summary>The <see cref="ResizeEdges"/> projection <see cref="UiRoot"/>'s resize
|
|
/// drag state machine consumes — a lossless re-encoding of <see cref="BorderLocation"/>.</summary>
|
|
public ResizeEdges Edges => BorderLocation switch
|
|
{
|
|
Border.UpperLeft => ResizeEdges.Left | ResizeEdges.Top,
|
|
Border.Top => ResizeEdges.Top,
|
|
Border.UpperRight => ResizeEdges.Right | ResizeEdges.Top,
|
|
Border.Right => ResizeEdges.Right,
|
|
Border.LowerRight => ResizeEdges.Right | ResizeEdges.Bottom,
|
|
Border.Bottom => ResizeEdges.Bottom,
|
|
Border.LowerLeft => ResizeEdges.Left | ResizeEdges.Bottom,
|
|
Border.Left => ResizeEdges.Left,
|
|
_ => ResizeEdges.None,
|
|
};
|
|
}
|