chore: engine, types, demo, and UI updates
This commit is contained in:
28
src/App.vue
28
src/App.vue
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user