传送点(Waypoint)列表应支持点击无缝传送到对应地图的小站(随机选一个变体)上 #137
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?
问题描述
参考截图:https://screenshot-v2.corp.google.com/44d8qhg4rm3t0
点击小站(Waypoint)面板中的目的地列表时,应当能够直接传送到对应地图的小站瓦片位置上,并且从该地图的可用变体(Variants)中随机选择一个变体载入。
根因分析
ACT_WAYPOINTS中的slug(如cold-plains)与samples/d2-packs/index.json中的关卡变体标识或levelId(如levelId: 3的3-act-1-wilderness-2-var1..3)未建立精确映射。onWaypointTeleport原先仅修改location.search,未调用场景引擎的loadRuntimeForLevel随机选取该levelId的变体,也未将玩家出生/落点坐标定位于目标地图的next.waypoints[0](小站物件子瓦片坐标)。解决方案
levelId(如罗格营地=1, 冰冷之原=3, 乱石旷野=4, 黑暗森林=5, 黑色荒地=6, 外侧回廊=27, 监牢一层=29, 内侧回廊=32, 地下墓穴二层=35 等)。levelId在资源包中的所有可用变体并随机挑选一个变体载入,提取该变体的next.waypoints[0]坐标作为玩家落点(若小站中心不可行走则落于紧邻可走子瓦片),同步更新顶部下拉框与区域进入横幅。验证通过并已随提交
14443c6修复关单改动方案:
src/ui/world-panels.ts中建立 1~5 幕全量 39 个原版传送点的levelId与waypointId拓扑映射表。src/scene/act-scene.ts中接线onWaypointTeleport,通过swapLevel执行内存级无缝场景切换(0 页面刷新)。next.waypoints[0]。验证结果: