fix(D.5.1): read empty-slot background digits from composite 0x10000341 (0x1000005e)

The empty/background digit array (property 0x1000005e) lives under cell composite 0x10000341, not 0x10000346 where peace/war are read; reading it from the wrong composite returned 0 entries so empty top-row slots showed no number. Live dat probe confirmed: 0x10000341 element 0x1000034A property 0x1000005e = 0x060010FA..0x06001102 (digits 1-9) + 0x060074CF (bottom row). Now empty top-row slots show the faint background number, occupied show the dark-box peace/war digit (decomp UIElement_UIItem::SetShortcutNum:229481/229493).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-17 15:34:18 +02:00
parent 8a42066192
commit 8d49042909

View file

@ -1951,24 +1951,33 @@ public sealed class GameWindow : IDisposable
if (arrWar.Value[i] is DatReaderWriter.Types.DataIdBaseProperty d)
toolbarWarDigits[i] = d.Value;
}
// Empty-slot background digit: property 0x1000005e, stance-independent.
// Retail ref: UIElement_UIItem::SetShortcutNum (decomp 229481) —
// else branch when m_elem_Icon->m_state == 0x1000001c (empty state).
// No fallback constants — if absent, empty slots draw no digit (safe).
if (props.TryGetValue(0x1000005Eu, out var rawEmpty)
&& rawEmpty is DatReaderWriter.Types.ArrayBaseProperty arrEmpty)
{
toolbarEmptyDigits = new uint[arrEmpty.Value.Count];
for (int i = 0; i < arrEmpty.Value.Count; i++)
if (arrEmpty.Value[i] is DatReaderWriter.Types.DataIdBaseProperty d)
toolbarEmptyDigits[i] = d.Value;
}
Console.WriteLine($"[D.5.1] empty digit array: {toolbarEmptyDigits?.Length ?? 0} entries.");
}
else
{
Console.WriteLine("[D.5.1] digit arrays: element 0x1000034A/0x10000346 not found in LayoutDesc 0x21000037 — falling back to cited constants.");
}
// Empty-slot BACKGROUND digit lives under a DIFFERENT cell composite:
// composite 0x10000341 (the UIElement_UIItem-typed variant) carries property
// 0x1000005e (plainer digits 0x060010FA..0x06001102 for 1-9, 0x060074CF for the
// bottom row); composite 0x10000346 (peace/war, read above) does NOT carry it.
// Confirmed by a live dat property dump. Retail: UIElement_UIItem::SetShortcutNum
// (decomp 229481/229493) — empty branch (m_elem_Icon->m_state == 0x1000001c) reads
// 0x1000005e, stance-independent. No fallback constants (safe: no digit if absent).
if (uiItemLd is not null
&& uiItemLd.Elements.TryGetValue(0x10000341u, out var emptyComposite)
&& emptyComposite.Children.TryGetValue(0x1000034Au, out var emptyScn)
&& emptyScn.StateDesc is { } emptySd
&& emptySd.Properties is { } emptyProps
&& emptyProps.TryGetValue(0x1000005Eu, out var rawEmpty)
&& rawEmpty is DatReaderWriter.Types.ArrayBaseProperty arrEmpty)
{
toolbarEmptyDigits = new uint[arrEmpty.Value.Count];
for (int i = 0; i < arrEmpty.Value.Count; i++)
if (arrEmpty.Value[i] is DatReaderWriter.Types.DataIdBaseProperty d)
toolbarEmptyDigits[i] = d.Value;
}
Console.WriteLine($"[D.5.1] empty digit array (0x10000341/0x1000005e): {toolbarEmptyDigits?.Length ?? 0} entries.");
}
// Cited-constant fallback (UIElement_UIItem::SetShortcutNum, decomp 229465 + dat probe).