feat(ui): importer carries dat FontColor (0x1B) onto text widgets; character colors from dat where present

LayoutImporter.ReadState now reads Properties 0x1B (ColorBaseProperty, ARGB bytes) and stores the normalized Vector4 in ElementInfo.FontColor (nullable). ElementReader.Merge propagates it with the same non-null-derived-wins rule as FontDid and HJustify. DatWidgetFactory.BuildText seeds UiText.DefaultColor from FontColor when present.

Diagnosis for LayoutDesc 0x2100002E: ALL 12 header and footer text elements carry NO dat color. Every color is runtime set by CharacterStatController. Comments added at each callsite. No hardcoded colors deleted.

Tests added: 3 ElementReader FontColor Merge + 3 DatWidgetFactory DefaultColor. 702 passed, 0 failed. Screenshots: character window, vitals, toolbar all unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-26 10:15:55 +02:00
parent 41430420b3
commit 6e0be4bd34
7 changed files with 154 additions and 1 deletions

View file

@ -269,7 +269,7 @@ public static class DatWidgetFactory
_ => VJustify.Center,
};
return new UiText
var t = new UiText
{
BackgroundSprite = bg,
SpriteResolve = resolve,
@ -277,5 +277,14 @@ public static class DatWidgetFactory
RightAligned = rightAligned,
VerticalJustify = vJustify,
};
// Font color from dat property 0x1B (ColorBaseProperty).
// When present, seed DefaultColor so controllers that read it don't have to hard-code colors.
// Controllers that supply explicit per-line colors via LinesProvider still win — this is only
// the build-time default.
if (info.FontColor.HasValue)
t.DefaultColor = info.FontColor.Value;
return t;
}
}