-
-
Notifications
You must be signed in to change notification settings - Fork 320
feat: 添加 WebGAL 引擎描述文件规范实现 #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix: set logo background opaque when fade in
feat: preload template style files
feat: add ebg fading
feat: support conditional logic for string in -when command
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix: 修复 changeBg 与 changeFigure 的 exit 设置不能正常生效的问题
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix: resume alpha filter
fix: init config data when clear all data
…-comment fix: sentence save end-of-line comment
…omment feat: preserve inline comment in ISentence
fix: failed to modify source transform
feat: add blend mode argument
fix: update appreciation data properly
fix: ensure live2d blink focus in state is full
fix: voice volume OpenWebGAL#843
- 新增 webgal-engine.json 引擎描述文件,包含引擎元数据 - 新增 update-engine-version.js 脚本,自动同步版本号 - 修改构建流程,在构建前自动更新引擎描述文件版本 - 为第三方工具提供标准化的引擎识别和版本管理支持
Summary of ChangesHello @A-kirami, 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! 此拉取请求旨在通过引入 WebGAL 引擎描述文件规范(RFC v2.0)来提升引擎的标准化和可管理性。核心变更包括自动化版本同步机制,确保引擎元数据始终与项目版本保持一致;重构 UI 样式加载流程,利用缓存和事件机制优化性能;以及增强 PixiJS 渲染能力,支持更复杂的背景过渡动画和场景元素的混合模式与透明度控制。这些改进共同提升了引擎的开发效率、用户体验和生态系统的兼容性。 Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
本次 PR 实现了 WebGAL 引擎描述文件规范,并引入了版本自动同步脚本,这是一个很棒的标准化改进。同时,PR 还包含了大量的功能增强、重构和 Bug 修复,显著提升了代码质量和健壮性。
主要亮点包括:
- 新功能: 添加了
webgal-engine.json规范、立绘混合模式(blend mode)支持和脚本行内注释。 - 重构: 对 PIXI 对象的 Alpha 处理和
useApplyStylehook 进行了重构,使样式加载更集中、高效。 - 改进: 背景切换增加了交叉淡入淡出效果,
resetAllData现在会保留初始游戏配置,Live2D 相关 Reducer 的逻辑更健壮。 - 修复: 修正了
when条件解析、资源解锁逻辑等多个 Bug。
代码整体质量很高,改动考虑周全。我只发现了一个可以改进的小问题,即在解锁 CG/BGM 后保存用户数据时,没有处理潜在的异步错误。除此之外,其他改动都非常出色。
| if (name !== '') { | ||
| webgalStore.dispatch(unlockBgmInUserData({ name, url, series })); | ||
| const userDataState = webgalStore.getState().userData; | ||
| localforage.setItem(WebGAL.gameKey, userDataState).then(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localforage.setItem 是一个异步操作,可能会失败。当前的 .then(() => {}) 写法会静默地忽略所有潜在的错误,导致在保存用户数据失败时开发者和用户都无法察觉。建议添加错误处理,以便在出现问题时能够记录日志。
| localforage.setItem(WebGAL.gameKey, userDataState).then(() => {}); | |
| localforage.setItem(WebGAL.gameKey, userDataState).catch(error => logger.error('保存用户数据失败:', error)); |
| if (unlockName !== '') { | ||
| dispatch(unlockCgInUserData({ name: unlockName, url, series })); | ||
| const userDataState = webgalStore.getState().userData; | ||
| localforage.setItem(WebGAL.gameKey, userDataState).then(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localforage.setItem 是一个异步操作,可能会失败。当前的 .then(() => {}) 写法会静默地忽略所有潜在的错误,导致在保存用户数据失败时开发者和用户都无法察觉。建议添加错误处理,以便在出现问题时能够记录日志。
| localforage.setItem(WebGAL.gameKey, userDataState).then(() => {}); | |
| localforage.setItem(WebGAL.gameKey, userDataState).catch(error => logger.error('保存用户数据失败:', error)); |
🎯 PR 目的
实现 WebGAL 引擎描述文件规范(RFC v2.0),为引擎提供标准化的元数据描述,便于第三方工具识别和管理。
📦 主要变更
1. 新增引擎描述文件 (
webgal-engine.json)2. 新增版本同步脚本 (
update-engine-version.js)package.json读取版本号webgal-engine.json中的version和webgalVersion字段3. 修改构建流程
build脚本中添加版本同步步骤🎨 设计亮点
📚 相关文档
✅ 测试建议
npm run build验证版本同步脚本正常工作webgal-engine.json版本号是否正确更新