Skip to content

Merge:'fix/patch0513'| 0514的01质量更新#281

Closed
sunyink wants to merge 19 commits into
mainfrom
develop
Closed

Merge:'fix/patch0513'| 0514的01质量更新#281
sunyink wants to merge 19 commits into
mainfrom
develop

Conversation

@sunyink
Copy link
Copy Markdown
Owner

@sunyink sunyink commented May 14, 2026

Summary by Sourcery

将全局 UI 识别流水线重构为可复用节点,扩展首页、沙盒、加载界面、滑块和 OCR 状态的视觉检测能力,并更新配置的 OCR 模型版本。

New Features:

  • 为首页抽卡文本和背景颜色、沙盒固定/运行按钮、第三个固定状态、筛选下拉高亮,以及多种加载界面变体添加专用识别节点。
  • 引入用于滑块开关和 OCR 按钮的辅助颜色检测节点,以区分启用、禁用和高亮状态。
  • 在共享 UI 资源中新增一种返回按钮模板图片,并通过 .gitignore 忽略 PC 机型相关资源。

Enhancements:

  • 在全局导航和重置流程中复用通用识别辅助模块(例如返回按钮中枢、快捷购物车菜单重置、首页和沙盒检测器、加载界面识别器),以简化流水线定义。
  • 在更清晰的 Anc/Sub 命名规范下重命名并重组滑块开关和 OCR 颜色检查节点,从而更好地区分可复用锚点与场景特定检查。

Build:

  • 将 OCR 资源配置从 ppocr_v4 模型目录切换为 ppocr_v5
Original summary in English

Summary by Sourcery

Refactor global UI recognition pipelines into reusable nodes, extend visual detectors for homepage, sandbox, loading, sliders and OCR state, and update the configured OCR model version.

New Features:

  • Add dedicated recognition nodes for homepage gacha text and background color, sandbox pin/run buttons, third pin state, sieve dropdown highlight, and multiple loading screen variants.
  • Introduce ancillary color-detection nodes for slider switches and OCR buttons to distinguish enabled, disabled, and highlighted states.
  • Add support for an additional back-button template image in the shared UI assets and ignore PC model assets via .gitignore.

Enhancements:

  • Reuse common recognition helpers (e.g., back-button hub, quick-cart menu reset, homepage and sandbox detectors, loading screen recognizers) across global navigation and reset flows to simplify pipeline definitions.
  • Rename and reorganize slider-switch and OCR color-check nodes under a clearer Anc/Sub naming scheme to better separate reusable anchors from scenario-specific checks.

Build:

  • Switch the OCR asset configuration from the ppocr_v4 model directory to ppocr_v5.

Summary by CodeRabbit

  • 优化

    • 优化了多个游戏流程的界面识别和自动化判定逻辑,提高了识别的准确性和流程的稳定性。
  • 改进

    • 简化和整合了重复的识别配置,使自动化流程更加高效可靠。

Review Change Stack

sunyink and others added 19 commits May 9, 2026 18:36
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
(cherry picked from commit 38f058c)
命名规则:
- Rec,可单独使用的识别.
- Anc,需要先设定锚点.多用于二步走.
- Sub,不能纯Sub使用,必须搭配Rec.
(cherry picked from commit 1f5081b)
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 14, 2026

Reviewer's Guide

重构了多个全局导航与识别流水线以复用新的共享识别节点,引入更加模块化的滑块和 OCR 颜色检测方案,增加显式的加载与沙盒识别辅助节点,并将 OCR 模型路径从 ppocr_v4 更新为 ppocr_v5,同时对部分资源与 ignore 文件进行了小幅调整。

Global.json 中共享导航识别节点的流程图

flowchart TD
    subgraph HomePageRecognition
        Global_ResetHomePage_Start[Global_ResetHomePage_Start]
        Global_ResetHomePage_End[Global_ResetHomePage_End]
        Global_ToSandBox2_HomeSelect[Global_ToSandBox2_HomeSelect]
        Rec_HomePage_GA_Ocr[Rec_HomePage_GA_Ocr]
        Rec_HomePage_GA_Clr[Rec_HomePage_GA_Clr]
        Sub_HomePage_GA_Bright_Clr[Sub_HomePage_GA_Bright_Clr]
    end

    subgraph BackButtonHub
        Global_ToHomePage_Reset[Global_ToHomePage_Reset]
        Global_ToSandBox_Reset[Global_ToSandBox_Reset]
        Global_BackPageHub_Once[Global_BackPageHub_Once]
    end

    subgraph SandBoxRecognition
        Global_ToSandBox_Enter[Global_ToSandBox_Enter]
        Global_BackToPve2_FinBackMapPage[Global_BackToPve2#_FinBackMapPage]
        Global_BackToQC1_Fin[Global_BackToQC1_Fin]
        Rec_SandBox_Pin_Tpl[Rec_SandBox_Pin_Tpl]
        Rec_SandBox_Run_Tpl[Rec_SandBox_Run_Tpl]
        Rec_SandBox_Pin3_Tpl[Rec_SandBox_Pin3_Tpl]
        Sub_SandBox_Pin3_Bright_Clr[Sub_SandBox_Pin3_Bright_Clr]
    end

    subgraph LoadingRecognition
        Global_WaitingForLoading[Global_WaitingForLoading]
        Rec_Wait_01[Rec_「Global_WaitingForLoading」_01]
        Rec_Wait_02[Rec_「Global_WaitingForLoading」_02]
        Rec_Wait_03[Rec_「Global_WaitingForLoading」_03]
        Rec_Wait_04[Rec_「Global_WaitingForLoading」_04]
        Rec_Wait_05[Rec_「Global_WaitingForLoading」_05]
        Rec_Wait_06[Rec_「Global_WaitingForLoading」_06]
    end

    %% Home page uses shared OCR + color
    Global_ResetHomePage_Start --> Rec_HomePage_GA_Ocr
    Global_ResetHomePage_Start --> Rec_HomePage_GA_Clr
    Global_ResetHomePage_End --> Rec_HomePage_GA_Ocr
    Global_ResetHomePage_End --> Rec_HomePage_GA_Clr
    Global_ToSandBox2_HomeSelect --> Rec_HomePage_GA_Ocr
    Global_ToSandBox2_HomeSelect --> Rec_HomePage_GA_Clr
    Sub_HomePage_GA_Bright_Clr --> Rec_HomePage_GA_Ocr

    %% Back button hub reused across resets
    Global_ToHomePage_Reset --> Global_BackPageHub_Once
    Global_ToSandBox_Reset --> Global_BackPageHub_Once

    %% Sandbox navigation reuses shared pin/run recognizers
    Global_ToSandBox_Enter --> Rec_SandBox_Pin_Tpl
    Global_ToSandBox_Enter --> Rec_SandBox_Run_Tpl
    Global_BackToPve2_FinBackMapPage --> Rec_SandBox_Pin_Tpl
    Global_BackToPve2_FinBackMapPage --> Rec_SandBox_Run_Tpl
    Global_BackToQC1_Fin --> Rec_SandBox_Pin_Tpl
    Global_BackToQC1_Fin --> Rec_SandBox_Run_Tpl
    Sub_SandBox_Pin3_Bright_Clr --> Rec_SandBox_Pin3_Tpl

    %% Loading wait uses six helper recognizers
    Global_WaitingForLoading --> Rec_Wait_01
    Global_WaitingForLoading --> Rec_Wait_02
    Global_WaitingForLoading --> Rec_Wait_03
    Global_WaitingForLoading --> Rec_Wait_04
    Global_WaitingForLoading --> Rec_Wait_05
    Global_WaitingForLoading --> Rec_Wait_06
Loading

模块化滑块与 OCR 颜色检测的流程图

flowchart TD
    subgraph SliderSwitch
        Anc_SliderSwitch_GryOff_Clr[Anc_SliderSwitch_GryOff_Clr]
        Anc_SliderSwitch_YewOn_Clr[Anc_SliderSwitch_YewOn_Clr]
        Anc_SliderSwitch_Gry_TurnOn_Clr[Anc_SliderSwitch_Gry_TurnOn_Clr]
        Anc_SliderSwitch_Yew_TurnOff_Clr[Anc_SliderSwitch_Yew_TurnOff_Clr]
        Anc_SliderSwitch_Act_Turn[Anc_SliderSwitch_Act_Turn]
        Global_SliderSwitch_End[Global_SliderSwitch_End]
    end

    subgraph OcrButtonAnchors
        Anc_Ocr_Enable_Clr[Anc_Ocr_Enable_Clr]
        Anc_Ocr_Unable_Clr[Anc_Ocr_Unable_Clr]
    end

    subgraph OcrButtonSubs
        Sub_Ocr_Enable_Clr[Sub_Ocr_Enable_Clr]
        Sub_Ocr_Unable_Clr[Sub_Ocr_Unable_Clr]
    end

    %% Slider logic: detect state, click, re-check
    Anc_SliderSwitch_Gry_TurnOn_Clr --> Anc_SliderSwitch_GryOff_Clr
    Anc_SliderSwitch_Gry_TurnOn_Clr --> Anc_SliderSwitch_Act_Turn
    Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_YewOn_Clr
    Anc_SliderSwitch_Yew_TurnOff_Clr --> Anc_SliderSwitch_YewOn_Clr
    Anc_SliderSwitch_Yew_TurnOff_Clr --> Anc_SliderSwitch_Act_Turn
    Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_GryOff_Clr
    Anc_SliderSwitch_GryOff_Clr --> Global_SliderSwitch_End
    Anc_SliderSwitch_YewOn_Clr --> Global_SliderSwitch_End

    %% OCR button color checks: anchor vs sub nodes
    Anc_Ocr_Enable_Clr --> Sub_Ocr_Enable_Clr
    Anc_Ocr_Unable_Clr --> Sub_Ocr_Unable_Clr
Loading

文件级变更

Change Details Files
重构主页、沙盒、快速购物车以及返回导航步骤,以复用共享识别子节点,而不是在各处内联 TemplateMatch/OCR/ColorMatch 定义。
  • 将主页的内联 OCR + ColorMatch 检查替换为在多个全局重置与导航节点中引用 Rec_HomePage_GA_Ocr 和 Rec_HomePage_GA_Clr。
  • 将重复的 pin/run TemplateMatch 逻辑替换为共享的 Rec_SandBox_Pin_Tpl 和 Rec_SandBox_Run_Tpl 节点,用于沙盒相关流程(进入沙盒、完成返回地图,以及 QC 重置完成)。
  • 将 Global_ToHomePage_Reset 和 Global_ToSandBox_Reset 从直接使用返回按钮 TemplateMatch 逻辑,改为通过 And 识别委托给 Global_BackPageHub_Once,从而集中处理返回按钮。
  • 将 Global_BackToQC1 更新为通过 And 识别使用 Global_QuickCart_MenuReset,而不是直接模板匹配,从而统一快速购物车菜单识别逻辑。
  • 引入统一的 Global_WaitingForLoading 节点,使其委托给 6 个专门的 Rec_「Global_WaitingForLoading」_* 识别节点,而不是在单处内联所有识别方式。
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Arbitrage.json
assets/resource/base/pipeline/AutoBattle.json
assets/resource/base/pipeline/Battle.json
assets/resource/base/pipeline/Collect_TeleportRecall.json
assets/resource/base/pipeline/Collect_skills.json
assets/resource/base/pipeline/Daily.json
assets/resource/base/pipeline/Equip.json
assets/resource/base/pipeline/EventBattle.json
assets/resource/base/pipeline/GACHA.json
assets/resource/base/pipeline/GACHA_ADV.json
assets/resource/base/pipeline/Mail.json
assets/resource/base/pipeline/PVP.json
assets/resource/base/pipeline/Pass.json
assets/resource/base/pipeline/QuestList.json
assets/resource/base/pipeline/Redemption.json
assets/resource/base/pipeline/SemiAuto.json
assets/resource/base/pipeline/Setup.json
assets/resource/base/pipeline/StartGame.json
assets/resource/base/pipeline/Weekly.json
为加载界面、滑块、OCR 按钮、主页抽卡入口、沙盒 pin 选择以及筛选下拉高亮引入专用的识别与颜色检测辅助节点,使各流水线更加模块化和可复用。
  • 新增 Rec_「Global_WaitingForLoading」01~06 节点,分别检测不同的加载 UI 元素(UT 图标、进度圆圈、中心名称、0% 文本、暗色与亮色的全宽进度条)。
  • 将滑块开关处理拆分为 Anc_SliderSwitch_YewOn_Clr 和 Anc_SliderSwitch_GryOff_Clr 状态检测节点,以及 Anc_SliderSwitch_Gry_TurnOn_Clr、Anc_SliderSwitch_Yew_TurnOff_Clr 和 Anc_SliderSwitch_Act_Turn 动作/状态切换节点,用以替代之前的 Global_SliderSwitch* 节点。
  • 新增 Anc_Ocr_Enable_Clr/Anc_Ocr_Unable_Clr 和 Sub_Ocr_Enable_Clr/Sub_Ocr_Unable_Clr,用锚点与直接 ROI 颜色检查相结合来区分启用与禁用的 OCR 按钮背景。
  • 引入 Rec_HomePage_GA_Ocr、Rec_HomePage_GA_Clr 和 Sub_HomePage_GA_Bright_Clr,通过文本加背景颜色与高亮状态,稳健识别主页抽卡入口。
  • 新增 Rec_SandBox_Pin_Tpl、Rec_SandBox_Run_Tpl、Rec_SandBox_Pin3_Tpl 以及 Sub_SandBox_Pin3_Bright_Clr,用于识别沙盒 pin/run 按钮以及高亮的第三个 pin 变体。
  • 新增 Sub_SieveExpand_Yew_Clr,用于检测下拉筛选菜单中被黄色高亮的 OCR 文本,从而实现依赖 UI 状态的行为。
assets/resource/base/pipeline/Global.json
更新 OCR 模型配置以使用 ppocr_v5 资源目录。
  • 在 configure_ocr_model 中将 ppocr_dir 从 ppocr_v4 修改为 ppocr_v5,使 det/cls/rec 模型从新的版本目录加载。
configure.py
调整用于 PC OCR 模型的 gitignore 和模型资源结构。
  • 在 assets/resource/PC/model 下添加 .gitignore 文件,用于控制 PC 端专用模型中哪些生成或下载的文件需要纳入版本控制。
  • 更新根目录 .gitignore 以涵盖新的 PC 模型目录及/或相关产物(具体匹配模式以 diff 为准)。
.gitignore
assets/resource/PC/model/.gitignore

Tips and commands

Interacting with Sourcery

  • 触发新的代码审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub Issue: 在评论中请求 Sourcery 根据该评论创建 issue。你也可以在审查评论下回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 pull request 标题: 在 PR 标题中任意位置写上 @sourcery-ai,即可随时生成标题。也可以在 PR 中评论 @sourcery-ai title 以(重新)生成标题。
  • 生成 pull request 总结: 在 PR 正文任意位置写上 @sourcery-ai summary,即可在该位置生成 PR 总结。也可以在 PR 中评论 @sourcery-ai summary 以在任意时间(重新)生成总结。
  • 生成 Reviewer's Guide: 在 pull request 中评论 @sourcery-ai guide,即可在任意时间(重新)生成审查指南。
  • 一次性解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可将所有 Sourcery 评论标记为已解决。适用于你已经处理完全部评论且不希望它们继续显示的情况。
  • 一次性取消所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,即可取消所有现有的 Sourcery 审查。特别适合想从头开始新的审查时使用——记得之后评论 @sourcery-ai review 来触发新的审查!

Customizing Your Experience

访问你的 dashboard 以:

  • 启用或禁用例如 Sourcery 自动生成 PR 总结、审查指南等审查功能。
  • 修改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查相关设置。

Getting Help

Original review guide in English

Reviewer's Guide

Refactors several global navigation and recognition pipelines to reuse new shared recognition nodes, introduces a more modular slider and OCR color-detection scheme, adds explicit loading and sandbox recognition helpers, and updates the OCR model path from ppocr_v4 to ppocr_v5 while adding minor asset and ignore-file adjustments.

Flow diagram for shared navigation recognition nodes in Global.json

flowchart TD
    subgraph HomePageRecognition
        Global_ResetHomePage_Start[Global_ResetHomePage_Start]
        Global_ResetHomePage_End[Global_ResetHomePage_End]
        Global_ToSandBox2_HomeSelect[Global_ToSandBox2_HomeSelect]
        Rec_HomePage_GA_Ocr[Rec_HomePage_GA_Ocr]
        Rec_HomePage_GA_Clr[Rec_HomePage_GA_Clr]
        Sub_HomePage_GA_Bright_Clr[Sub_HomePage_GA_Bright_Clr]
    end

    subgraph BackButtonHub
        Global_ToHomePage_Reset[Global_ToHomePage_Reset]
        Global_ToSandBox_Reset[Global_ToSandBox_Reset]
        Global_BackPageHub_Once[Global_BackPageHub_Once]
    end

    subgraph SandBoxRecognition
        Global_ToSandBox_Enter[Global_ToSandBox_Enter]
        Global_BackToPve2_FinBackMapPage[Global_BackToPve2#_FinBackMapPage]
        Global_BackToQC1_Fin[Global_BackToQC1_Fin]
        Rec_SandBox_Pin_Tpl[Rec_SandBox_Pin_Tpl]
        Rec_SandBox_Run_Tpl[Rec_SandBox_Run_Tpl]
        Rec_SandBox_Pin3_Tpl[Rec_SandBox_Pin3_Tpl]
        Sub_SandBox_Pin3_Bright_Clr[Sub_SandBox_Pin3_Bright_Clr]
    end

    subgraph LoadingRecognition
        Global_WaitingForLoading[Global_WaitingForLoading]
        Rec_Wait_01[Rec_「Global_WaitingForLoading」_01]
        Rec_Wait_02[Rec_「Global_WaitingForLoading」_02]
        Rec_Wait_03[Rec_「Global_WaitingForLoading」_03]
        Rec_Wait_04[Rec_「Global_WaitingForLoading」_04]
        Rec_Wait_05[Rec_「Global_WaitingForLoading」_05]
        Rec_Wait_06[Rec_「Global_WaitingForLoading」_06]
    end

    %% Home page uses shared OCR + color
    Global_ResetHomePage_Start --> Rec_HomePage_GA_Ocr
    Global_ResetHomePage_Start --> Rec_HomePage_GA_Clr
    Global_ResetHomePage_End --> Rec_HomePage_GA_Ocr
    Global_ResetHomePage_End --> Rec_HomePage_GA_Clr
    Global_ToSandBox2_HomeSelect --> Rec_HomePage_GA_Ocr
    Global_ToSandBox2_HomeSelect --> Rec_HomePage_GA_Clr
    Sub_HomePage_GA_Bright_Clr --> Rec_HomePage_GA_Ocr

    %% Back button hub reused across resets
    Global_ToHomePage_Reset --> Global_BackPageHub_Once
    Global_ToSandBox_Reset --> Global_BackPageHub_Once

    %% Sandbox navigation reuses shared pin/run recognizers
    Global_ToSandBox_Enter --> Rec_SandBox_Pin_Tpl
    Global_ToSandBox_Enter --> Rec_SandBox_Run_Tpl
    Global_BackToPve2_FinBackMapPage --> Rec_SandBox_Pin_Tpl
    Global_BackToPve2_FinBackMapPage --> Rec_SandBox_Run_Tpl
    Global_BackToQC1_Fin --> Rec_SandBox_Pin_Tpl
    Global_BackToQC1_Fin --> Rec_SandBox_Run_Tpl
    Sub_SandBox_Pin3_Bright_Clr --> Rec_SandBox_Pin3_Tpl

    %% Loading wait uses six helper recognizers
    Global_WaitingForLoading --> Rec_Wait_01
    Global_WaitingForLoading --> Rec_Wait_02
    Global_WaitingForLoading --> Rec_Wait_03
    Global_WaitingForLoading --> Rec_Wait_04
    Global_WaitingForLoading --> Rec_Wait_05
    Global_WaitingForLoading --> Rec_Wait_06
Loading

Flow diagram for modular slider and OCR color detection

flowchart TD
    subgraph SliderSwitch
        Anc_SliderSwitch_GryOff_Clr[Anc_SliderSwitch_GryOff_Clr]
        Anc_SliderSwitch_YewOn_Clr[Anc_SliderSwitch_YewOn_Clr]
        Anc_SliderSwitch_Gry_TurnOn_Clr[Anc_SliderSwitch_Gry_TurnOn_Clr]
        Anc_SliderSwitch_Yew_TurnOff_Clr[Anc_SliderSwitch_Yew_TurnOff_Clr]
        Anc_SliderSwitch_Act_Turn[Anc_SliderSwitch_Act_Turn]
        Global_SliderSwitch_End[Global_SliderSwitch_End]
    end

    subgraph OcrButtonAnchors
        Anc_Ocr_Enable_Clr[Anc_Ocr_Enable_Clr]
        Anc_Ocr_Unable_Clr[Anc_Ocr_Unable_Clr]
    end

    subgraph OcrButtonSubs
        Sub_Ocr_Enable_Clr[Sub_Ocr_Enable_Clr]
        Sub_Ocr_Unable_Clr[Sub_Ocr_Unable_Clr]
    end

    %% Slider logic: detect state, click, re-check
    Anc_SliderSwitch_Gry_TurnOn_Clr --> Anc_SliderSwitch_GryOff_Clr
    Anc_SliderSwitch_Gry_TurnOn_Clr --> Anc_SliderSwitch_Act_Turn
    Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_YewOn_Clr
    Anc_SliderSwitch_Yew_TurnOff_Clr --> Anc_SliderSwitch_YewOn_Clr
    Anc_SliderSwitch_Yew_TurnOff_Clr --> Anc_SliderSwitch_Act_Turn
    Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_GryOff_Clr
    Anc_SliderSwitch_GryOff_Clr --> Global_SliderSwitch_End
    Anc_SliderSwitch_YewOn_Clr --> Global_SliderSwitch_End

    %% OCR button color checks: anchor vs sub nodes
    Anc_Ocr_Enable_Clr --> Sub_Ocr_Enable_Clr
    Anc_Ocr_Unable_Clr --> Sub_Ocr_Unable_Clr
Loading

File-Level Changes

Change Details Files
Refactor home page, sandbox, quick cart, and back-navigation steps to reuse shared recognition sub-nodes instead of inlined TemplateMatch/OCR/ColorMatch definitions.
  • Replace inlined OCR+ColorMatch checks for the home screen with references to Rec_HomePage_GA_Ocr and Rec_HomePage_GA_Clr in multiple global reset and navigation nodes.
  • Replace duplicated pin/run TemplateMatch blocks with shared Rec_SandBox_Pin_Tpl and Rec_SandBox_Run_Tpl nodes for sandbox-related flows (entering sandbox, finishing back-to-map, and QC reset completion).
  • Change Global_ToHomePage_Reset and Global_ToSandBox_Reset from direct TemplateMatch back-button logic to an And recognition that delegates to Global_BackPageHub_Once, centralizing back-button handling.
  • Update Global_BackToQC1 to use Global_QuickCart_MenuReset via an And recognition instead of a direct template, consolidating quick-cart menu recognition.
  • Introduce a consolidated Global_WaitingForLoading node that now delegates to six specialized Rec_「Global_WaitingForLoading」_* recognizers instead of embedding all recognition methods inline.
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Arbitrage.json
assets/resource/base/pipeline/AutoBattle.json
assets/resource/base/pipeline/Battle.json
assets/resource/base/pipeline/Collect_TeleportRecall.json
assets/resource/base/pipeline/Collect_skills.json
assets/resource/base/pipeline/Daily.json
assets/resource/base/pipeline/Equip.json
assets/resource/base/pipeline/EventBattle.json
assets/resource/base/pipeline/GACHA.json
assets/resource/base/pipeline/GACHA_ADV.json
assets/resource/base/pipeline/Mail.json
assets/resource/base/pipeline/PVP.json
assets/resource/base/pipeline/Pass.json
assets/resource/base/pipeline/QuestList.json
assets/resource/base/pipeline/Redemption.json
assets/resource/base/pipeline/SemiAuto.json
assets/resource/base/pipeline/Setup.json
assets/resource/base/pipeline/StartGame.json
assets/resource/base/pipeline/Weekly.json
Introduce dedicated recognition and color-detection helper nodes for loading screens, sliders, OCR buttons, home page gacha, sandbox pin selection, and sieve dropdown highlighting to make pipelines more modular and reusable.
  • Add Rec_「Global_WaitingForLoading」01~06 nodes that individually detect different loading UI elements (UT icon, progress circle, center name, 0% text, dark and bright full-width bars).
  • Split slider switch handling into Anc_SliderSwitch_YewOn_Clr and Anc_SliderSwitch_GryOff_Clr state detectors, plus Anc_SliderSwitch_Gry_TurnOn_Clr, Anc_SliderSwitch_Yew_TurnOff_Clr, and Anc_SliderSwitch_Act_Turn action/transition nodes, replacing the previous Global_SliderSwitch* nodes.
  • Add Anc_Ocr_Enable_Clr/Anc_Ocr_Unable_Clr and Sub_Ocr_Enable_Clr/Sub_Ocr_Unable_Clr to distinguish enabled vs disabled OCR button backgrounds using both anchor-based and direct ROI color checks.
  • Introduce Rec_HomePage_GA_Ocr, Rec_HomePage_GA_Clr and Sub_HomePage_GA_Bright_Clr to robustly identify the home-page gacha entry via text plus background color and highlight state.
  • Add Rec_SandBox_Pin_Tpl, Rec_SandBox_Run_Tpl, Rec_SandBox_Pin3_Tpl and Sub_SandBox_Pin3_Bright_Clr to recognize sandbox pin/run buttons and a highlighted third pin variant.
  • Add Sub_SieveExpand_Yew_Clr to detect yellow-highlighted OCR text in dropdown sieve menus, enabling UI-state dependent behavior.
assets/resource/base/pipeline/Global.json
Update OCR model configuration to use the ppocr_v5 asset directory.
  • Change the ppocr_dir in configure_ocr_model from ppocr_v4 to ppocr_v5 so that det/cls/rec models are loaded from the new versioned directory.
configure.py
Adjust gitignore and model asset structure for PC OCR models.
  • Add a .gitignore file under assets/resource/PC/model to control which generated or downloaded model files are tracked for PC-specific models.
  • Update the root .gitignore to account for the new PC model directory and/or related artifacts (exact patterns to be confirmed in the diff).
.gitignore
assets/resource/PC/model/.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sunyink sunyink closed this May 14, 2026
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了两个问题,并留下了一些总体反馈:

  • 有几个节点 ID 被重命名或替换(例如 Global_SliderSwitch_*Anc_SliderSwitch_*Global_Main_ClrAnc_Ocr_*/Sub_Ocr_*);请仔细检查其他流水线 JSON 中对这些节点的所有引用是否都已更新为新名称,以避免运行时查找失败。
  • OCR 模型路径从 ppocr_v4 修改为 ppocr_v5 是在 configure_ocr_model 里写死的;建议从单一常量或配置项中派生版本号,这样以后升级只需要改一个地方。
给 AI 代理的提示词
Please address the comments from this code review:

## Overall Comments
- Several node IDs were renamed or replaced (e.g. `Global_SliderSwitch_*``Anc_SliderSwitch_*`, `Global_Main_Clr``Anc_Ocr_*`/`Sub_Ocr_*`); double-check that all references in other pipeline JSONs have been updated to the new names to avoid runtime lookup failures.
- The OCR model path change from `ppocr_v4` to `ppocr_v5` is hard-coded in `configure_ocr_model`; consider deriving the version from a single constant or configuration value so future upgrades only need to touch one place.

## Individual Comments

### Comment 1
<location path="assets/resource/base/pipeline/Global.json" line_range="398" />
<code_context>
     },
     "Global_BackToQC1_Fin": {
         "desc": "找到图钉-点击返回主页",
-        "recognition": "TemplateMatch",
</code_context>
<issue_to_address>
**issue (bug_risk):** The finish node for QC1 no longer performs a click despite the description saying it should.

This node used to `TemplateMatch` on `pin.png` with `action: "Click"` and a fixed `target`, but now only does an `Or` over `Rec_SandBox_Pin_Tpl` and `Rec_SandBox_Run_Tpl` with no `action` or `target`. Unless the click was intentionally moved, this likely drops the "click to return home" behavior implied by the description. Either restore the click/target here or point to a subnode that performs the click; if it was moved, please update the description accordingly.
</issue_to_address>

### Comment 2
<location path="assets/resource/base/pipeline/Global.json" line_range="643-645" />
<code_context>
     },
-    "Global_Main_Clr": {
-        "desc": "【被引用节点】主界面是否无二级浮窗遮蔽",
+    "Anc_Ocr_Enable_Clr": {
+        "desc": "[识别]]对Ocr节点按钮再次色核,亮色",
         "recognition": "ColorMatch",
-        "roi": "Main_OCR",
</code_context>
<issue_to_address>
**nitpick (typo):** Small typo in the description string with a double closing bracket.

The `desc` string currently reads `"[识别]]对Ocr节点按钮再次色核,亮色"` with a double `]`. Please update to a single closing bracket to align with the other descriptions if this is user- or log-facing text.

```suggestion
    "Anc_Ocr_Enable_Clr": {
        "desc": "[识别]对Ocr节点按钮再次色核,亮色",
        "recognition": "ColorMatch",
```
</issue_to_address>

Sourcery 对开源项目是免费的——如果你觉得我们的 Review 有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进 Review 质量。
Original comment in English

Hey - I've found 2 issues, and left some high level feedback:

  • Several node IDs were renamed or replaced (e.g. Global_SliderSwitch_*Anc_SliderSwitch_*, Global_Main_ClrAnc_Ocr_*/Sub_Ocr_*); double-check that all references in other pipeline JSONs have been updated to the new names to avoid runtime lookup failures.
  • The OCR model path change from ppocr_v4 to ppocr_v5 is hard-coded in configure_ocr_model; consider deriving the version from a single constant or configuration value so future upgrades only need to touch one place.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several node IDs were renamed or replaced (e.g. `Global_SliderSwitch_*``Anc_SliderSwitch_*`, `Global_Main_Clr``Anc_Ocr_*`/`Sub_Ocr_*`); double-check that all references in other pipeline JSONs have been updated to the new names to avoid runtime lookup failures.
- The OCR model path change from `ppocr_v4` to `ppocr_v5` is hard-coded in `configure_ocr_model`; consider deriving the version from a single constant or configuration value so future upgrades only need to touch one place.

## Individual Comments

### Comment 1
<location path="assets/resource/base/pipeline/Global.json" line_range="398" />
<code_context>
     },
     "Global_BackToQC1_Fin": {
         "desc": "找到图钉-点击返回主页",
-        "recognition": "TemplateMatch",
</code_context>
<issue_to_address>
**issue (bug_risk):** The finish node for QC1 no longer performs a click despite the description saying it should.

This node used to `TemplateMatch` on `pin.png` with `action: "Click"` and a fixed `target`, but now only does an `Or` over `Rec_SandBox_Pin_Tpl` and `Rec_SandBox_Run_Tpl` with no `action` or `target`. Unless the click was intentionally moved, this likely drops the "click to return home" behavior implied by the description. Either restore the click/target here or point to a subnode that performs the click; if it was moved, please update the description accordingly.
</issue_to_address>

### Comment 2
<location path="assets/resource/base/pipeline/Global.json" line_range="643-645" />
<code_context>
     },
-    "Global_Main_Clr": {
-        "desc": "【被引用节点】主界面是否无二级浮窗遮蔽",
+    "Anc_Ocr_Enable_Clr": {
+        "desc": "[识别]]对Ocr节点按钮再次色核,亮色",
         "recognition": "ColorMatch",
-        "roi": "Main_OCR",
</code_context>
<issue_to_address>
**nitpick (typo):** Small typo in the description string with a double closing bracket.

The `desc` string currently reads `"[识别]]对Ocr节点按钮再次色核,亮色"` with a double `]`. Please update to a single closing bracket to align with the other descriptions if this is user- or log-facing text.

```suggestion
    "Anc_Ocr_Enable_Clr": {
        "desc": "[识别]对Ocr节点按钮再次色核,亮色",
        "recognition": "ColorMatch",
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -527,19 +397,10 @@
},
"Global_BackToQC1_Fin": {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): QC1 的完成节点现在不再执行点击操作了,但描述中仍然说明应该点击。

该节点之前会对 pin.pngTemplateMatch,并设置 action: "Click" 和固定的 target,但现在只对 Rec_SandBox_Pin_TplRec_SandBox_Run_TplOr,没有任何 actiontarget。除非点击逻辑被有意移走,否则这很可能会导致丢失描述中所暗示的“点击返回主页”的行为。请恢复此处的点击/目标,或者指向一个执行点击的子节点;如果点击逻辑确实已移走,请相应更新描述。

Original comment in English

issue (bug_risk): The finish node for QC1 no longer performs a click despite the description saying it should.

This node used to TemplateMatch on pin.png with action: "Click" and a fixed target, but now only does an Or over Rec_SandBox_Pin_Tpl and Rec_SandBox_Run_Tpl with no action or target. Unless the click was intentionally moved, this likely drops the "click to return home" behavior implied by the description. Either restore the click/target here or point to a subnode that performs the click; if it was moved, please update the description accordingly.

Comment on lines +643 to 645
"Anc_Ocr_Enable_Clr": {
"desc": "[识别]]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): 描述字符串中有一个小拼写错误:多了一个右中括号。

当前 desc 字符串是 "[识别]]对Ocr节点按钮再次色核,亮色",其中包含两个 ]。如果这段文本会展示给用户或写入日志,请改成只有一个右中括号,以与其他描述保持一致。

Suggested change
"Anc_Ocr_Enable_Clr": {
"desc": "[识别]]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
"Anc_Ocr_Enable_Clr": {
"desc": "[识别]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
Original comment in English

nitpick (typo): Small typo in the description string with a double closing bracket.

The desc string currently reads "[识别]]对Ocr节点按钮再次色核,亮色" with a double ]. Please update to a single closing bracket to align with the other descriptions if this is user- or log-facing text.

Suggested change
"Anc_Ocr_Enable_Clr": {
"desc": "[识别]]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
"Anc_Ocr_Enable_Clr": {
"desc": "[识别]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d2a298a-504c-4333-935d-fc19622ac25f

📥 Commits

Reviewing files that changed from the base of the PR and between 310e55d and f107227.

⛔ Files ignored due to path filters (4)
  • .gitignore is excluded by none and included by none
  • assets/resource/PC/model/.gitignore is excluded by none and included by none
  • assets/resource/base/image/SubBattle_+1.png is excluded by !**/*.png, !**/*.png and included by none
  • configure.py is excluded by none and included by none
📒 Files selected for processing (21)
  • assets/resource/base/pipeline/Activities.json
  • assets/resource/base/pipeline/Arbitrage.json
  • assets/resource/base/pipeline/AutoBattle.json
  • assets/resource/base/pipeline/Battle.json
  • assets/resource/base/pipeline/Collect_TeleportRecall.json
  • assets/resource/base/pipeline/Collect_skills.json
  • assets/resource/base/pipeline/Daily.json
  • assets/resource/base/pipeline/Equip.json
  • assets/resource/base/pipeline/EventBattle.json
  • assets/resource/base/pipeline/GACHA.json
  • assets/resource/base/pipeline/GACHA_ADV.json
  • assets/resource/base/pipeline/Global.json
  • assets/resource/base/pipeline/Mail.json
  • assets/resource/base/pipeline/PVP.json
  • assets/resource/base/pipeline/Pass.json
  • assets/resource/base/pipeline/QuestList.json
  • assets/resource/base/pipeline/Redemption.json
  • assets/resource/base/pipeline/SemiAuto.json
  • assets/resource/base/pipeline/Setup.json
  • assets/resource/base/pipeline/StartGame.json
  • assets/resource/base/pipeline/Weekly.json

📝 Walkthrough

Walkthrough

本PR对20个流程配置文件进行大规模重构,将散布各处的内联识别条件统一提取为全局复用节点库。通过在Global.json中定义主页、沙箱、滑块、OCR颜色等通用识别节点,各流程文件改为引用这些节点而非内联识别逻辑,提升配置复用率与可维护性。

Changes

Pipeline识别节点复用化重构

Layer / File(s) Summary
Global.json - 识别节点库扩展
assets/resource/base/pipeline/Global.json
新增Rec_HomePage_GA_Ocr、Sub_HomePage_GA_Bright_Clr主页识别节点;Rec_SandBox_Pin_Tpl、Rec_SandBox_Run_Tpl等沙箱识别节点;Anc_SliderSwitch_*滑块状态节点;Anc_Ocr_Enable_Clr、Sub_Ocr_Enable_Clr等OCR颜色判定节点。扩展全局返回按钮模板集合,拆分加载状态识别为6个独立节点。
主页入口识别流程调整
assets/resource/base/pipeline/Activities.json, Arbitrage.json, Daily.json, GACHA.json, GACHA_ADV.json, Mail.json, PVP.json, Pass.json, SemiAuto.json, Setup.json, Weekly.json
将11个流程文件中原有的Main_OCR与Global_Main_Clr内联识别替换为对Rec_HomePage_GA_Ocr与Sub_HomePage_GA_Bright_Clr的引用,统一主页识别逻辑。
沙箱/地图识别相关调整
assets/resource/base/pipeline/Collect_TeleportRecall.json, Collect_skills.json, Equip.json, Redemption.json, Setup.json
将内联的pin.png、Run.png TemplateMatch识别替换为对Rec_SandBox_Pin_Tpl、Rec_SandBox_Run_Tpl、Rec_SandBox_Pin3_Tpl等复用节点的引用。
OCR颜色判定与滑块状态统一
assets/resource/base/pipeline/EventBattle.json, PVP.json, Equip.json, Activities.json
将Global_Ocr_Clr_*与Global_SliderSwitch_*识别条件替换为Anc_Ocr_Enable_Clr、Anc_SliderSwitch_Gry_TurnOn_Clr等新节点引用,实现按钮和滑块状态识别的统一。
流程文件内特定识别节点提取
assets/resource/base/pipeline/Arbitrage.json, AutoBattle.json, Daily.json, Equip.json, EventBattle.json, GACHA.json, Pass.json, Setup.json, Weekly.json
在各文件内部提取特定的识别节点定义。Arbitrage中提取Rec_「Arbitrage_Sell_Item_SellMenu」Ocr_01/02;Daily中提取Rec「Daily_Busin_Claim」*与Rec「Daily_Busin_DecorCoin_PickUp」_Tpl_01/02/03;Equip中提取背包满状态识别节点;Setup中提取各技能识别模板等。
其他识别逻辑替换与细节调整
assets/resource/base/pipeline/Battle.json, Collect_TeleportRecall.json, Pass.json, QuestList.json, StartGame.json
Battle.json将固定坐标点击改为TemplateMatch识别;Collect_TeleportRecall新增技能识别分支;Pass.json重构任务选择分支;QuestList.json移除部分颜色匹配条件;StartGame.json调整跳转分支。

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~60 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants