Conversation
There was a problem hiding this comment.
嗨,我已经审查了你的修改,看起来非常棒!
帮我变得更有用吧!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的代码审查。
Original comment in English
Hey - I've reviewed your changes and they look great!
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.
Pull request overview
本 PR 主要针对 resource_fast 中的通用按钮流水线配置做结构化调整:将多个按钮的识别从“单节点多模板”改为“Or 组合 + 稳定/悬浮子节点”,并补充/调整部分按钮相关资源,以提升识别的适配性与可维护性。
Changes:
- 将多个按钮节点改为
Or(any_of: [稳定态, 悬浮态])的组合识别结构,并抽出对应的子识别节点。 - 调整
CloseRewardsButton的组合识别结构(新增box_index,拆分按钮稳定/悬浮识别)。 - 增补/更新按钮相关图片资源(含
resource_adb覆盖资源)。
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| assets/resource_fast/pipeline/Common/Button.json | 重构多类按钮识别为 Or 组合与子节点复用,调整部分按钮识别逻辑 |
| assets/resource_fast/image/Common/Button/CloseButtonType5.png | 按钮模板图片资源变更(但当前流水线未见引用,需确认用途) |
| assets/resource_adb/image/Common/Button/CloseRewardImage.png | 为 ADB 资源层新增/更新奖励界面检测图标模板 |
| @@ -365,26 +416,49 @@ | |||
| ] | |||
| } | |||
| }, | |||
| "__YellowConfigmButtonType1Icon": { | |||
| "recognition": { | |||
| "type": "Or", | |||
| "param": { | |||
| "any_of": [ | |||
| "__YellowConfigmButtonType1IconStable", | |||
| "__YellowConfigmButtonType1IconHover" | |||
| ] | |||
| } | |||
| } | |||
| }, | |||
| "__YellowConfigmButtonType1IconStable": { | |||
| "recognition": { | |||
| "type": "TemplateMatch", | |||
| "param": { | |||
| "roi": "YellowButtonBackground", | |||
| "template": [ | |||
| "Common/Button/YellowConfirmButtonType1.png" | |||
| ], | |||
| "threshold": 0.9 | |||
| } | |||
| } | |||
| }, | |||
| "__YellowConfigmButtonType1IconHover": { | |||
There was a problem hiding this comment.
__YellowConfigmButtonType1Icon/__YellowConfigmButtonType1IconStable/__YellowConfigmButtonType1IconHover 中的 Configm 看起来是拼写错误(应为 Confirm)。建议统一更正节点名并同步更新 YellowConfirmButtonType1 的引用,避免后续维护时误解。
| } | ||
| }, | ||
| "__CloseRewardsButton": { | ||
| "desc": "关闭奖励界面按钮,位于界面中部偏下,无文字,对号标志 仅", |
There was a problem hiding this comment.
__CloseRewardsButton 的 desc 以“仅”结尾,描述不完整(疑似想表达“仅用于组合识别”等)。建议补全或删除多余文字,避免误导。
| "desc": "关闭奖励界面按钮,位于界面中部偏下,无文字,对号标志 仅", | |
| "desc": "关闭奖励界面按钮,位于界面中部偏下,无文字,对号标志,仅用于组合识别", |
| @@ -635,6 +1043,18 @@ | |||
| ] | |||
| } | |||
| }, | |||
| "__CloseRewardsButton": { | |||
| "desc": "关闭奖励界面按钮,位于界面中部偏下,无文字,对号标志 仅", | |||
| "recognition": { | |||
| "type": "Or", | |||
| "param": { | |||
| "any_of": [ | |||
| "__CloseRewardsButtonStable", | |||
| "__CloseRewardsButtonHover" | |||
| ] | |||
| } | |||
| } | |||
| }, | |||
| "DectedCloseRewardsImage": { | |||
| "desc": "检测到奖励界面时的图标", | |||
| "recognition": { | |||
There was a problem hiding this comment.
节点名 DectedCloseRewardsImage 疑似拼写错误(应为 DetectedCloseRewardsImage)。当前该名称只在本文件内使用,建议更正节点名并同步更新 CloseRewardsButton 的 all_of 引用,提升可读性并避免后续复制粘贴继续扩散该拼写。
| @@ -533,35 +717,123 @@ | |||
| ] | |||
| } | |||
| }, | |||
| "WhiteConfirmButtonType2": { | |||
| "desc": "通用确认按钮,有文字,白色底,对号形标志", | |||
| "__WhiteConfirmButtonType1": { | |||
| "desc": "通用确认按钮,有文字,白色底,圆环形标志仅用于组合识别", | |||
| "recognition": { | |||
| "type": "And", | |||
| "param": { | |||
| "all_of": [ | |||
| "WhiteButtonBackground", | |||
| { | |||
| "recognition": { | |||
| "type": "TemplateMatch", | |||
| "param": { | |||
| "roi": "WhiteButtonBackground", | |||
| "roi_offset": [ | |||
| -20, | |||
| -20, | |||
| 60, | |||
| 40 | |||
| ], | |||
| "template": [ | |||
| "Common/Button/WhiteConfirmButtonType2.png", | |||
| "Common/Button/WhiteConfirmButtonType2Hover.png" | |||
| ], | |||
| "threshold": 0.9 | |||
| } | |||
| } | |||
| } | |||
| "__WhiteConfirmButtonType1Icon" | |||
| ], | |||
| "box_index": 1 | |||
| } | |||
| } | |||
| }, | |||
| "__WhiteConfirmButtonType1commonSearchAreas1": { | |||
| "desc": "通用确认按钮,有文字,白色底,圆环形标志仅用于组合识别", | |||
| "recognition": { | |||
| "type": "Or", | |||
| "param": { | |||
| "any_of": [ | |||
| "__WhiteConfirmButtonType1commonSearchAreas1Stable", | |||
| "__WhiteConfirmButtonType1commonSearchAreas1Hover" | |||
| ] | |||
| } | |||
| } | |||
| }, | |||
| "__WhiteConfirmButtonType1commonSearchAreas1Stable": { | |||
| "desc": "通用确认按钮,有文字,白色底,圆环形标志仅用于组合识别", | |||
| "recognition": { | |||
| "type": "TemplateMatch", | |||
| "param": { | |||
| "roi": [ | |||
| 672, | |||
| 416, | |||
| 608, | |||
| 304 | |||
| ], | |||
| "template": "Common/Button/WhiteConfirmButtonType1.png", | |||
| "threshold": 0.9 | |||
| } | |||
| } | |||
| }, | |||
| "__WhiteConfirmButtonType1commonSearchAreas1Hover": { | |||
| "desc": "通用确认按钮,有文字,白色底,圆环形标志仅用于组合识别", | |||
| "recognition": { | |||
There was a problem hiding this comment.
__WhiteConfirmButtonType1commonSearchAreas1(以及 stable/hover 子节点)中的 commonSearchAreas1 命名风格与本文件其他 __XxxYyy(PascalCase)不一致,且可读性较差。建议统一为 PascalCase(例如 __WhiteConfirmButtonType1CommonSearchArea1*)并同步更新引用,降低维护成本。
| "CloseButtonType1": { | ||
| "desc": "通用退出按钮,位于界面右上角的X,不兼容ESC菜单", | ||
| "recognition": { | ||
| "type": "TemplateMatch", | ||
| "type": "Or", | ||
| "param": { | ||
| "roi": [ | ||
| 882, | ||
| 0, | ||
| 398, | ||
| 335 | ||
| ], | ||
| "template": [ | ||
| "Common/Button/CloseButtonType1.png", | ||
| "Common/Button/CloseButtonType2.png", | ||
| "Common/Button/CloseButtonType3.png", | ||
| "Common/Button/CloseButtonType4.png", | ||
| "Common/Button/CloseButtonType5.png" | ||
| ], | ||
| "threshold": 0.9 | ||
| "any_of": [ | ||
| "__CloseButtonType1", | ||
| "__CloseButtonType2", | ||
| "__CloseButtonType3", | ||
| "__CloseButtonType4" | ||
| ] |
There was a problem hiding this comment.
CloseButtonType1 现在只在 any_of 中包含 __CloseButtonType1~__CloseButtonType4,但本 PR 里也包含了 CloseButtonType5.png 资源。若 Type5 仍对应实际界面按钮,这里会导致识别覆盖回退/缺失;若已不再需要,建议删除/回收该资源并在配置中注明原因,避免“资源存在但永远不会被引用”。
Summary by Sourcery
增强功能:
Original summary in English
Summary by Sourcery
Enhancements:
Original summary in English
Summary by Sourcery
增强功能:
Original summary in English
Summary by Sourcery
Enhancements: