feat(chat): CT-A4 — speaker names render in retail's tag colour
Campaign CT slice A4, and the first slice of Group A that shows on screen: a player's name in a chat line now draws green while the rest of the line keeps its message colour. The colour is AUTHORED, not computed. Retail keeps two parallel index-selected colour arrays on the text element and refreshes both from the same caller index on every append (UIElement_Text::AppendStringInfoWithFont @0x00469DE0): property 0x1B for ordinary glyphs, 0x1D for glyphs under an open tag. Property 0x1D is read exactly the way 0x1B already was, carried on ElementInfo, and seeded onto UiText beside DefaultColor. Measured on the chat transcript (0x2100006F / 0x10000011) as RGB(0,178,0). It deliberately does NOT go into RetailChatColorTable. That table is the runtime-built per-LogTextType mapping; the tag colour is per-element authored data, and filing it there would put it somewhere it would look right in tests and be wrong in principle. RunsForFragment is the load-bearing piece and is pure. Wrapping can drop the space it broke on, so a fragment is NOT simply the next N characters of the line — BuildLines locates each fragment in the source text to keep the span offsets honest, and the mapper clips spans to the fragment window. A tag straddling a wrap break is therefore split across both fragments and stays green on both, instead of changing colour mid-word. Two guards worth naming. A fragment containing no tag returns NULL rather than a single-run list, so the overwhelming majority of lines keep the existing flat draw path untouched. And an element authoring no 0x1D falls back to the line colour, so a name never renders in a colour nobody chose. The run/fragment contract is property-tested across every substring of a tell line, because CT-A1's RunsMatchLine refuses mismatched runs by silently falling back to flat text — a mapping bug here would degrade quietly rather than fail. Solution builds clean; full hermetic gate green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
44fb74f8a6
commit
53395e4de4
6 changed files with 318 additions and 2 deletions
|
|
@ -167,6 +167,13 @@ public sealed class UiText : UiElement, IUiDatStateful
|
|||
/// </summary>
|
||||
public Vector4 DefaultColor { get; set; } = Vector4.One;
|
||||
|
||||
/// <summary>
|
||||
/// Colour for a TAGGED run (dat property <c>0x1D</c>) — retail's clickable
|
||||
/// speaker name. Falls back to <see cref="DefaultColor"/> when the element
|
||||
/// authors none.
|
||||
/// </summary>
|
||||
public Vector4? TagColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Authored <c>UIElement_Text</c> font-color list from LayoutDesc property
|
||||
/// <c>0x1B</c>. Retail <c>AppendTextWithFont @ 0x00469D70</c> selects an
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue