fix(ui): 点击商人面板买/卖/修理按钮后鼠标样式应切换为原版 buysell.dc6 交易光标 #491
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?
问题描述
在 NPC 交易/赌博面板(
WorldPanels/HudManager)中,点击底部 买(Buy)、卖(Sell) 或 修理(Repair) 按钮后,按钮本身会切换为按下状态且vendorTradeState变为'buy' | 'sell' | 'repair',但鼠标指针样式仍然保持普通手型(protate/ohand/orotate),未切换为暗黑破坏神 II v1.13c 原版交易/修理专属光标。D2Client.dll v1.13c 逆向 Ground Truth
0x6fba8558, 共 7 项, stride0x1c):CursorId = 6:'buysell'(data\global\ui\CURSOR\buysell.dc6, 共 10 帧,32x40),帧索引回调+0x14 = 0x6fac62c0(直接返回g_nCursorFrame (0x6fbcb858)整数帧号,而非手型动画的 8.8 定点数位移)。0x6fbbb238, 20 字节结构体,0x6fb3f430):0x6fb3ba70):nTradeMode = 4(+0x0a),nButtonFrame = 6(+0x0e),nCursorFrame = 1(+0x10->buysell.dc6Frame 1 铁砧修理锤光标)。0x6fb3ba30):nTradeMode = 2(+0x0a),nButtonFrame = 2(+0x0e),nCursorFrame = 3(+0x10->buysell.dc6Frame 3 买入金币/手指光标)。0x6fb3b9f0):nTradeMode = 3(+0x0a),nButtonFrame = 4(+0x0e),nCursorFrame = 4(+0x10->buysell.dc6Frame 4 卖出金币/手指光标)。0x6fb36fb7/0x6fac6070):g_nCursorId = 6,nCursorFrame = 0(buysell.dc6Frame 0 辨识卷轴光标)。0x6fb475e1/0x6fb472d0/0x6fb3d300):0x6fb475e1):设置g_nCursorTradeMode (0x6fbcbc34) = button.nTradeMode,g_nCursorId (0x6fbcb854) = 6(buysell.dc6),g_nCursorFrame (0x6fbcb858) = button.nCursorFrame(3/4/1),g_nCursorState (0x6fbcb864) = 7。idle并恢复默认手型光标 (CursorId = 5protate)。修复方案
scripts/pack-cursor.ts):从d2data.mpq提取data/global/ui/CURSOR/buysell.dc6全部 10 帧(32x40)烘焙进public/ui/cursor.png图集及src/ui/cursor-meta.ts。src/ui/cursor.ts,src/ui/hud-manager.ts,src/ui/world-panels.ts):'buy' | 'sell' | 'repair') 及辨识光标模式 ('identify'),精确渲染buysell.dc6对应帧(Buy=Frame 3, Sell=Frame 4, Repair=Frame 1, Identify=Frame 0)。