fix(ui): restore authentic D2 v1.13c NPC dialog popup menu (Fixes #489) #495
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix/issue-489-npc-menu-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #489 by restoring the 100% authentic Diablo II v1.13c NPC dialog popup menu (
D2Client.dlldialog.cpp+npcmenu.cpp+boxpieces.dc6).Root Cause & 1.13c Binary Ground Truth (
D2Client.dll)0x6fb6e4c0,DATA\GLOBAL\UI\menu\boxpieces.dc6):ctx.strokeRect('#9c824c')), horizontal header divider line, and gray hover highlight bar (rgba(64, 50, 28, 0.75)) indrawNpcMenuwithdrawStoneBoxFrame(0x6fb6e4c0), which fills the interior with dark translucent background(left + 1, top, width - 2, height - 2)and tiles all 2214x15carved stone pieces fromboxpieces.dc6(top frames2..7, bottom frames16..21, left frames10..12, right frames13..15, and corners0, 1, 8, 9, each blitted at(x, y - 15)).Font16Layout & Open-Interval Hit-Testing (0x6fb53580,0x6fb534b0,0x6faf6880):computeNpcDialogLayout(0x6fb53580):width = maxLineWidth + 20,height = 21 + options.length * 15 + 15,left = anchorX - trunc(width / 2),top = anchorY - 21, clamped within[10, 790]horizontally and[10, 542]vertically.hitTestNpcDialogOption(0x6fb534b0): open-interval hit-testinglogicalX > left + 15 && logicalX < left + width - 15 && logicalY > rowY - 11 && logicalY < rowY + 4, preserving the current selection when the cursor moves outside selectable lines (0x6fb533de).interactWithNpc(src/scene/act-scene.ts) to project the-150world-pixel head offset (0x6faf6880:0x6faf68de: add edi, -150; cmp eax, 20) above the NPC's feet so the popup menu sits cleanly above the NPC sprite without covering it, and suppressed duplicate DOM#dialog/#status/ overhead#labelswhile the HUD menu is open..tblStrings (0x6faf8c50,0x6fb53912,0x6fb53988):Font16Gold (color = 4), option lines inFont16Blue (color = 3) when selected and White (color = 0) when unselected, with option0selected initially (hoveredOptionIdx: 0).(Talk),(Trade/Repair),(Cancel)) in favor of canonical.tbllocalized strings (3381交談,4020辨視物品,3334交易/修理,3396交易,3398賭博,4142取消).scripts/pack-ui-assets.ts,scripts/pack-ui.ts):data/global/ui/menu/boxpieces.dc6(public/ui/boxpieces.png,308x15, 22 frames) anddata/global/ui/CURSOR/focus16.dc6(public/ui/focus16.png,160x20, 8 frames) and registered them inpublic/ui/manifest.jsonandsrc/ui/baked-ui-meta.ts.Verification
npx vitest run tests/vendor-panel-ui.test.ts tests/input-controls.test.ts tests/challenger-m2-stress.test.ts: 54/54 passed (including MPQ byte-for-byte parity tests forboxpieces.pngandfocus16.png,computeNpcDialogLayout,drawStoneBoxFrame,hitTestNpcDialogOption, anddrawNpcMenu).npx tsx scripts/verify-vendor-ui.ts: Verified in headless Chromium on Charsi, Akara, and Gheed.ce00574f83tod998a0551b