Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些总体反馈:
- 在
SceneManagerMenuListClickItemAction.Run中,向上偏移 15 像素的硬编码值是一个魔法数;建议将其定义为一个具名常量并加上注释,这样未来如果需要调整点击位置会更容易,也更不容易出错。 SceneManagerMenuListClickItemAction.Run和AutoAltClickAction.Run都忽略了ctx.RunAction的返回值并始终返回true;建议检查每次RunAction的结果并在失败时进行传递,以便更容易诊断交互问题。- 传递给
RunAction的动作名称(例如"__SceneClickAction"、"__AutoAltClickAltKeyDownAction")是重复出现的字符串字面量;建议将它们定义为类型化常量,以避免拼写错误,并让 Go 代码与流水线定义之间的交叉引用更加清晰。
面向 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- In SceneManagerMenuListClickItemAction.Run, the hardcoded upward offset of 15 pixels is a magic number; consider defining it as a named constant with a comment so future adjustments to click positioning are easier and less error-prone.
- Both SceneManagerMenuListClickItemAction.Run and AutoAltClickAction.Run ignore the return value of ctx.RunAction and always return true; consider checking the result of each RunAction and propagate failure to help diagnose interaction issues more easily.
- The action names passed to RunAction (e.g. "__SceneClickAction", "__AutoAltClickAltKeyDownAction") are duplicated string literals; consider defining them as typed constants to avoid typos and make cross-references between Go and pipeline definitions clearer.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈改进后续的代码审查。
Original comment in English
Hey - I've left some high level feedback:
- In SceneManagerMenuListClickItemAction.Run, the hardcoded upward offset of 15 pixels is a magic number; consider defining it as a named constant with a comment so future adjustments to click positioning are easier and less error-prone.
- Both SceneManagerMenuListClickItemAction.Run and AutoAltClickAction.Run ignore the return value of ctx.RunAction and always return true; consider checking the result of each RunAction and propagate failure to help diagnose interaction issues more easily.
- The action names passed to RunAction (e.g. "__SceneClickAction", "__AutoAltClickAltKeyDownAction") are duplicated string literals; consider defining them as typed constants to avoid typos and make cross-references between Go and pipeline definitions clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In SceneManagerMenuListClickItemAction.Run, the hardcoded upward offset of 15 pixels is a magic number; consider defining it as a named constant with a comment so future adjustments to click positioning are easier and less error-prone.
- Both SceneManagerMenuListClickItemAction.Run and AutoAltClickAction.Run ignore the return value of ctx.RunAction and always return true; consider checking the result of each RunAction and propagate failure to help diagnose interaction issues more easily.
- The action names passed to RunAction (e.g. "__SceneClickAction", "__AutoAltClickAltKeyDownAction") are duplicated string literals; consider defining them as typed constants to avoid typos and make cross-references between Go and pipeline definitions clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Pull request overview
本 PR 主要围绕 SceneManager 场景跳转链路的性能/稳定性优化 做调整:将部分“快捷键跳转”统一改为“识别后点击”,并引入 AutoAltClickAction 以在不同运行环境下复用同一套点击逻辑;同时把部分 go-service 公共 CustomAction 迁移到 pkg/ 下集中管理,并新增 SceneManager 菜单列表点击的自定义动作。
Changes:
- Pipeline:大世界/菜单/地图相关节点大量从
ClickKey切换为Custom(AutoAltClickAction),并补齐rate_limit/pre_delay/post_delay等字段以减少 schema 默认延迟带来的等待。 - Pipeline:新增/替换若干 SceneManager 菜单入口模板(左/右展开、活动/通行证/行动手册/背包等),并新增通用
__SceneClickAction。 - Go:新增
AutoAltClickAction、SceneManagerMenuListClickItemAction等 CustomAction,并将 subtask/clearhitcount/charactercontroller 等公共组件移动到agent/go-service/pkg/。
Reviewed changes
Copilot reviewed 24 out of 41 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| assets/resource_adb/pipeline/SceneManager/SceneWorld.json | 删除 ADB SceneManager world 相关私有节点(疑似迁移/废弃)。 |
| assets/resource_adb/pipeline/SceneManager/SceneMenu.json | 删除 ADB SceneManager menu 相关私有节点(疑似迁移/废弃)。 |
| assets/resource_adb/pipeline/SceneManager/SceneMap.json | 删除 ADB SceneManager map 相关私有节点(疑似迁移/废弃)。 |
| assets/resource_adb/pipeline/SceneManager/SceneDijiang.json | 删除 ADB 帝江号相关私有节点(疑似迁移/废弃)。 |
| assets/resource_adb/pipeline/Common/__Private/AutoAltClick/Action.json | 新增 ADB 侧 AutoAltClick action 定义(当前存在 JSON 解析问题且缺少点击节点)。 |
| assets/resource/pipeline/VisitFriends/Main.json | 增加 pre_wait_freezes 提升进入/扫描前稳定性。 |
| assets/resource/pipeline/SceneManager/SceneWorld.json | Tab 打开/切换逻辑改为点击 + AutoAltClickAction,并指定 box_index。 |
| assets/resource/pipeline/SceneManager/SceneValleyIV.json | 多个节点补齐 rate_limit: 0 以避免默认节流/延迟。 |
| assets/resource/pipeline/SceneManager/SceneMenu.json | 大量菜单入口从快捷键改为展开后点击;引入右/左展开模板与 SceneManagerMenuListClickItemAction。 |
| assets/resource/pipeline/SceneManager/SceneMap.json | 进入地图改为识别任务图标后点击 + AutoAltClickAction,并调整 waits。 |
| assets/resource/pipeline/SceneManager/SceneDijiang.json | 控制中枢入口改为 AutoAltClickAction 并调整等待。 |
| assets/resource/pipeline/SceneManager/SceneCommon.json | 调整等待静止时间(400 → 600)。 |
| assets/resource/pipeline/SceneManager/Action.json | 新增 __SceneClickAction 供 Go CustomAction 间接调用。 |
| assets/resource/pipeline/Interface/SceneValleyIV.json | 接口节点补齐 rate_limit: 0。 |
| assets/resource/pipeline/Interface/SceneMenu.json | 多个接口节点补齐 rate_limit: 0,并调整装备加工入口跳转链路。 |
| assets/resource/pipeline/Interface/SceneDijiang.json | 接口节点补齐 rate_limit: 0。 |
| assets/resource/pipeline/Interface/Scene.json | Scene 接口节点补齐 pre_delay/post_delay/rate_limit。 |
| assets/resource/pipeline/CreditShopping/GoToShop.json | Shop 展开模板从 Expand.png 替换为 MenuExpandRight.png。 |
| assets/resource/pipeline/Common/__Private/CharacterController/Action.json | 新增角色控制器相关基础 action(滑动、alt、按键长按等)。 |
| assets/resource/pipeline/Common/__Private/AutoAltClick/Action.json | 新增 PC 侧 AutoAltClick action 定义(KeyDown/KeyUp/Click)。 |
| assets/resource/image/SceneManager/WorldMenuProtocolPass.png | 新增通行证入口模板图。 |
| assets/resource/image/SceneManager/WorldMenuOperationalManual.png | 新增行动手册入口模板图。 |
| assets/resource/image/SceneManager/WorldMenuEvent.png | 新增活动入口模板图。 |
| assets/resource/image/SceneManager/WorldMenuBaker.png | 新增 Baker 入口模板图。 |
| assets/resource/image/SceneManager/WordMenuBackpack2.png | 新增背包入口模板图(命名为 WordMenuBackpack*)。 |
| assets/resource/image/SceneManager/WordMenuBackpack.png | 新增背包入口模板图(命名为 WordMenuBackpack*)。 |
| assets/resource/image/SceneManager/TaskIcon.png | 新增任务图标模板图(用于从大世界进入地图)。 |
| assets/resource/image/SceneManager/MenuExpandRight.png | 新增右侧菜单展开模板图。 |
| assets/resource/image/SceneManager/MenuExpandLeft.png | 新增左侧菜单展开模板图。 |
| agent/go-service/scenemanager/register.go | 新增 SceneManager 子包注册入口。 |
| agent/go-service/scenemanager/action.go | 新增菜单列表项点击 CustomAction(基于 box 上边中点偏移点击)。 |
| agent/go-service/register.go | registerAll 引入 pkg/* 组件与 scenemanager 注册。 |
| agent/go-service/pkg/subtask/register.go | 新增 SubTask CustomAction 注册。 |
| agent/go-service/pkg/subtask/action.go | 新增 SubTask CustomAction 实现(支持 continue/strict)。 |
| agent/go-service/pkg/clearhitcount/register.go | 新增 ClearHitCount CustomAction 注册。 |
| agent/go-service/pkg/clearhitcount/action.go | 新增 ClearHitCount CustomAction 实现。 |
| agent/go-service/pkg/charactercontroller/register.go | 新增 CharacterController 相关 CustomAction 注册。 |
| agent/go-service/pkg/charactercontroller/controller.go | 新增角色视角旋转/轴向移动/朝目标移动等 CustomAction 实现。 |
| agent/go-service/pkg/autoaltclick/register.go | 新增 AutoAltClick CustomAction 注册。 |
| agent/go-service/pkg/autoaltclick/action.go | 新增 AutoAltClick CustomAction 实现(AltDown → Click → AltUp)。 |
assets/resource_adb/pipeline/Common/__Private/AutoAltClick/Action.json
Outdated
Show resolved
Hide resolved
Member
|
目前 Go pkg/ 设计上用于存放供 Go 中其余模块使用的工具类代码: graph TD;
subgraph go-service
subgraph pkg
A1[maafocus]
A2[minicv]
A3["..."]
end
pkg --usedby--> B[custom actions]
pkg --usedby--> C[custom general actions]
end
B --usedby--> D[Pipelines]
C --usedby--> D
现在对它的结构产生的更改是: graph TD;
subgraph go-service
subgraph pkg
A1[maafocus]
A2[minicv]
A3["..."]
C[custom general actions]
end
pkg --usedby--> B[custom actions]
end
B --usedby--> D[Pipelines]
C --usedby--> D
这种设计是否有违当前设计理念? |
Member
|
或者说,其实目前的 Go pkg/ 事实上应该放到 internal/ 目录中管理? |
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.
1、加速某些跳转场景
2、大世界进入场景统一从快捷键移动至点击
3、增加AutoAltClick自动兼容pc或adb的Click事件
4、移动go公共组件到pkg文件夹
5、增强esc菜单稳定性,装备制作从esc菜单进入
close #1456
close #1470
Summary by Sourcery
优化通用场景切换与输入处理,同时集中管理共享的 Go 组件。
新功能:
增强与改进:
Original summary in English
Summary by Sourcery
Optimize universal scene transitions and input handling while centralizing shared Go components.
New Features:
Enhancements: