feat: P3 - visual scenario editor with Vue Flow

- editor/: stand-alone Vite multi-page app for visual scenario editing
- editor/components/SceneGraph.vue: Vue Flow graph with scene nodes, branch/default/QTE edges
- editor/components/NodeEditor.vue: right panel editing video/subtitle paths, choices, QTE params
- editor/components/PreviewPanel.vue: embedded video player previewing selected scene
- editor/composables/useGraphEditor.ts: bidirectional graph<->JSON sync
- editor/App.vue: toolbar (new scene, import/export JSON, load demo, start scene selector)
- @vue-flow/core|background|controls: graph visualization dependencies
- vite.config.ts: multi-page build (main + editor)
- ROADMAP: mark P3 as completed
This commit is contained in:
2026-06-07 21:38:08 +08:00
parent 65c26e0972
commit 3b4c6d7024
11 changed files with 1245 additions and 8 deletions

View File

@@ -167,15 +167,17 @@ interface SaveData {
- [x] 完整事件总线sceneChange, choiceRequest, choiceTimer, choiceTimeout, videoEnd, qteTrigger, qteTimer, qteResult, gameEnd
- [x] 验证QTE 正常触发与判定ArrowLeft/ArrowRight/A/D 躲石块),字幕同步,存档缩略图正常
### P3 编辑器 — 可视化剧情编辑2-3 周)
### P3 编辑器 — 可视化剧情编辑2-3 周)✅ 已完成 2026-06-07
- [ ] 编辑器入口:独立 `editor/index.html` + `editor/main.ts`
- [ ] `editor/components/SceneGraph.vue` — Vue Flow 节点图(节点=场景,边=选择分支
- [ ] `editor/components/NodeEditor.vue` — 右侧面板编辑选中节点的视频、选项、QTE、条件/效果
- [ ] `editor/components/PreviewPanel.vue` — 嵌入播放器实时预览当前编辑的剧情线
- [ ] `editor/composables/useGraphEditor.ts` — 图数据与 JSON 双向同步
- [ ] JSON 导出/导入
- [ ] 验证:编辑器能产出合法 JSON引擎能正确加载并运行
- [x] 编辑器入口:独立 `editor/index.html` + `editor/main.ts`Vite 多入口构建)
- [x] `editor/components/SceneGraph.vue` — Vue Flow 节点图(场景节点 + 分支/默认/QTE 连线
- [x] `editor/components/NodeEditor.vue` — 右侧面板(视频/字幕路径、nextScene、选项增删改、QTE 参数编辑)
- [x] `editor/components/PreviewPanel.vue` — 嵌入播放器实时预览选中场景视频
- [x] `editor/composables/useGraphEditor.ts` — 图数据与 JSON 双向同步
- [x] JSON 导出/导入(文件下载 + 文件选择)
- [x] 工具栏:新建场景、导入 JSON、导出 JSON、加载示例、起始场景选择
- [x] `vite.config.ts` — 多页面构建main + editor
- [x] 验证:编辑器能产出合法 JSON引擎能正确加载并运行
## 依赖清单