Repository navigation
feat:现在歌曲详情Label会跟随屏幕位置调整 - #159
zhicheng233 wants to merge 2 commits into
Conversation
审查者指南本 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
文件级变更
提示和命令与 Sourcery 交互
自定义使用体验访问你的控制面板以:
获取帮助Original review guide in EnglishReviewer's Guide本 PR 复用 ScreenPositionAdjust 计算出的屏幕位置偏移,在歌曲详情 Label 渲染时按玩家选择对应的偏移,并依据屏幕高度进行缩放,从而让 Label 跟随不同屏幕布局定位。 Sequence diagram for screen-adjusted song detail label renderingsequenceDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
嘿——我发现了 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
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
There was a problem hiding this comment.
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
| var y = Screen.height * 0.87f; | ||
|
|
||
| //跟随屏幕位置调整 | ||
| var sizeFactory = Screen.height / 1920f; |
There was a problem hiding this comment.
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>
| var sizeFactory = Screen.height / 1920f; | |
| var sizeFactory = Screen.height / (ScreenPositionAdjust.compactMode ? 1080f + 450f : 1920f); |
2434be6 to
239aa38
Compare
Sourcery 摘要
使歌曲详情标签与播放器特定的屏幕位置调整保持一致。
新功能:
增强功能:
Original summary in English
Sourcery 总结
使歌曲详情标签跟随播放器的屏幕位置调整。
新功能:
改进:
Original summary in English
Sourcery 总结
让歌曲详情标签跟随播放器的屏幕位置调整。
新功能:
改进:
Original summary in English
Summary by Sourcery
让歌曲详情标签跟随播放器的屏幕位置调整。
New Features:
Enhancements: