-
Notifications
You must be signed in to change notification settings - Fork 13
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
让trackNumber可以显示2位数字 #34
base: main
Are you sure you want to change the base?
Conversation
Original review guide in EnglishReviewer's Guide by SourceryThis pull request introduces a new class that modifies the display of track numbers in the UI to support two digits, optionally using a zero prefix. The implementation uses Harmony patches to intercept the CommonMonitor.SetTrackCount method, with a postfix patch for initializing custom extended sprites and a prefix patch for adjusting the UI components (text formatting, scaling, and positioning) based on the current and max track numbers. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
嘿 @ck2739046 - 我已经审查了你的更改 - 这里有一些反馈:
总体评论:
- 考虑将创建
newTex
的逻辑提取到一个单独的方法中,以提高可读性。 - 使用字符串格式化进行填充可能更简洁,而不是
PadLeft
,因为它直接传达了意图。
以下是我在审查期间查看的内容
- 🟢 一般问题:一切看起来都很好
- 🟢 安全性:一切看起来都很好
- 🟢 测试:一切看起来都很好
- 🟢 复杂性:一切看起来都很好
- 🟢 文档:一切看起来都很好
帮助我更有用!请点击每个评论上的 👍 或 👎,我将使用反馈来改进你的评论。
Original comment in English
Hey @ck2739046 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the logic for creating
newTex
into a separate method to improve readability. - It might be cleaner to use string formatting for padding instead of
PadLeft
, as it directly conveys the intent.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
没有必要patch这么多 直接使用CommonMonitor中的_trackFreedomCountText即可 |
请赐教 |
diff --git a/Assembly-CSharp/Monitor/CommonMonitor.cs b/Assembly-CSharp/Monitor/CommonMonitor.cs
index 4362086..c94bac3 100644
--- a/Assembly-CSharp/Monitor/CommonMonitor.cs
+++ b/Assembly-CSharp/Monitor/CommonMonitor.cs
@@ -203,7 +203,7 @@ public void SetTrackCountVisible(bool active)
public void SetTrackCount(uint currentTrackNum, uint maxTrackNum)
{
TrackColor trackColor = TrackColor.Blue;
- if (!GameManager.IsFreedomMode)
+ if (!GameManager.IsFreedomMode && !Singleton<SystemConfig>.Instance.config.IsInfiniteTrack)
{
_trackMaskImage.SetActive(value: false);
_trackCountText.ChangeText(currentTrackNum.ToString()); |
Sourcery 总结
新功能:
Original summary in English
Summary by Sourcery
New Features: