diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 6ca8697f..ea4d06ac 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -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).