From b6eb3c3959c0c68b364fa97b443fd07b23b9e11e Mon Sep 17 00:00:00 2001 From: cocos02 Date: Sun, 7 Jun 2026 21:07:21 +0800 Subject: [PATCH] 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 --- engine/systems/QTESystem.ts | 2 ++ src/components/SaveLoadMenu.vue | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/engine/systems/QTESystem.ts b/engine/systems/QTESystem.ts index 9098347..57c767c 100644 --- a/engine/systems/QTESystem.ts +++ b/engine/systems/QTESystem.ts @@ -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) diff --git a/src/components/SaveLoadMenu.vue b/src/components/SaveLoadMenu.vue index c85c646..54c3331 100644 --- a/src/components/SaveLoadMenu.vue +++ b/src/components/SaveLoadMenu.vue @@ -20,6 +20,33 @@ const maxSlots = 5

存档 / 读档

+
+
+ + 自动 +
+
+
自动存档
+
+ {{ saves.find(s => s.slot === 0)!.sceneLabel }} +
+
暂无自动存档
+
+
+ +
+
+