chore: engine, types, demo, and UI updates

This commit is contained in:
2026-06-14 16:05:00 +08:00
parent 544f548275
commit c46c4efd6c
5 changed files with 39 additions and 17 deletions

View File

@@ -195,6 +195,32 @@ function handleSpeedChange(rate: number) {
currentSpeed.value = rate
}
function onBattleResultContinue() {
store.setShowBattleResult(false)
const scene = store.currentScene
if (!scene) return
if (scene.nextScene) {
if (Array.isArray(scene.nextScene)) {
for (const route of scene.nextScene) {
if (!route.conditions || engine.stateManager.evaluate(route.conditions)) {
const next = engine.sceneManager.getScene(route.targetScene)
if (next) { engine.goToScene(next) }
return
}
}
} else {
const next = engine.sceneManager.getScene(scene.nextScene)
if (next) { engine.goToScene(next) }
return
}
}
if (scene.choices && scene.choices.length > 0) {
const first = scene.choices[0]
const next = engine.sceneManager.getScene(first.targetScene)
if (next) { engine.goToScene(next) }
}
}
watch(() => store.currentScene?.id, async (newId) => {
if (!newId) { canSkip.value = false; return }
const scene = store.currentScene
@@ -370,7 +396,7 @@ init()
<BattleResult
v-if="store.showBattleResult"
:result="store.battleResultData"
@continue="store.setShowBattleResult(false)"
@continue="onBattleResultContinue"
/>
<MainMenu
v-if="!started || store.gameEnded"