fix(ui): restore authentic D2 v1.13c NPC dialog popup menu (dialog.cpp + npcmenu.cpp + boxpieces.dc6) #489
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Bug Description
Clicking an NPC in town currently displays a custom placeholder CSS/Canvas rectangle popup menu (
drawNpcMenuinsrc/ui/world-panels.ts) rather than the authentic Diablo II v1.13c NPC dialog menu:ctx.strokeRectgold rectangle (#9c824c) and a horizontal divider line beneath the NPC name instead of the 22-piece carved stone border (data\global\ui\menu\boxpieces.dc6) drawn byD2Client.dll0x6fb6e4c0.w = 180,rowH = 26,headerH = 30instead of the dynamicFont16text measurement and line spacing fromDIALOG_Create/DIALOG_ComputeLayout(0x6fb53580/0x6fb532d0:width = maxLineWidth + 20,height = sum(lineStepY) + 15, headerlineStepY = 21, optionlineStepY = 15).rgba(156, 130, 76, 0.28)) on hover instead of theD2Client.dllnSelectionStyle = 1([esi+0x5c] == 1set inNPCMENU_CreateMainMenu0x6faf8c21) blue text highlight (color = 3/#6969ff) with default selection on the first selectable option (nSelectedLine = 1).交谈 (Talk),交易 (Trade),赌博 (Gamble),离开 (Cancel)) instead of authentic.tbllocalized strings (3381"talk",3396"trade",3334"trade/repair",3398"gamble",3397"hire",4020"Identify Items",4142"cancel", etc.).1.13c Binary Ground Truth (
D2Client.dlldialog.cpp&npcmenu.cpp)DATA\GLOBAL\UI\menu\boxpieces.dc6,0x6fb6e4c0):DIALOG_Draw(0x6fb53840) fills the interior withD2GFX_DrawRectangle(left, top, left + width, top + height, 0, 1)(dark translucent fill, no horizontal separator line) and calls0x6fb6e4c0(&rc)whererc = { left, top, right: left + width - 1, bottom: top + height - 1 }:x = rc.left + 12 .. rc.right - 13step12, frame2 + (++i % 6)at(x, rc.top + 12)x = rc.left + 13 .. rc.right - 13step12, frame16 + (++i % 6)at(x, rc.bottom + 10)y = rc.top + 22 .. rc.bottom - 1step12, frame10 + (++i % 3)at(rc.left - 4, y)y = rc.top + 24 .. rc.bottom - 1step12, frame13 + (++i % 3)at(rc.right - 6, y)0at(rc.left, rc.top + 12), TR frame1at(rc.right - 11, rc.top + 12), BL frame8at(rc.left, rc.bottom + 2), BR frame9at(rc.right - 11, rc.bottom + 2)0x6fb53580,0x6fb536f0,0x6fb53912):Font16(D2Win_SetFont(1))color = 4(Gold),lineStepY = 21,bSelectable = 0, centered (relX = floor((width - textWidth + 1) / 2) + 1)color = 0(White),lineStepY = 15,bSelectable = 1, centered; wheni == nSelectedLineandnSelectionStyle == 1,color = 3(Blue). First option (index = 1) is selected initially (0x6fb53829).0x6fb534b0):mouseX > left + 15 && mouseX < left + width - 15 && mouseY > rowY - 11 && mouseY < rowY + 4whererowY = top + accumY + lineStepY.data\global\ui\menu\boxpieces.dc6(22 frames) anddata\global\ui\CURSOR\focus16.dc6(7 frames) inscripts/pack-ui-assets.tsintopublic/ui/andsrc/ui/baked-ui-meta.ts.