tools(LayoutDump): dump authored colour arrays; measure retail's tag green
The chat deep-dive proved the MECHANISM behind retail's green clickable
speaker name — a glyph tag coloured from property 0x1D rather than the line's
own 0x1B — but not the colour itself: BuildChatColorLookupTable @0x004F31C0
builds only the 0x1B array, so the value is authored rather than runtime-built
and the research correctly returned "UNKNOWN" instead of assuming the green in
a screenshot.
--colors prints the 0x1B/0x1D arrays of every element in a layout, which
measures it out of the installed dats:
chat 0x2100006F, transcript 0x10000011
P0x1B [0x00] R=204 G=204 B=204
P0x1D [0x00] R= 0 G=178 B= 0 <- the green
Recorded in the research note, including the trap it exposes: the tag colour is
per-ELEMENT and authored, while the line colour on that same element comes from
the runtime chat table. Filing "tag green" into the LogTextType colour table
would put it in the wrong place entirely.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
3eb28c57f2
commit
be324c003c
2 changed files with 493 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ if (args.Length == 0)
|
|||
}
|
||||
|
||||
bool showStates = args.Contains("--states");
|
||||
bool showColors = args.Contains("--colors");
|
||||
uint[] ids = args.Where(a => !a.StartsWith("--"))
|
||||
.Select(a => Convert.ToUInt32(a, a.StartsWith("0x") ? 16 : 10))
|
||||
.ToArray();
|
||||
|
|
@ -117,6 +118,29 @@ void Print(ElementInfo e, int depth)
|
|||
+ $"parent={(e.HasOriginalParentSize ? $"{e.OriginalParentWidth:0.#}x{e.OriginalParentHeight:0.#}" : "-")} "
|
||||
+ $"z={e.ZLevel} order={e.ReadOrder}");
|
||||
|
||||
// Colour-array properties. 0x1B is the ordinary font-colour array and 0x1D
|
||||
// the TAG font-colour array (UIElement_Text::SetFontColorHelper); both are
|
||||
// indexed by the caller, so the tagged-name colour is a row in 0x1D rather
|
||||
// than anything the runtime builds.
|
||||
if (showColors)
|
||||
{
|
||||
foreach (UiStateInfo state in e.States.Values)
|
||||
{
|
||||
foreach (uint prop in new[] { 0x1Bu, 0x1Du })
|
||||
{
|
||||
if (!state.Properties.TryGetValue(prop, out UiPropertyValue? v) || v is null)
|
||||
continue;
|
||||
Console.WriteLine($"{pad} P0x{prop:X2} ({v.ArrayValue.Count} entries):");
|
||||
for (int i = 0; i < v.ArrayValue.Count; i++)
|
||||
{
|
||||
UiColorValue c = v.ArrayValue[i].ColorValue;
|
||||
Console.WriteLine(
|
||||
$"{pad} [0x{i:X2}] R={c.Red,3} G={c.Green,3} B={c.Blue,3} A={c.Alpha,3}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showStates && e.States.Count != 0)
|
||||
{
|
||||
string names = string.Join(", ", e.States
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue