fix(chargen): Campaign CC gate round 1 re-test 3 — R4-1..R4-4

Four visual residuals from the lead's own live-client captures of
1.0.2-cc.m, all root-caused via decomp + live-DAT evidence:

- R4-1: Skills credits value overlapped mid-caption again. Root cause
  was a missing UiLayoutPolicy raw-edge reflow on UiButton's value-child
  rect (the child is base-inherited across four sibling buttons of
  differing widths, so its baked-in OriginalParentWidth diverges from
  the actual 231px-wide Skills credits button) plus an HJustify.Right
  value child mapped to Center instead of a real far-edge Right.
- R4-2: the single-sprite scrollbar thumb tiled (GL_REPEAT) instead of
  drawing once — DrawTiled was reused for a small fixed marker graphic
  whose native size is far smaller than the track-proportional thumb
  rect. New DrawThumbMarker draws exactly one native-size instance.
- R4-3: the skills info-box formula line clipped past the surrounding
  gold frame's own authored bottom edge (the pane's own raw box is 20px
  taller than the frame that visually contains it) — clamp the pane's
  Height to the frame's bottom (register AD-105, since retail's
  ShowSkillsText has no code relationship to the frame to cite).
- R4-4: the Appearance help text started mid-sentence — the box was
  never touched by its page controller, so it kept UiText's chat-style
  PreserveEndOnLayout=true default; the scroll model's wasAtEnd check is
  vacuously true on its first-ever overflow transition, pinning the
  first render to the bottom. Set PreserveEndOnLayout=false (a static
  top-oriented report, not a transcript) and wired the box's own nested
  authored scrollbar, never wired before.

App suite live-DAT env 5372/3 -> 5379/3 (+7, zero regressions). Runtime
1735/0 unchanged. Full solution 14585/4 skips/1 failure (the documented
Core.Net NakEmission full-solution-only flake, confirmed standalone-pass).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-16 19:05:23 +02:00
parent 28704db4bf
commit e6acb800cc
11 changed files with 678 additions and 12 deletions

View file

@ -286,11 +286,60 @@ public sealed class UiScrollbar : UiElement
}
else
{
DrawTiled(ctx, resolve, ThumbSprite, 0f, ty, Width, th);
// R4-2 (Campaign CC gate round 1 re-test 3): the single-
// sprite thumb shape (no top/bottom caps — see this method's
// own doc, the R3-4/R3-7 fallback family: Skills listbox
// 0x100003f8, Summary overview 0x10000401, Summary how-to
// 0x100002e7) is a small fixed "diamond" marker graphic, NOT
// a stretchy bar — DrawTiled's UV-repeat was drawing it
// MULTIPLE times to fill the track-proportional thumb rect
// (~9 repeats on Summary's overview bar, ~2 on Skills, per
// the live capture). DrawThumbMarker draws exactly ONE
// instance at its own native size.
DrawThumbMarker(ctx, resolve, ThumbSprite, 0f, ty, Width, th, vertical: true);
}
}
}
/// <summary>
/// R4-2 (Campaign CC gate round 1 re-test 3): draws ONE instance of a
/// single-sprite scrollbar thumb at its own native size, centered
/// within the computed thumb rect (<see cref="ThumbRect"/>'s own
/// decomp-cited <c>UIElement_Scrollbar::UpdateLayout @0x4710d0</c>
/// track-proportional geometry stays unchanged — this only changes HOW
/// the sprite fills that rect). Neither <see cref="DrawTiled"/> (UV-
/// repeat — draws the small marker graphic several times to fill a
/// large proportional thumb rect, R4-2's own "tiled diamonds" report)
/// nor a naive 1:1 stretch across the full computed rect (would distort
/// a small marker into an elongated bar) is correct for this shape —
/// <paramref name="vertical"/> selects which
/// axis is being filled/centered: a vertical scrollbar's thumb rect
/// varies in height (X/Width stay the bar's own full width, matching
/// every other draw call in this class), a horizontal one varies in
/// width (Y/Height stay the bar's own full height).
/// </summary>
private void DrawThumbMarker(
UiRenderContext ctx, Func<uint, (uint tex, int w, int h)> resolve,
uint id, float rectX, float rectY, float rectW, float rectH, bool vertical)
{
if (id == 0 || rectW <= 0f || rectH <= 0f) return;
var (tex, nativeW, nativeH) = resolve(id);
if (tex == 0 || nativeW == 0 || nativeH == 0) return;
if (vertical)
{
float drawH = MathF.Min(nativeH, rectH);
float y = rectY + (rectH - drawH) * 0.5f;
ctx.DrawSprite(tex, rectX, y, rectW, drawH, 0f, 0f, rectW / nativeW, drawH / nativeH, Vector4.One);
}
else
{
float drawW = MathF.Min(nativeW, rectW);
float x = rectX + (rectW - drawW) * 0.5f;
ctx.DrawSprite(tex, x, rectY, drawW, rectH, 0f, 0f, drawW / nativeW, rectH / nativeH, Vector4.One);
}
}
private void DrawHorizontalModel(
UiRenderContext ctx,
Func<uint, (uint tex, int w, int h)> resolve,
@ -315,7 +364,8 @@ public sealed class UiScrollbar : UiElement
}
else
{
DrawTiled(ctx, resolve, ThumbSprite, tx, 0f, tw, Height);
// R4-2: horizontal counterpart of the vertical fallback above.
DrawThumbMarker(ctx, resolve, ThumbSprite, tx, 0f, tw, Height, vertical: false);
}
}