Skip to content

[F] SetFade festa type not working on 1.65#126

Merged
clansty merged 1 commit intoMuNET-OSS:mainfrom
WUGqnwvMQPzl:setfade-fix
Apr 23, 2026
Merged

[F] SetFade festa type not working on 1.65#126
clansty merged 1 commit intoMuNET-OSS:mainfrom
WUGqnwvMQPzl:setfade-fix

Conversation

@WUGqnwvMQPzl
Copy link
Copy Markdown
Contributor

@WUGqnwvMQPzl WUGqnwvMQPzl commented Apr 23, 2026

Summary by Sourcery

调整 SetFade 的初始化方式,以在较新游戏版本中支持 festa 淡入淡出类型,同时保持与现有行为的兼容性。

Bug Fixes:

  • 修复在游戏版本 1.65 以及其他使用更新淡入淡出类型逻辑的版本中,festa 淡入淡出类型无法被识别的问题。

Enhancements:

  • 通过同时根据游戏版本和资源可用性来控制额外 festa 背景的使用,使淡入淡出背景的加载在未来更具兼容性与扩展性。
Original summary in English

Summary by Sourcery

Adjust SetFade initialization to support the festa fade type on newer game versions while remaining compatible with existing behavior.

Bug Fixes:

  • Fix festa fade type not being recognized on game version 1.65 and other versions using the updated fade type logic.

Enhancements:

  • Make fade background loading future-proof by gating additional festa background usage on both game version and asset availability.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 23, 2026

审查者指南(在小型 PR 上折叠)

审查者指南

重构 SetFade 的初始化逻辑:始终加载基础的子背景精灵,并在游戏版本为 26000 及以上时有条件地加载 festa 专用精灵,使淡入淡出类型和精灵验证在不同版本之间更加通用且健壮。

文件级变更

变更 详情 文件
统一子背景初始化逻辑,并使 festa 淡入淡出类型处理对版本更加宽容。
  • 无论游戏版本如何,始终加载 Sub_01 和 Sub_02 精灵,并一并对它们进行验证
  • 默认情况下初始化淡入淡出类型 0 和 1 的有效性
  • 对于 26000 及以上版本的游戏,尝试加载 Sub_03(festa)精灵,并且仅在该资源存在时扩展精灵和淡入淡出类型的有效性
  • 将有效性检查改为增量式,保留之前的验证结果而不是覆盖它们
AquaMai.Mods/Fancy/SetFade.cs

技巧与命令

与 Sourcery 交互

  • 触发新审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 通过回复某条审查评论,请求 Sourcery 从该评论创建一个 issue。你也可以在审查评论下回复 @sourcery-ai issue 来创建相应的 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title 以(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文的任意位置写上 @sourcery-ai summary,即可在你想要的位置随时生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 以(重新)生成摘要。
  • 生成审查者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从一次全新的审查开始,这尤其有用——别忘了再评论 @sourcery-ai review 以触发新的审查!

自定义你的体验

访问你的 控制面板 以:

  • 启用或禁用诸如 Sourcery 生成的 pull request 摘要、审查者指南等审查功能。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查指令。
  • 调整其他审查设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors SetFade initialization to always load base sub background sprites and conditionally load the festa-specific sprite for game versions 26000 and above, making the fade type and sprite validation more version-agnostic and robust.

File-Level Changes

Change Details Files
Unify sub background initialization and make festa fade type handling version-tolerant.
  • Always load Sub_01 and Sub_02 sprites regardless of game version and validate them together
  • Initialize fade type validity for types 0 and 1 by default
  • For game versions 26000 and above, attempt to load Sub_03 (festa) sprite and only extend sprite and fade-type validity if the resource exists
  • Update validity checks to be incremental, preserving previous validation results instead of overwriting them
AquaMai.Mods/Fancy/SetFade.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - 我在这里给了一些整体性的反馈:

  • 由于前面已经对 festaSubBG 做了空值检查,areSubBGsValid = areSubBGsValid && subBGs[2] != null; 这一行是多余的;你可以简化这个代码块,只给 subBGs[2] 赋值,并保持 areSubBGsValid 不变,或者显式地将它设为 true。
  • 注释 // make it future proof maybe? 比较含糊;建议换成更具体的描述,说明在版本 >= 26000 且 Festa 背景是可选时的预期行为。
给 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- The `areSubBGsValid = areSubBGsValid && subBGs[2] != null;` line is redundant given the prior null-check on `festaSubBG`; you can simplify this block by assigning `subBGs[2]` and leaving `areSubBGsValid` unchanged or explicitly setting it to true.
- The comment `// make it future proof maybe?` is vague; consider replacing it with something more specific about the intended behavior for versions >= 26000 and the optional Festa background.

Sourcery 对开源项目是免费的——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进以后的代码审查。
Original comment in English

Hey - I've left some high level feedback:

  • The areSubBGsValid = areSubBGsValid && subBGs[2] != null; line is redundant given the prior null-check on festaSubBG; you can simplify this block by assigning subBGs[2] and leaving areSubBGsValid unchanged or explicitly setting it to true.
  • The comment // make it future proof maybe? is vague; consider replacing it with something more specific about the intended behavior for versions >= 26000 and the optional Festa background.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `areSubBGsValid = areSubBGsValid && subBGs[2] != null;` line is redundant given the prior null-check on `festaSubBG`; you can simplify this block by assigning `subBGs[2]` and leaving `areSubBGsValid` unchanged or explicitly setting it to true.
- The comment `// make it future proof maybe?` is vague; consider replacing it with something more specific about the intended behavior for versions >= 26000 and the optional Festa background.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@clansty clansty merged commit 23c0cb9 into MuNET-OSS:main Apr 23, 2026
3 checks passed
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Copy Markdown

@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

This pull request refactors the SetFade_Initialize method in SetFade.cs to improve code structure and future-proof background sprite loading for game versions 26000 and above. It also removes an unused System.Reflection import. Feedback was provided regarding a redundant null check for subBGs[2] inside the version-specific conditional block, as the object is already verified to be non-null.

if (festaSubBG != null)
{
subBGs[2] = festaSubBG;
areSubBGsValid = areSubBGsValid && subBGs[2] != null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This line is redundant. Since the code is inside an if (festaSubBG != null) block and subBGs[2] was just assigned festaSubBG, subBGs[2] is guaranteed to be non-null here. Additionally, areSubBGsValid was already checked for subBGs[0] and subBGs[1] on line 48.

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.

2 participants