Skip to content

fix:派蒙检测改为调用bv,调整相关配置默认值 - #3529

Merged
huiyadanli merged 1 commit into
babalae:mainfrom
Bedrockx:fix-paimoncheck
Aug 25, 2026
Merged

fix:派蒙检测改为调用bv,调整相关配置默认值#3529
huiyadanli merged 1 commit into
babalae:mainfrom
Bedrockx:fix-paimoncheck

Conversation

@Bedrockx

@Bedrockx Bedrockx commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

改动内容

将战斗结束检测中的派蒙辅助检测从「固定像素坐标点判断」改为「复用 Bv 的派蒙头像区域检测」,并调整相关配置默认值。

1. 派蒙检测改为调用 bv

  • 原实现:读取硬编码坐标 (32,67) 的像素颜色,用本地 IsPaimon 判断是否为派蒙头冠颜色。
  • 新实现:复用 Bv.IsInMainUi(左上四分之一 ROI 内模板匹配 PaimonMenu 派蒙头像模板),自动适配 AssetScale 缩放,更稳健。
  • 删除不再使用的 IsPaimon 静态方法。

2. 调整配置默认值

  • PaimonEndCheckEnabled:默认开启 true → 默认禁用 false
  • PaimonEndCheckDelay:默认 0.075 秒 → 0.2 秒

修改文件

  • BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs
  • BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.cs

Summary by CodeRabbit

  • 改进
    • 优化自动战斗结束检测,提升对战斗结束状态的识别准确性。
    • 默认关闭派蒙辅助战斗结束检测,减少不必要的检测触发。
    • 将检测延时默认值调整为 0.2 秒,增强检测稳定性。

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 05da8817-f299-40f7-bfb0-6efbb1bf72f3

📥 Commits

Reviewing files that changed from the base of the PR and between 2bebe86 and 8bbf773.

📒 Files selected for processing (2)
  • BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.cs
  • BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

本次变更调整派蒙辅助战斗结束检测的默认配置。检测逻辑改用 Bv.IsInMainUi 模板检测,并移除固定像素颜色判断方法。

Changes

派蒙辅助战斗结束检测

Layer / File(s) Summary
更新检测默认配置
BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.cs
派蒙辅助检测默认值从启用改为关闭。检测延时从 0.075 秒改为 0.2 秒。
接入主界面模板检测
BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs
新增 BgiVision 引用。派蒙可见性判断改为调用 Bv.IsInMainUi。移除旧的 IsPaimon 像素颜色判断方法。

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8bbf7

The PR switches end-of-battle Paimon detection to the shared avatar-region check and disables that check by default while increasing its delay; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: huiyadanli

Poem

小兔挥挥耳朵忙,
模板检测替像素光。
默认关闭更稳妥,
延时调整到新章。
战斗收尾更清爽。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了将派蒙检测改为调用 Bv 并调整相关配置默认值这两项主要变更。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

此 PR 将自动战斗结束阶段的派蒙检测由固定像素判断改为复用 Bv.IsInMainUi 模板识别,并调整辅助检测的默认开关与延迟。

  • 删除固定颜色的 IsPaimon 判断,改用可适配缩放的主界面识别
  • PaimonEndCheckEnabled 默认值改为 false
  • PaimonEndCheckDelay 默认值改为 0.2
  • 设置界面的默认值说明尚未同步

Confidence Score: 4/5

此 PR 看起来可以合并,但应同步更新两个设置界面的默认值说明,避免误导用户。

识别调用与现有全帧视觉识别契约相符,未发现明确的运行时阻塞问题;当前确定的问题仅是配置默认值与用户界面说明不一致。

Files Needing Attention: BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.cs、BetterGenshinImpact/View/Pages/TaskSettingsPage.xaml、BetterGenshinImpact/View/Pages/View/ScriptGroupConfigView.xaml

Important Files Changed

Filename Overview
BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs 派蒙辅助检测改为使用全帧 ImageRegion 调用 Bv.IsInMainUi,截图尺寸和识别输入契约保持一致,未确认阻塞性问题。
BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.cs 默认开关和延迟已调整,但相关设置页面仍展示旧的默认值说明。
Prompt To Fix All With AI
### Issue 1
BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.cs:127-133
**默认值说明未同步**

这里已将派蒙辅助检测的默认值改为禁用、延迟改为 0.2 秒,但 `TaskSettingsPage.xaml``ScriptGroupConfigView.xaml` 仍显示“默认开启”和“默认为0.1秒”,会让使用新建或重置配置的用户误判实际行为;请同步更新这两个界面的帮助文本。

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix: 派蒙检测改为调用bv,调整相关配置默认值" | Re-trigger Greptile

Comment on lines +127 to +133
private bool _paimonEndCheckEnabled = false;

/// <summary>
/// 派蒙辅助检测延时(秒),默认为0.075秒
/// 派蒙辅助检测延时(秒),默认为0.2秒
/// </summary>
[ObservableProperty]
private double _paimonEndCheckDelay = 0.075;
private double _paimonEndCheckDelay = 0.2;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 默认值说明未同步

这里已将派蒙辅助检测的默认值改为禁用、延迟改为 0.2 秒,但 TaskSettingsPage.xamlScriptGroupConfigView.xaml 仍显示“默认开启”和“默认为0.1秒”,会让使用新建或重置配置的用户误判实际行为;请同步更新这两个界面的帮助文本。

Prompt To Fix With AI
This is a comment left during a code review.
Path: BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.cs
Line: 127-133

Comment:
**默认值说明未同步**

这里已将派蒙辅助检测的默认值改为禁用、延迟改为 0.2 秒,但 `TaskSettingsPage.xaml``ScriptGroupConfigView.xaml` 仍显示“默认开启”和“默认为0.1秒”,会让使用新建或重置配置的用户误判实际行为;请同步更新这两个界面的帮助文本。

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@huiyadanli
huiyadanli merged commit 8361479 into babalae:main Aug 25, 2026
3 checks passed
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