From 7d8629cd73cbb9daf31806321ccd2e0ac7c7ad5e Mon Sep 17 00:00:00 2001 From: troytt <47798984@qq.com> Date: Mon, 14 Sep 2026 13:07:37 +0000 Subject: [PATCH] =?UTF-8?q?feat(scene):=20=E8=A1=94=E6=8E=A5=20NPC=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=87=B3=E5=BC=95=E6=93=8E=E5=B1=82=E5=8F=8A?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E9=9D=A2=E6=9D=BF=E9=AA=8C=E8=AF=81=20(fixes?= =?UTF-8?q?=20#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 建立 NPC token 到独立显示名称的转译字典。将打包导出的 NPC 集合统一注水到 GameEngine 模型内以生效交互半径;同时增加 Canvas UI 外围的绝对定位 DOM 生成层来渲染 NPC 头顶铭牌名称,以及挂载对应的对话展示面板供 engine.dialog 同步刷新。更新 E2E 环境验证逻辑检测交互健壮性。 --- acts.html | 3 ++ scripts/browser/checks/act-pack-state.js | 9 +++++ scripts/browser/checks/act-state.js | 5 +++ src/game/engine.ts | 4 +- src/game/npc.ts | 30 ++++++++++++++ src/scene/act-scene.ts | 51 +++++++++++++++++++++++- src/scene/map-scene.ts | 7 ++-- 7 files changed, 102 insertions(+), 7 deletions(-) create mode 100644 src/game/npc.ts diff --git a/acts.html b/acts.html index b4805a1..0a54457 100644 --- a/acts.html +++ b/acts.html @@ -27,6 +27,7 @@ option { background: #1c1813; } /* 状态面板放在控件行上方:贴在右下角会压住"细分场景"那个下拉框 */ #status { right: 12px; bottom: 58px; padding: 6px 10px; max-width: 60vw; color: #9c8d78; } + #dialog { right: 12px; top: 36px; padding: 8px 12px; min-width: 240px; color: #e8dcc8; white-space: pre-wrap; font-size: 14px; background: rgba(30, 26, 21, .9); border-color: #c8a15a; } .hint { color: #6d5a34; } @@ -48,6 +49,8 @@ WASD / 方向键移动 · 滚轮或 +/− 缩放 · 三个下拉框都会换图并更新地址栏
+ +