fix: DisplayTouchInGame 在maimoller中不工作#55
Merged
clansty merged 1 commit intoMuNET-OSS:mainfrom Sep 18, 2025
Merged
Conversation
审阅者指南 (在小型 PR 上折叠)审阅者指南此 PR 在 MouseTouchPanel.Start 上添加了一个空的 Harmony 后缀补丁,以解决 MonoMod/Maimoller 补丁问题,该问题会阻止原始 Start 方法被调用,从而确保触摸面板注册和预制件初始化无误地进行。 MouseTouchPanel.Start 的 Harmony 补丁类图classDiagram
class MouseTouchPanel {
+Start()
}
class DisplayTouchInGame {
+Workaround() // HarmonyPostfix on MouseTouchPanel.Start
}
MouseTouchPanel <|.. DisplayTouchInGame : "HarmonyPostfix Patch"
文件级更改
提示和命令与 Sourcery 交互
自定义您的体验访问您的 仪表板 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adds an empty Harmony postfix patch on MouseTouchPanel.Start to work around a MonoMod/Maimoller patch issue that prevents the original Start method from being invoked, ensuring the touch panel registration and prefab initialization proceed without errors. Class diagram for Harmony patch on MouseTouchPanel.StartclassDiagram
class MouseTouchPanel {
+Start()
}
class DisplayTouchInGame {
+Workaround() // HarmonyPostfix on MouseTouchPanel.Start
}
MouseTouchPanel <|.. DisplayTouchInGame : "HarmonyPostfix Patch"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
你好 - 我已审阅你的更改 - 以下是一些反馈:
- 与其依赖空的后缀来触发 MouseTouchPanel.Start,不如考虑使用 Harmony 的 PatchPriority 或 After 属性来确保原始的 Start 在 Maimoller 补丁之后运行。
- 在代码注释中添加清晰的 TODO 和对底层问题的引用,以便在确定根本原因后可以重新审视并删除此变通方法。
- 将变通方法的注释翻译成英文(或添加英文版本),以提高非中文贡献者的可访问性。
给 AI 代理的提示
请处理此代码审查中的评论:
## 总体评论
- 与其依赖空的后缀来触发 MouseTouchPanel.Start,不如考虑使用 Harmony 的 PatchPriority 或 After 属性来确保原始的 Start 在 Maimoller 补丁之后运行。
- 在代码注释中添加清晰的 TODO 和对底层问题的引用,以便在确定根本原因后可以重新审视并删除此变通方法。
- 将变通方法的注释翻译成英文(或添加英文版本),以提高非中文贡献者的可访问性。帮助我更有用!请点击 👍 或 👎 对每条评论进行评价,我将利用这些反馈来改进你的评论。
Original comment in English
Hey there - I've reviewed your changes - here's some feedback:
- Rather than relying on an empty postfix to trigger MouseTouchPanel.Start, consider using Harmony's PatchPriority or After attributes to ensure the original Start runs after the Maimoller patch.
- Add a clear TODO and reference to the underlying issue in the code comment so that the workaround can be revisited and removed when the root cause is identified.
- Translate the workaround comment into English (or add an English version) to improve accessibility for non-Chinese-speaking contributors.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Rather than relying on an empty postfix to trigger MouseTouchPanel.Start, consider using Harmony's PatchPriority or After attributes to ensure the original Start runs after the Maimoller patch.
- Add a clear TODO and reference to the underlying issue in the code comment so that the workaround can be revisited and removed when the root cause is identified.
- Translate the workaround comment into English (or add an English version) to improve accessibility for non-Chinese-speaking contributors.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
clansty
approved these changes
Sep 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
其实和这个是一模一样的情况...
https://github.com/MewoLab/AquaMai/blob/983f887be48d6c5c85a81460fa3c45d2d35c3852/AquaMai.Mods/GameSystem/TestProof.cs#L78-L87
MouseTouchPanel.Start不会调用,自然依赖于其的RegisterMouseTouchPanel钩子也不会调用,prefab就为null,导致log里报错
[DisplayTouchInGame] prefab is null实在是太玄学了......
Sourcery 总结
Bug 修复:
Original summary in English
Summary by Sourcery
Bug Fixes: