Skip to content

fix: 单人模式部分贴图裁剪 - #149

Merged
clansty merged 1 commit into
MuNET-OSS:mainfrom
s-yh-china:fix1
Sep 19, 2026
Merged

clansty merged 1 commit into
MuNET-OSS:mainfrom
s-yh-china:fix1

Conversation

@s-yh-china

@s-yh-china s-yh-china commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Close #148

如图所示,使用此方案后修复了问题,其恢复正常 (注:达成率问题为其他 mod 导致)

FGXR$NZX(UM7}Y ZU9FG${O

Review in cubic

@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
审查者指南(小型 PR 中折叠显示)

审查者指南

该 PR 通过修补当前的 ScreenClipSetter.SetClipX 实现,将异常狭窄的水平裁剪范围扩展为全屏,从而修复单人模式下的贴图裁剪问题,而不是禁用之前的背景控制器方法。

单人模式贴图裁剪修正时序图

sequenceDiagram
    participant ScreenClipSetter
    participant HarmonyPatch

    ScreenClipSetter->>HarmonyPatch: SetClipX(minX, maxX)
    HarmonyPatch->>HarmonyPatch: [maxX <= 0.5f]
    HarmonyPatch->>HarmonyPatch: minX = 0f
    HarmonyPatch->>HarmonyPatch: maxX = 1f
    HarmonyPatch-->>ScreenClipSetter: Continue with corrected clip range
Loading

文件级变更

变更 详情 文件
调整单人模式背景裁剪钩子,以修正错误裁剪的贴图,同时保留正常的裁剪行为。
  • 针对游戏版本 27000,将 Harmony 补丁从旧版背景控制器方法改为 ScreenClipSetter.SetClipX。
  • 将补丁从会抑制原始方法的前缀改为可兼容参数调整的无返回值后缀钩子。
  • 当请求的最大裁剪值小于或等于 0.5 时,将水平裁剪范围重置为完整的 [0, 1] 范围。
AquaMai.Mods/GameSystem/SinglePlayer.cs

针对关联 Issue 的评估

Issue 目标 已解决 说明
#148 修复单人模式下部分贴图被错误裁剪的问题。 ✅
#148 避免通过无差别禁用上框裁剪导致其他贴图也受到影响,并采用更有针对性的裁剪处理方案。 ✅

可能关联的 Issue


提示和命令

与 Sourcery 交互

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

自定义使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

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

Reviewer's Guide

The PR fixes single-player texture cropping by patching the current ScreenClipSetter.SetClipX implementation and expanding unusually narrow horizontal clip ranges to the full screen, rather than disabling the previous background-controller method.

Sequence diagram for single-player texture clip correction

sequenceDiagram
    participant ScreenClipSetter
    participant HarmonyPatch

    ScreenClipSetter->>HarmonyPatch: SetClipX(minX, maxX)
    HarmonyPatch->>HarmonyPatch: [maxX <= 0.5f]
    HarmonyPatch->>HarmonyPatch: minX = 0f
    HarmonyPatch->>HarmonyPatch: maxX = 1f
    HarmonyPatch-->>ScreenClipSetter: Continue with corrected clip range
Loading

File-Level Changes

Change Details Files
Adjust the single-player background clipping hook to correct incorrectly cropped textures while preserving normal clipping behavior.
  • Retarget the Harmony patch from the legacy background controller method to ScreenClipSetter.SetClipX for game version 27000.
  • Change the patch from a prefix that suppresses the original method to a parameter-adjusting postfix-compatible void hook.
  • Reset the horizontal clip range to the full [0, 1] span when the requested maximum clip is at or below 0.5.
AquaMai.Mods/GameSystem/SinglePlayer.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#148 修复单人模式下部分贴图被错误裁剪的问题。 ✅
#148 避免通过无差别禁用上框裁剪导致其他贴图也受到影响,并采用更有针对性的裁剪处理方案。 ✅

Possibly linked issues


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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

嘿——我已经审查了你所做的更改,看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的评审,请考虑分享它们 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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

Copy link
Copy Markdown
Contributor

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

Re-trigger cubic

@clansty clansty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

草 还真是

@clansty
clansty merged commit e80a59d into MuNET-OSS:main Sep 19, 2026
2 checks passed
@s-yh-china
s-yh-china deleted the fix1 branch October 2, 2026 16:17
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