fix: QTE false race condition + restore auto-save slot in menu

- QTESystem: add if (!this.active) return guard in setInterval/setTimeout
  callbacks to prevent false result from firing after successful key press
- SaveLoadMenu: restore auto-save slot 0 row with blue styling, thumbnail,
  scene label, and read-only load button
This commit is contained in:
2026-06-07 21:07:21 +08:00
parent e2670c50d4
commit b6eb3c3959
2 changed files with 38 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ export class QTESystem {
document.addEventListener('keydown', this.keyHandler)
this.timerId = setInterval(() => {
if (!this.active) return
const elapsed = Date.now() - startTime
const remaining = Math.max(0, total - elapsed)
onUpdate(remaining / 1000, qte.timeLimit)
@@ -47,6 +48,7 @@ export class QTESystem {
}, this.tickMs)
this.timeoutId = setTimeout(() => {
if (!this.active) return
this.clear()
onResult(false)
}, total)