fix: initialize live2d in PixiStage constructor#757
fix: initialize live2d in PixiStage constructor#757MakinoharaShoko merged 2 commits intoOpenWebGAL:devfrom
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @HardyNLee, 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!
此拉取请求解决了Live2D初始化中的一个关键问题,通过将initLive2D函数的调用从Live2DCore构造函数移动到PixiStage构造函数。此前,直接在Live2DCore构造函数中初始化会导致加载失败。此修复确保Live2D在适当的阶段进行初始化。此外,此PR还引入了对旧版表情混合模式的支持,通过新的配置选项为Live2D表情处理提供了更大的灵活性。
Highlights
- Live2D初始化修复: Live2D.initLive2D()的调用已从Live2DCore构造函数移动到PixiStage构造函数,解决了Live2D在其自身核心类中直接初始化时加载失败的问题。
- 支持旧版表情混合模式: Live2DCore中新增了legacyExpressionBlendMode属性和相关逻辑,实现了Live2D模型旧版表情混合行为的动态配置。此设置现在可以通过新命令进行控制。
- Live2DCore重构: Live2DCore类已进行重构,将其构造函数与initLive2D调用解耦,并正确管理新的legacyExpressionBlendMode设置,确保在Live2D可用后应用配置。
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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
-
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. ↩
| if (command === 'Legacy_Expression_Blend_Mode') { | ||
| Live2D.legacyExpressionBlendMode = res === true; | ||
| } |
There was a problem hiding this comment.
这里的 res === true 判断是多余的。在前面的代码中(第 47-49 行),res 已经被转换成布尔值了。为了保持代码一致性和简洁性,建议直接使用 res。
与此文件中的 Enable_Appreciation 的处理方式 dispatch(setEnableAppreciationMode(res)); 保持一致,可以提高代码的可读性。
建议修改为:
if (command === 'Legacy_Expression_Blend_Mode') {
Live2D.legacyExpressionBlendMode = res;
}| if (command === 'Legacy_Expression_Blend_Mode') { | |
| Live2D.legacyExpressionBlendMode = res === true; | |
| } | |
| if (command === 'Legacy_Expression_Blend_Mode') { | |
| Live2D.legacyExpressionBlendMode = res; | |
| } |
介绍
将初始化 Live 2D 的函数放在 PixiStage 的构造函数中
支持设置旧版表情混合回退