fix: handle array nextScene in editor sceneEdges and deleteScene
This commit is contained in:
@@ -27,7 +27,17 @@ export function useGraphEditor() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scene.nextScene) {
|
if (scene.nextScene) {
|
||||||
result.push({ id: `${id}_next`, source: id, target: scene.nextScene, label: '\u2192 \u9ed8\u8ba4' })
|
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) {
|
||||||
if (scene.qte.successScene)
|
if (scene.qte.successScene)
|
||||||
@@ -93,7 +103,11 @@ export function useGraphEditor() {
|
|||||||
const s = nextScenes[key]
|
const s = nextScenes[key]
|
||||||
if (s.choices)
|
if (s.choices)
|
||||||
nextScenes[key] = { ...s, choices: s.choices.filter((c) => c.targetScene !== id) }
|
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) {
|
if (s.qte) {
|
||||||
const qte = { ...s.qte }
|
const qte = { ...s.qte }
|
||||||
let changed = false
|
let changed = false
|
||||||
|
|||||||
Reference in New Issue
Block a user