Skip to content

feat: add nobreak argument for wait#857

Open
xiaoxustudio wants to merge 2 commits intoOpenWebGAL:devfrom
xiaoxustudio:feat/wait-nobreak
Open

feat: add nobreak argument for wait#857
xiaoxustudio wants to merge 2 commits intoOpenWebGAL:devfrom
xiaoxustudio:feat/wait-nobreak

Conversation

@xiaoxustudio
Copy link
Member

wait 指令添加了-nobreak 不可打断参数
close #849

@gemini-code-assist
Copy link

Summary of Changes

Hello @xiaoxustudio, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求引入了一项新功能,允许 wait 指令在执行时变为不可中断。通过添加一个 -nobreak 参数,游戏可以在特定等待期间阻止用户或系统触发的下一句指令,确保关键的动画、场景或事件能够完整播放,从而增强了游戏流程的控制力和用户体验。

Highlights

  • 新增 wait 指令的 -nobreak 参数: 为 wait 指令添加了一个新的布尔参数 -nobreak,允许将等待设置为不可中断。
  • 阻止 nextSentence 执行: 当 wait 指令处于不可中断状态时,nextSentence 函数将提前返回,从而阻止游戏进行到下一句。
  • Redux 状态管理: 在 Redux 存储中新增了 waitNoBreak 状态,用于跟踪当前是否处于不可中断的等待中,并在等待结束后自动重置该状态。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/webgal/src/Core/controller/gamePlay/nextSentence.ts
    • nextSentence 函数的开头添加了对 GUIState.waitNoBreak 的检查,如果为 true 则直接返回,阻止下一句的执行。
  • packages/webgal/src/Core/gameScripts/wait.ts
    • 引入了 setWaitNoBreakwebgalStoregetBooleanArgByKey
    • wait 函数中,解析 nobreak 参数。
    • 如果 nobreaktrue,则通过 Redux dispatch setWaitNoBreak(true),并在等待结束后通过 setTimeout dispatch setWaitNoBreak(false)
  • packages/webgal/src/store/GUIReducer.ts
    • IGuiState 的初始状态中添加了 waitNoBreak: false
    • 新增了 setWaitNoBreak reducer,用于更新 waitNoBreak 状态。
    • 导出了 setWaitNoBreak action。
  • packages/webgal/src/store/guiInterface.ts
    • IGuiState 接口中添加了 waitNoBreak: boolean; 属性,并附带中文注释。
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

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

Choose a reason for hiding this comment

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

Code Review

本次 PR 为 wait 指令添加了 -nobreak 参数,用于实现不可中断的等待,整体实现思路清晰。但在 wait.ts 中,新的 setTimeout 逻辑缺少了清理机制,可能会在特定情况下导致 bug。我已经在具体文件中提出了修改建议,请检查并修复该问题。

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