Skip to content

feat:现在歌曲详情Label会跟随屏幕位置调整 - #159

Open
zhicheng233 wants to merge 2 commits into
MuNET-OSS:mainfrom
zhicheng233:feat/SelectionDetail-position-tracking
Open

zhicheng233 wants to merge 2 commits into
MuNET-OSS:mainfrom
zhicheng233:feat/SelectionDetail-position-tracking

Conversation

@zhicheng233

@zhicheng233 zhicheng233 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
image_2026-10-11_04-43-54

View guided diff

Sourcery 摘要

使歌曲详情标签与播放器特定的屏幕位置调整保持一致。

新功能:

  • 调整歌曲详情标签,使其遵循每个播放器配置的屏幕位置。

增强功能:

  • 提供屏幕位置偏移量,以便 UI 定位逻辑复用。
Original summary in English

Sourcery 总结

使歌曲详情标签跟随播放器的屏幕位置调整。

新功能:

  • 使歌曲详情标签根据每个播放器的屏幕位置配置自动调整。

改进:

  • 公开屏幕位置偏移量,供界面定位逻辑复用。
Original summary in English

Sourcery 总结

让歌曲详情标签跟随播放器的屏幕位置调整。

新功能:

  • 使歌曲详情标签根据每个播放器实际的屏幕位置和尺寸进行定位与缩放。

改进:

  • 公开主屏幕区域计算结果及屏幕位置偏移量,供界面定位逻辑复用。
Original summary in English

Summary by Sourcery

让歌曲详情标签跟随播放器的屏幕位置调整。

New Features:

  • 使歌曲详情标签根据每个播放器实际的屏幕位置和尺寸进行定位与缩放。

Enhancements:

  • 公开主屏幕区域计算结果及屏幕位置偏移量,供界面定位逻辑复用。

Copilot AI balanced review requested due to automatic review settings October 10, 2026 20:47

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sourcery-ai

sourcery-ai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

审查者指南

本 PR 复用 ScreenPositionAdjust 计算出的屏幕位置偏移,在歌曲详情 Label 渲染时按玩家选择对应的偏移,并依据屏幕高度进行缩放,从而让 Label 跟随不同屏幕布局定位。

屏幕自适应歌曲详情 Label 渲染时序图

sequenceDiagram
    participant SelectionDetail
    participant ScreenPositionAdjust
    participant Screen
    participant GUI

    SelectionDetail->>Screen: Read height
    SelectionDetail->>ScreenPositionAdjust: Read offsetX and offsetY
    SelectionDetail->>SelectionDetail: Select player offset and scale by Screen.height / 1920f
    SelectionDetail->>GUI: Render label at adjusted x and y
Loading

文件级变更

变更 详情 文件
使歌曲详情 Label 根据屏幕位置配置动态偏移,并适配不同屏幕高度的缩放。
  • 按玩家位置选择对应的 X/Y 偏移数组项。
  • 以屏幕高度相对 1920 的比例缩放偏移量,并应用到 Label 坐标计算。
AquaMai.Mods/UX/SelectionDetail.cs
开放屏幕位置偏移数据供歌曲详情界面读取。
  • 将 X/Y 偏移数组从私有改为公开静态字段。
AquaMai.Mods/Utils/ScreenPositionAdjust.cs
更新 Mod 项目配置以支持新增实现依赖。
  • 调整项目文件引用或编译配置。
AquaMai.Mods/AquaMai.Mods.csproj

提示和命令

与 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

本 PR 复用 ScreenPositionAdjust 计算出的屏幕位置偏移,在歌曲详情 Label 渲染时按玩家选择对应的偏移,并依据屏幕高度进行缩放,从而让 Label 跟随不同屏幕布局定位。

Sequence diagram for screen-adjusted song detail label rendering

sequenceDiagram
    participant SelectionDetail
    participant ScreenPositionAdjust
    participant Screen
    participant GUI

    SelectionDetail->>Screen: Read height
    SelectionDetail->>ScreenPositionAdjust: Read offsetX and offsetY
    SelectionDetail->>SelectionDetail: Select player offset and scale by Screen.height / 1920f
    SelectionDetail->>GUI: Render label at adjusted x and y
Loading

File-Level Changes

Change Details Files
使歌曲详情 Label 根据屏幕位置配置动态偏移,并适配不同屏幕高度的缩放。
  • 按玩家位置选择对应的 X/Y 偏移数组项。
  • 以屏幕高度相对 1920 的比例缩放偏移量,并应用到 Label 坐标计算。
AquaMai.Mods/UX/SelectionDetail.cs
开放屏幕位置偏移数据供歌曲详情界面读取。
  • 将 X/Y 偏移数组从私有改为公开静态字段。
AquaMai.Mods/Utils/ScreenPositionAdjust.cs
更新 Mod 项目配置以支持新增实现依赖。
  • 调整项目文件引用或编译配置。
AquaMai.Mods/AquaMai.Mods.csproj

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.

嘿——我发现了 1 个问题

给 AI Agent 的提示
请处理本次代码审查中的评论:

## 单独的评论

### 评论 1
<location path="AquaMai.Mods/UX/SelectionDetail.cs" line_range="143" />
<code_context>
-            var y = Screen.height * 0.87f;
+            
+            //跟随屏幕位置调整
+            var sizeFactory = Screen.height / 1920f;
+            float offsetY;
+            float offsetX;
</code_context>
<issue_to_address>
**详细信息标签未跟随调整后的屏幕位置**

启用紧凑模式且主屏幕位置偏移量不为零时,`SelectionDetail.Window.OnGUI` 会将保存的偏移量缩放为 `Screen.height / 1920`,而 `ScreenPositionAdjust.GetSizeFactor()` 在紧凑模式下使用的是 `Screen.height / 1530`。因此,标签仅移动了屏幕调整量的 1530/1920,不再跟随主屏幕。

请使用与 `ScreenPositionAdjust.GetSizeFactor()` 相同的尺寸因子来缩放标签偏移量。
</issue_to_address>

Sourcery 评估

等待批准。 请先处理 1 个发现的问题。

阻塞性发现:AquaMai.Mods/UX/SelectionDetail.cs:143


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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="AquaMai.Mods/UX/SelectionDetail.cs" line_range="143" />
<code_context>
-            var y = Screen.height * 0.87f;
+            
+            //跟随屏幕位置调整
+            var sizeFactory = Screen.height / 1920f;
+            float offsetY;
+            float offsetX;
</code_context>
<issue_to_address>
**Detail label lags adjusted screen**

When compact mode is enabled and a main-screen position offset is nonzero, `SelectionDetail.Window.OnGUI` scales saved offsets by `Screen.height / 1920`, while `ScreenPositionAdjust.GetSizeFactor()` uses `Screen.height / 1530` in compact mode. The label therefore moves only 1530/1920 of the screen adjustment and no longer tracks the main screen.

Scale the label offsets using the same size factor as `ScreenPositionAdjust.GetSizeFactor()`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: AquaMai.Mods/UX/SelectionDetail.cs:143


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

Comment thread AquaMai.Mods/UX/SelectionDetail.cs Outdated

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

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="AquaMai.Mods/UX/SelectionDetail.cs">

<violation number="1" location="AquaMai.Mods/UX/SelectionDetail.cs:143">
P2: 紧凑模式下,画面偏移应按 `Screen.height / 1530` 转换为 GUI 坐标;固定使用 `1920` 会让详情标签只跟随约 80% 的位移。请使用与 `ScreenPositionAdjust.GetSizeFactor()` 一致的分母。</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread AquaMai.Mods/UX/SelectionDetail.cs Outdated
var y = Screen.height * 0.87f;

//跟随屏幕位置调整
var sizeFactory = Screen.height / 1920f;

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.

P2: 紧凑模式下,画面偏移应按 Screen.height / 1530 转换为 GUI 坐标;固定使用 1920 会让详情标签只跟随约 80% 的位移。请使用与 ScreenPositionAdjust.GetSizeFactor() 一致的分母。

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At AquaMai.Mods/UX/SelectionDetail.cs, line 143:

<comment>紧凑模式下,画面偏移应按 `Screen.height / 1530` 转换为 GUI 坐标;固定使用 `1920` 会让详情标签只跟随约 80% 的位移。请使用与 `ScreenPositionAdjust.GetSizeFactor()` 一致的分母。</comment>

<file context>
@@ -136,8 +138,22 @@ public void OnGUI()
-            var y = Screen.height * 0.87f;
+            
+            //跟随屏幕位置调整
+            var sizeFactory = Screen.height / 1920f;
+            float offsetY;
+            float offsetX;
</file context>
Suggested change
var sizeFactory = Screen.height / 1920f;
var sizeFactory = Screen.height / (ScreenPositionAdjust.compactMode ? 1080f + 450f : 1920f);

Comment thread AquaMai.Mods/AquaMai.Mods.csproj Outdated
@zhicheng233
zhicheng233 force-pushed the feat/SelectionDetail-position-tracking branch from 2434be6 to 239aa38 Compare October 11, 2026 05:24

@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 assessment

Approved.

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.

3 participants