From 1f3c1e90f843e482e5a0df02d3ec8647108e1b61 Mon Sep 17 00:00:00 2001 From: Mahiru Date: Sat, 17 Oct 2026 23:37:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20getUserInput=20=E5=B8=A6=20-continue=20?= =?UTF-8?q?=E6=97=B6=E5=A4=9A=E8=B7=B3=E8=BF=87=E4=B8=80=E8=A1=8C=20(#1065?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 确认输入后先 unmountPerform,带 -continue 时会触发一次 goNextWhenOver, 随后又手动 continueSentence,导致推进两次。改为演出始终声明 goNextWhenOver,由卸载统一触发继续。 --- packages/webgal/src/Core/gameScripts/getUserInput/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/webgal/src/Core/gameScripts/getUserInput/index.tsx b/packages/webgal/src/Core/gameScripts/getUserInput/index.tsx index 2709364a3..5ac7651ad 100644 --- a/packages/webgal/src/Core/gameScripts/getUserInput/index.tsx +++ b/packages/webgal/src/Core/gameScripts/getUserInput/index.tsx @@ -8,7 +8,6 @@ import styles from './getUserInput.module.scss'; import { useSEByWebgalStore } from '@/hooks/useSoundEffect'; import { WebGAL } from '@/Core/WebGAL'; import { getStringArgByKey } from '@/Core/util/getSentenceArg'; -import { continueSentence } from '@/Core/controller/gamePlay/nextSentence'; import { getCurrentFontFamily } from '@/hooks/useFontFamily'; import { logger } from '@/Core/util/logger'; import { tryToRegex } from '@/Core/util/global'; @@ -74,8 +73,8 @@ export const getUserInput = (sentence: ISentence): IPerform => { }); } playSeClick(); + // 卸载时由 goNextWhenOver 继续推进,这里不能再手动推进,否则与 -continue 叠加会推进两次 WebGAL.gameplay.performController.unmountPerform('userInput'); - continueSentence(); }} className={styles.button} > @@ -102,5 +101,7 @@ export const getUserInput = (sentence: ISentence): IPerform => { blockingNext: () => true, blockingAuto: () => true, blockingStateCalculation: () => true, + // 确认输入后总是继续,无论是否带 -continue + goNextWhenOver: true, }; };