Skip to content

fix: 修复 exitDuration 未正常生效的问题(close #852)#853

Open
ChangeSuger wants to merge 2 commits intoOpenWebGAL:devfrom
ChangeSuger:fix/exit-duration
Open

fix: 修复 exitDuration 未正常生效的问题(close #852)#853
ChangeSuger wants to merge 2 commits intoOpenWebGAL:devfrom
ChangeSuger:fix/exit-duration

Conversation

@ChangeSuger
Copy link

#852

之前 #827 的改动没考虑到还有单独设置 exitDuration 的情况,导致 exitDuration 不生效,修复一下这个问题。

测试用例:

changeBg:bg.webp -duration=5000 -exitDuration=5000 -next;
:背景入场 5000;
changeFigure:stand.webp -id=aaa -duration=5000 -exitDuration=5000 -next;
:立绘入场 5000;
changeFigure:none -id=aaa -next;
:立绘退场 exitDuration 5000;
changeBg:none -next;
:背景退场 exitDuration 5000;

@gemini-code-assist
Copy link

Summary of Changes

Hello @ChangeSuger, 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!

此拉取请求旨在解决一个关键的动画时长设置问题,即 exitDuration 在特定情况下未能生效。通过重构动画设置的获取和处理逻辑,并修正了 stageReducer 中移除动画设置的条件,确保了无论是否指定了自定义退出动画名称,exitDuration 都能被正确识别和应用,从而提升了动画行为的准确性和可控性。

Highlights

  • 修复 exitDuration 未生效问题: 解决了在特定情况下,exitDuration 动画时长设置未能正确生效的问题,确保动画退出行为符合预期。
  • 优化动画设置获取逻辑: 重构了 getEnterExitAnimation 函数中动画设置的获取方式,引入 animationSettings 变量统一管理,提高了代码的可读性和健壮性。
  • 调整 stageReducer 移除条件: 修改了 stageReducer 中移除动画设置的条件,使其在 exitDuration 被明确定义时也能保留相关的 -off 设置,从而正确应用退出时长。

🧠 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.

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

这次的改动很好地解决了 exitDuration 未生效的问题。通过在 animationFunctions.ts 中缓存 animationSettings,避免了重复的查询,提升了代码的可读性和效率。同时,确保了在获取动画设置后正确地将其移除。在 stageReducer.ts 中对 exitDuration 的判断逻辑也修正得很正确。整体来看,这是一个高质量的修复,没有发现其他问题。

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