Skip to content

feat: 万能跳转性能优化与适配#1573

Merged
MistEO merged 2 commits intov2from
feat/20260324
Mar 24, 2026
Merged

feat: 万能跳转性能优化与适配#1573
MistEO merged 2 commits intov2from
feat/20260324

Conversation

@zmdyy0318
Copy link
Copy Markdown
Contributor

@zmdyy0318 zmdyy0318 commented Mar 24, 2026

1、加速某些跳转场景
2、大世界进入场景统一从快捷键移动至点击
3、增加AutoAltClick自动兼容pc或adb的Click事件
4、移动go公共组件到pkg文件夹
5、增强esc菜单稳定性,装备制作从esc菜单进入
close #1456
close #1470

Summary by Sourcery

优化通用场景切换与输入处理,同时集中管理共享的 Go 组件。

新功能:

  • 添加 AutoAltClick 自定义动作,以统一 PC 和 ADB 输入管线中的 Alt+点击行为。
  • 引入 SceneManager 自定义动作和管线,通过专用的场景工作流管理场景切换。

增强与改进:

  • 将通用的 Go 自定义动作重构到共享的 pkg 命名空间中,并相应更新注册逻辑。
  • 调整场景菜单列表的点击行为,以提升场景导航工作流中的稳定性和点击命中准确性。
  • 将场景相关的管线重新组织到 SceneManager 之下,并对齐 ADB/PC 资源以实现一致的行为。
Original summary in English

Summary by Sourcery

Optimize universal scene transitions and input handling while centralizing shared Go components.

New Features:

  • Add AutoAltClick custom action to unify Alt+click behavior across PC and ADB input pipelines.
  • Introduce SceneManager custom actions and pipelines to manage scene transitions via dedicated scene workflows.

Enhancements:

  • Refactor common Go custom actions into a shared pkg namespace and update registration accordingly.
  • Adjust scene menu list click behavior to improve stability and hit accuracy in scene navigation workflows.
  • Reorganize scene-related pipelines under SceneManager and align ADB/PC resources for consistent behavior.

Copilot AI review requested due to automatic review settings March 24, 2026 07:50
Copy link
Copy Markdown
Contributor

@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 - 我在这里给出了一些总体反馈:

  • SceneManagerMenuListClickItemAction.Run 中,向上偏移 15 像素的硬编码值是一个魔法数;建议将其定义为一个具名常量并加上注释,这样未来如果需要调整点击位置会更容易,也更不容易出错。
  • SceneManagerMenuListClickItemAction.RunAutoAltClickAction.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.

Sourcery 对开源项目是免费的——如果你喜欢我们的代码审查,请考虑分享给更多人 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈改进后续的代码审查。
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.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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:新增 AutoAltClickActionSceneManagerMenuListClickItemAction 等 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)。

@Daydreamer114 Daydreamer114 changed the title feat:万能跳转性能优化与适配 feat: 万能跳转性能优化与适配 Mar 24, 2026
@isHarryh
Copy link
Copy Markdown
Member

isHarryh commented Mar 24, 2026

目前 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
Loading

现在对它的结构产生的更改是:

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
Loading

这种设计是否有违当前设计理念?

@isHarryh
Copy link
Copy Markdown
Member

或者说,其实目前的 Go pkg/ 事实上应该放到 internal/ 目录中管理?

@MistEO MistEO merged commit 2888c97 into v2 Mar 24, 2026
18 checks passed
@MistEO MistEO deleted the feat/20260324 branch March 24, 2026 12:22
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.

游戏内键位更改会导致日常奖励领取失败 接取送货任务功能不支持自定义快捷键

4 participants