fix: App.vue and useGameEngine refinements
This commit is contained in:
@@ -49,7 +49,7 @@ const showTopBar = ref(true)
|
|||||||
let hideTopBarTimer: ReturnType<typeof setTimeout> | null = null
|
let hideTopBarTimer: ReturnType<typeof setTimeout> | null = null
|
||||||
|
|
||||||
const { loadGame, start, resumeAutoSave, makeChoice, clickHotspot, startChapter,
|
const { loadGame, start, resumeAutoSave, makeChoice, clickHotspot, startChapter,
|
||||||
skipScene, setSpeed, getSpeed, isSceneWatched, startAtScene,
|
skipScene, setSpeed, getSpeed, isSceneWatched, startAtScene, jumpToScene,
|
||||||
saveGame, loadGameFromSlot, refreshSaves, saveSystem, engine } =
|
saveGame, loadGameFromSlot, refreshSaves, saveSystem, engine } =
|
||||||
useGameEngine(() => [videoElA.value, videoElB.value])
|
useGameEngine(() => [videoElA.value, videoElB.value])
|
||||||
|
|
||||||
@@ -124,8 +124,7 @@ function handleStartFromScene(sceneId: string) {
|
|||||||
if (ch) {
|
if (ch) {
|
||||||
startAtScene(ch.id, sceneId)
|
startAtScene(ch.id, sceneId)
|
||||||
} else {
|
} else {
|
||||||
const scene = engine.sceneManager.getScene(sceneId)
|
jumpToScene(sceneId)
|
||||||
if (scene) engine.goToScene(scene)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -209,6 +209,12 @@ export function useGameEngine(videoEls: () => [HTMLVideoElement | null, HTMLVide
|
|||||||
engine.startAtScene(chapterId, sceneId)
|
engine.startAtScene(chapterId, sceneId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function jumpToScene(sceneId: string) {
|
||||||
|
ensureVideo()
|
||||||
|
const scene = engine.sceneManager.getScene(sceneId)
|
||||||
|
if (scene) engine.goToScene(scene)
|
||||||
|
}
|
||||||
|
|
||||||
function skipScene() {
|
function skipScene() {
|
||||||
engine.skipCurrentScene()
|
engine.skipCurrentScene()
|
||||||
}
|
}
|
||||||
@@ -288,7 +294,7 @@ export function useGameEngine(videoEls: () => [HTMLVideoElement | null, HTMLVide
|
|||||||
makeChoice,
|
makeChoice,
|
||||||
clickHotspot,
|
clickHotspot,
|
||||||
startChapter,
|
startChapter,
|
||||||
startAtScene,
|
startAtScene, jumpToScene,
|
||||||
skipScene,
|
skipScene,
|
||||||
setSpeed,
|
setSpeed,
|
||||||
getSpeed,
|
getSpeed,
|
||||||
|
|||||||
Reference in New Issue
Block a user