feat: story gallery progress, type updates, roadmap, cleanup old session file
This commit is contained in:
67
ROADMAP.md
67
ROADMAP.md
@@ -1205,25 +1205,60 @@ npx @electron/packager . MyGame --platform=win32 --arch=x64 --out=release
|
||||
- [x] 验证:点击 ▶ 开始 → 正确跳转到该章节
|
||||
- [x] 验证:已删除 ChapterSelect.vue / EndingGallery.vue 后项目无编译残留
|
||||
|
||||
```json
|
||||
{
|
||||
"dependencies": {
|
||||
"vue": "^3.4",
|
||||
"pinia": "^2.1",
|
||||
"@vue-flow/core": "^1.x",
|
||||
"@vue-flow/background": "^1.x",
|
||||
"@vue-flow/controls": "^1.x",
|
||||
"dexie": "^4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.0",
|
||||
"typescript": "^5.3",
|
||||
"vite": "^5.0",
|
||||
"vue-tsc": "^2.0"
|
||||
}
|
||||
### P23 玩家树可视化 — 缩进树取代平铺列表 ✅ 已完成 2026-06-10
|
||||
|
||||
目标:将 StoryGallery 的章节回顾从平铺场景列表升级为缩进树形结构。创作图的汇聚节点在树上复制展示,
|
||||
玩家看到的是严格树——每条选择路径看起来都是独立的故事线(对标 Detroit)。
|
||||
|
||||
**核心改动:StoryGallery 的 `sceneListForChapter()` 替换为 `buildPlayerTree()`**
|
||||
——BFS 遍历图 → 保持树形父子关系 → 同节点不同路径各自复制。
|
||||
|
||||
**数据结构:**
|
||||
|
||||
```typescript
|
||||
interface PlayerTreeNode {
|
||||
sceneId: string
|
||||
label: string
|
||||
visited: boolean
|
||||
locked: boolean
|
||||
lockHint?: string
|
||||
children: PlayerTreeNode[]
|
||||
}
|
||||
```
|
||||
|
||||
**渲染效果对比:**
|
||||
|
||||
```
|
||||
之前(平铺列表): 之后(缩进树):
|
||||
✅ intro ✅ intro
|
||||
✅ left_door ├ ✅ left_door
|
||||
⬜ trust_ending 🔒 trust>=80 │ ├ ⬜ trust_ending 🔒 trust>=80
|
||||
⬜ alone_ending │ └ ⬜ alone_ending
|
||||
├ ✅ right_door
|
||||
│ ├ ✅ qte_success
|
||||
│ │ └ ✅ continue_ending
|
||||
│ └ ⬜ qte_fail
|
||||
└ ✅ stay
|
||||
└ ⬜ alone_ending ← 汇聚节点,两条路径各出现一次
|
||||
```
|
||||
|
||||
**实现改动:**
|
||||
|
||||
| 文件 | 改动 |
|
||||
|------|------|
|
||||
| `engine/types.ts` | 新增 `PlayerTreeNode` 接口 |
|
||||
| `src/components/StoryGallery.vue` | `sceneListForChapter()` → `buildPlayerTree()`(递归渲染缩进树)+ 纯 CSS 树连线(`border-left` + `::before` 横线) |
|
||||
|
||||
**实现清单:**
|
||||
|
||||
- [x] `engine/types.ts` — `PlayerTreeNode { sceneId, label, visited, locked, lockHint?, children[] }`
|
||||
- [x] `src/components/TreeNode.vue` — **新建** — 递归树节点组件,`depth` 参数控制缩进 + `border-left` 竖线
|
||||
- [x] `src/components/StoryGallery.vue` — `sceneListForChapter()` → `buildPlayerTree(sceneId, depth, pathSet)` + `buildTreeForChapter()`;Template 用 `<TreeNode>` 渲染
|
||||
- 回环检测:`pathSet: Set<string>` 记录当前路径场景 ID,精确剪枝
|
||||
- 深度兜底:`depth > 10` 截断
|
||||
- 汇聚节点:同一 sceneId 在不同父节点下各建一个独立的 PlayerTreeNode
|
||||
- [x] 验证:TypeScript + Vite build 通过
|
||||
|
||||
## 关键架构决策记录
|
||||
|
||||
1. **引擎与 UI 分离**: `engine/` 下纯 TS 类,不 import Vue。UI 层通过 composables 桥接。
|
||||
|
||||
Reference in New Issue
Block a user