Skip to content

fix: 禁止预览命令触发自动快速存档#983

Open
A-kirami wants to merge 2 commits into
OpenWebGAL:mainfrom
A-kirami:fix/preview-auto-fast-save
Open

fix: 禁止预览命令触发自动快速存档#983
A-kirami wants to merge 2 commits into
OpenWebGAL:mainfrom
A-kirami:fix/preview-auto-fast-save

Conversation

@A-kirami

Copy link
Copy Markdown
Contributor

变更说明

修复编辑器预览命令触发 stage commit 时,会意外触发自动快速存档的问题。

本次改动将 notifyReactautoFastSave 拆成两个独立的 commit 副作用:
普通游戏流程默认继续自动快速存档,编辑器预览流程显式传入 { autoFastSave: false }

主要改动

  • StageStateManager.commit() 增加 autoFastSave 选项。
  • 将自动快速存档触发条件从 notifyReact 改为 autoFastSave
  • 预览同步命令统一关闭自动快速存档。
  • commitOptions 沿以下链路传递:
    • nextSentence -> forward -> scriptExecutor -> runScript
    • perform 启动、自然结束、-continue 自动推进
    • changeScene / callScene / restoreScene 的异步续接
    • choosegetUserInput 的用户回调

拆分 stage commit 的 React 通知和自动快速存档副作用,
让预览同步命令显式关闭 autoFastSave。

同时将 commitOptions 沿脚本执行、perform 生命周期、
场景切换续接、选择枝和输入框回调传递,避免异步续接路径
回落到默认快速存档行为。

新增 StageStateManager commit 行为测试,覆盖显式关闭自动快存、
变量提交关闭自动快存,以及 notifyReact 与 autoFastSave 相互独立。

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request decouples the automatic fast-saving of the game from the React notification mechanism by introducing a new autoFastSave option to IStageCommitOptions. This option is propagated throughout the codebase, including the performance controller, script execution paths, and scene transition functions, and is explicitly disabled during preview and debug syncs. The feedback highlights a potential regression in stageStateManager.ts where silent commits (with notifyReact: false) might now unexpectedly trigger auto-saving because autoFastSave defaults to true. A code suggestion is provided to default autoFastSave to options.notifyReact to preserve backward compatibility.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/webgal/src/Core/Modules/stage/stageStateManager.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant