-
Notifications
You must be signed in to change notification settings - Fork 12
feat: 适配 MaaFW 5.1 #144
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
feat: 适配 MaaFW 5.1 #144
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's Guide将 MaaDebugger 运行时控制逻辑和 MaaFW 集成更新为使用 MaaFW 5.1 中新的 NodeAttr 类型来处理识别列表数据,而不是使用普通字符串,并相应更新类型标注以及所有消费列表元素的调用点。 MaaDebugger 运行时控制适配 MaaFW 5_1 中 NodeAttr 的类图classDiagram
class RuntimeControl {
+int row_len
+dict~int, ListData~ list_data_map
+void create_list(row, data)
+void on_next_list_starting(current, list_to_reco)
+void add_list_data(data)
+void create_items(index, name, row_len)
+void add_item_data(index, name, row_len)
}
class ListData {
+int row_len
+str current
+list~NodeAttr~ list_to_reco
}
class ItemData {
+int index
+str name
+int row_len
}
class NodeAttr {
+str name
+... other_attributes
}
class MaaFW {
+Screenshotter screenshotter
+void on_next_list_starting(current, list_to_reco)
}
class ContextEventSink {
}
RuntimeControl "1" o-- "*" ListData : manages
ListData "1" *-- "*" NodeAttr : list_to_reco
RuntimeControl "*" o-- "*" ItemData : creates
MaaFW ..> ContextEventSink : uses
ContextEventSink *-- NodeAttr : defines
MaaFW ..> NodeAttr : aliases
RuntimeControl ..> NodeAttr : consumes in lists
RuntimeControl ..> MaaFW : maafw_integration
MaaFW ..> ListData : passes_list_to_runtime_control
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience访问你的控制面板,可以:
Getting HelpOriginal review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideAdapts the MaaDebugger runtime control and MaaFW integration to use the new NodeAttr type from MaaFW 5.1 instead of plain strings when handling recognition list data, updating type hints and all relevant call sites that consume list elements. Class diagram for MaaDebugger runtime control adaptation to NodeAttr in MaaFW 5_1classDiagram
class RuntimeControl {
+int row_len
+dict~int, ListData~ list_data_map
+void create_list(row, data)
+void on_next_list_starting(current, list_to_reco)
+void add_list_data(data)
+void create_items(index, name, row_len)
+void add_item_data(index, name, row_len)
}
class ListData {
+int row_len
+str current
+list~NodeAttr~ list_to_reco
}
class ItemData {
+int index
+str name
+int row_len
}
class NodeAttr {
+str name
+... other_attributes
}
class MaaFW {
+Screenshotter screenshotter
+void on_next_list_starting(current, list_to_reco)
}
class ContextEventSink {
}
RuntimeControl "1" o-- "*" ListData : manages
ListData "1" *-- "*" NodeAttr : list_to_reco
RuntimeControl "*" o-- "*" ItemData : creates
MaaFW ..> ContextEventSink : uses
ContextEventSink *-- NodeAttr : defines
MaaFW ..> NodeAttr : aliases
RuntimeControl ..> NodeAttr : consumes in lists
RuntimeControl ..> MaaFW : maafw_integration
MaaFW ..> ListData : passes_list_to_runtime_control
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.
你好——我已经查看了你的改动,这里是一些反馈:
- 既然
list_to_reco现在保存的是NodeAttr对象,建议直接遍历其中的元素而不是通过索引遍历(例如for node in data.list_to_reco: name = node.name),这样可以简化create_list和add_list_data中的循环,并避免反复索引。 - 确保在
runtime_control.py中显式导入或引用NodeAttr(例如通过from ..maafw import NodeAttr),这样新的类型标注和属性访问在单独编译时也能正常工作。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- Now that `list_to_reco` holds `NodeAttr` objects, consider iterating directly over the items instead of by index (e.g. `for node in data.list_to_reco: name = node.name`), which simplifies the loops in `create_list` and `add_list_data` and avoids repeated indexing.
- Ensure `NodeAttr` is explicitly imported or referenced in `runtime_control.py` (e.g. via `from ..maafw import NodeAttr`) so the new type hints and attribute access compile correctly in isolation.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey there - I've reviewed your changes - here's some feedback:
- Now that
list_to_recoholdsNodeAttrobjects, consider iterating directly over the items instead of by index (e.g.for node in data.list_to_reco: name = node.name), which simplifies the loops increate_listandadd_list_dataand avoids repeated indexing. - Ensure
NodeAttris explicitly imported or referenced inruntime_control.py(e.g. viafrom ..maafw import NodeAttr) so the new type hints and attribute access compile correctly in isolation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that `list_to_reco` holds `NodeAttr` objects, consider iterating directly over the items instead of by index (e.g. `for node in data.list_to_reco: name = node.name`), which simplifies the loops in `create_list` and `add_list_data` and avoids repeated indexing.
- Ensure `NodeAttr` is explicitly imported or referenced in `runtime_control.py` (e.g. via `from ..maafw import NodeAttr`) so the new type hints and attribute access compile correctly in isolation.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
没测!(理直气壮
Summary by Sourcery
将 MaaDebugger 的运行时控制逻辑适配到更新后的 MaaFW 5.1 节点元数据类型,在识别列表中使用
NodeAttr对象替代纯字符串。增强内容:
NodeAttr的识别条目,同时在 UI 中仍然显示它们的名称。maafw包对外暴露ContextEventSink.NodeAttr,以便在整个调试器代码库中使用。Original summary in English
Summary by Sourcery
Adapt MaaDebugger runtime control to updated MaaFW 5.1 node metadata type, using NodeAttr objects instead of plain strings for recognition lists.
Enhancements: