fix: handle array nextScene in editor sceneEdges and deleteScene
This commit is contained in:
@@ -27,8 +27,18 @@ export function useGraphEditor() {
|
||||
}
|
||||
}
|
||||
if (scene.nextScene) {
|
||||
if (Array.isArray(scene.nextScene)) {
|
||||
for (let ri = 0; ri < scene.nextScene.length; ri++) {
|
||||
const r = scene.nextScene[ri]
|
||||
if (r.targetScene) {
|
||||
const condLabel = r.conditions?.length ? '→ 条件' : '→ 默认'
|
||||
result.push({ id: `${id}_next_${ri}`, source: id, target: r.targetScene, label: condLabel })
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result.push({ id: `${id}_next`, source: id, target: scene.nextScene, label: '\u2192 \u9ed8\u8ba4' })
|
||||
}
|
||||
}
|
||||
if (scene.qte) {
|
||||
if (scene.qte.successScene)
|
||||
result.push({ id: `${id}_qte_s`, source: id, target: scene.qte.successScene, label: 'QTE\u6210\u529f' })
|
||||
@@ -93,7 +103,11 @@ export function useGraphEditor() {
|
||||
const s = nextScenes[key]
|
||||
if (s.choices)
|
||||
nextScenes[key] = { ...s, choices: s.choices.filter((c) => c.targetScene !== id) }
|
||||
if (s.nextScene === id) nextScenes[key] = { ...nextScenes[key], nextScene: '' }
|
||||
if (Array.isArray(s.nextScene)) {
|
||||
nextScenes[key] = { ...s, nextScene: s.nextScene.filter((r) => r.targetScene !== id) }
|
||||
} else if (s.nextScene === id) {
|
||||
nextScenes[key] = { ...nextScenes[key], nextScene: '' }
|
||||
}
|
||||
if (s.qte) {
|
||||
const qte = { ...s.qte }
|
||||
let changed = false
|
||||
|
||||
Reference in New Issue
Block a user