fix: emit sceneChange before video start to avoid hotspot flash, prevent game end for hotspot-only scenes
This commit is contained in:
@@ -70,6 +70,8 @@ export class Engine {
|
||||
return
|
||||
}
|
||||
|
||||
this.emit('sceneChange', scene)
|
||||
|
||||
const preloadUrls = this.sceneManager.getCandidateUrls(
|
||||
scene,
|
||||
(conds) => conds ? this.stateManager.evaluate(conds) : true
|
||||
@@ -88,8 +90,6 @@ export class Engine {
|
||||
} else {
|
||||
this.videoManager.switchTo(scene.videoUrl, preloadUrls)
|
||||
}
|
||||
|
||||
this.emit('sceneChange', scene)
|
||||
}
|
||||
|
||||
private checkQTE = (time: number) => {
|
||||
@@ -205,6 +205,9 @@ export class Engine {
|
||||
} else {
|
||||
this.endGame()
|
||||
}
|
||||
} else if (scene.hotspots?.length) {
|
||||
// hotspot-only scene: wait for user to click a hotspot
|
||||
return
|
||||
} else {
|
||||
this.endGame()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user