Commit Graph

25 Commits

Author SHA1 Message Date
辉鸭蛋
b600d577c4 fix action params not valid 2024-12-08 15:29:06 +08:00
辉鸭蛋
a89af32560 pathing: fix bug, init mining 2024-11-22 00:23:21 +08:00
辉鸭蛋
9580dd916a pathing: add action combat_script 2024-11-16 22:48:26 +08:00
辉鸭蛋
003939bb94 js: fix no path pathing task
更新 PathingConditionConfig 和 PathingTask 方法以支持空值

将 PathingConditionConfig 类中的 FilterPartyName 方法的 materialName 参数类型从 string 改为 string?,以允许传入空值。增加了对 materialName 是否为空的检查,只有在 materialName 不为空时才进行条件匹配。将 PathingTask 类中的 GetMaterialName 方法的返回类型从 string 改为 string?,以允许返回空值。增加了对 FullPath 是否为空的检查,如果为空则返回 null。
2024-11-05 22:26:41 +08:00
辉鸭蛋
a98934fc9a fix bug 2024-11-02 22:56:35 +08:00
辉鸭蛋
2545581807 new pathing config 2024-11-02 19:49:38 +08:00
辉鸭蛋
94aae80046 auto pathing: optimize switch avatar
删除 `BetterGenshinImpact.csproj` 中的无用文件夹包含项。
将 `PathingConfig.cs` 中部分属性类型从 `int` 改为 `string`,并调整默认值。
在 `ScriptRepoUpdater.cs` 中用 `MessageBox` 替换 `ContentDialog`。
简化 `ElementalSkillHandler.cs` 和 `NormalAttackHandler.cs` 中的代码。
删除 `NahidaCollectHandler.cs` 中的切换角色代码。
在 `PathingTask.cs` 中添加 `HasAction` 方法。
在 `PathExecutor.cs` 中添加 `_actionAvatarIndexMap` 字典和多个新方法。
新增 `ReturnMainUiTask.cs` 任务类。
2024-10-24 23:05:52 +08:00
辉鸭蛋
7cc4093079 refresh the ui after subscribing to the script
重构了多个类中的方法为异步方法,并增加了消息注册逻辑:
- `ScriptRepoUpdater.cs`:增加了检查并创建 `ReposPath` 目录的逻辑。
- `RepoWebBridge.cs`:引用新命名空间,重构 `GetRepoJson` 和 `ImportUri` 方法为异步方法,增加了检查和更新本地仓库的逻辑。
- `JsListViewModel.cs` 和 `MapPathingViewModel.cs`:引用新命名空间,增加消息注册逻辑,修正方法中的引用。
- `PathingTask.cs`:修正了日志记录中 `FileName` 的引用。
- `TaskSettingsPage.xaml`:更新了文本内容,增加了关于装备「王树瑞佑」的说明。
- 新增 `RefreshDataMessage.cs` 文件,定义了 `RefreshDataMessage` 类。
2024-10-21 01:32:36 +08:00
辉鸭蛋
6b41b52008 warning when script version number is too high
更新程序集版本号并添加版本号比较逻辑

更新了 `BetterGenshinImpact.csproj` 文件中的程序集版本号,从 `0.35.0` 更新到 `0.35.1`。

在 `Manifest.cs` 文件中,增加了对 `BetterGenshinImpact.GameTask.Common` 和 `Microsoft.Extensions.Logging` 的引用,并在 `Manifest` 类中增加了版本号比较的逻辑,如果脚本要求的版本号大于当前版本号,则记录错误日志。

在 `ScriptProject` 类的构造函数中,增加了对脚本文件夹是否存在的检查,如果不存在则抛出 `DirectoryNotFoundException` 异常。

在 `PathingTask.cs` 文件中,增加了对 `BetterGenshinImpact.Core.Config`、`BetterGenshinImpact.GameTask.Common` 和 `Microsoft.Extensions.Logging` 的引用,并在 `PathingTask` 类中增加了版本号比较的逻辑,如果路径追踪任务要求的版本号大于当前版本号,则记录错误日志。
2024-10-20 15:47:03 +08:00
辉鸭蛋
3cbbbff093 add UpDownGrabLeaf action 2024-10-20 11:20:25 +08:00
辉鸭蛋
c4a7823c83 fix js pathingScript 2024-10-13 22:58:42 +08:00
辉鸭蛋
50aac5cea0 auto pathing opt 2024-10-13 22:12:07 +08:00
辉鸭蛋
66f15488e1 add bgi version 2024-10-03 20:14:04 +08:00
何杰泽
997059dd4b 添加fight action。战斗结束策略比较low。 2024-09-21 15:56:37 +08:00
辉鸭蛋
70b1ed88bb auto pathing: add nahida_collect action
新增 Action 处理机制及相关类和方法

删除了 `PickHandler` 类及其相关的 `Obsolete` 特性。
在 `ActionEnum` 类中新增了两个静态只读字段:`NahidaCollect` 和 `PickAround`。
在 `PathExecutor` 类中引入了 `BetterGenshinImpact.GameTask.AutoPathing.Handler` 命名空间。
在 `PathExecutor` 类的 `MoveTo` 方法中,添加了一个调用 `AfterMoveToTarget` 方法的步骤,用于在到达点位后执行特定的动作。
在 `PathExecutor` 类中,修改了疑似卡死时的延迟时间,从 500 毫秒增加到 1500 毫秒。
在 `PathExecutor` 类中新增了 `AfterMoveToTarget` 方法,用于根据 `waypoint.Action` 执行相应的处理逻辑。
新增了 `ActionFactory` 类,用于根据 `handlerType` 获取相应的 `IActionHandler` 实例。
新增了 `IActionHandler` 接口,定义了 `RunAsync` 方法。
新增了 `NahidaCollectHandler` 类,实现了 `IActionHandler` 接口,用于执行纳西妲的收集操作。
新增了 `PickAroundHandler` 类,实现了 `IActionHandler` 接口,暂时未实现具体的拾取操作逻辑。
2024-09-19 00:36:14 +08:00
辉鸭蛋
5f9ca6b399 auto pathing: add force tp for tp point 2024-09-17 15:06:32 +08:00
辉鸭蛋
4e6190ac7b fixed #598 2024-09-09 22:42:35 +08:00
辉鸭蛋
c37c43ce92 dispatcher supprot pathing script
调度器支持路径追踪功能及多项代码优化

在 `ScriptGroupProject.cs` 中:
- 添加对多个命名空间的引用。
- 修改构造函数,增加 `folder` 和 `type` 参数,删除 `kmName` 参数。
- 添加 `BuildKeyMouseProject` 和 `BuildPathingProject` 静态方法。
- 在 `Run` 方法中增加 `Pathing` 类型处理逻辑。
- 在 `ScriptGroupProjectExtensions` 中增加 `Pathing` 类型描述。

在 `PathingTask.cs` 中:
- 添加 `FileName` 属性,并在 `BuildFromFilePath` 方法中设置。

在 `Navigation.cs` 中:
- 将 `Navigation` 类改为 `public`。
- 添加 `_isWarmUp` 静态字段,防止重复加载地图特征点。
- 将 `GetPosition`、`GetTargetOrientation` 和 `GetDistance` 方法改为 `public`。

在 `GameTaskManager.cs` 中:
- 在 `AddTrigger` 方法中添加注释,指出清理 `TriggerDictionary` 的问题。

在 `ScriptService.cs` 中:
- 在 `RunMulti` 方法中增加 `hasTimer` 变量,并在处理 `Pathing` 类型时设置。
- 修改 `RunMulti` 方法逻辑,确保无定时操作时检查 JS 脚本。
- 在 `Run` 方法中增加 `Pathing` 类型处理逻辑。

在 `MapPathingPage.xaml` 中:
- 注释掉第四列定义和相关 `Grid` 元素。
- 修改 `ListView` 中 `GridViewColumn` 的 `DisplayMemberBinding`。

在 `ScriptControlPage.xaml` 中:
- 在 `ContextMenu` 中添加新的 `MenuItem`,用于添加路径追踪任务。

在 `PromptDialog.xaml.cs` 中:
- 添加新的 `Prompt` 方法,允许指定对话框大小。
- 修改 `ResponseText` 属性逻辑,增加默认返回值。

在 `MapPathingViewModel.cs` 中:
- 调整 `using` 语句顺序,删除重复引用。

在 `ScriptControlViewModel.cs` 中:
- 修改 `OnAddKmScript` 方法,使用 `BuildKeyMouseProject` 方法创建键鼠脚本项目。
- 添加 `OnAddPathing` 方法及其辅助方法,用于添加路径追踪任务。
- 在 `RunSelectedScriptGroup` 方法中,将脚本运行逻辑放入 `Task.Run` 中,避免阻塞 UI 线程。
2024-09-08 23:17:48 +08:00
辉鸭蛋
cb09a369c2 auto pathing: fix jump and fly 2024-09-08 12:33:58 +08:00
辉鸭蛋
1fd5320df2 auto pathing: update
- 移除了不必要的 `using` 语句,添加了新的 `using` 语句。
- 将 `Waypoints` 属性重命名为 `Positions`。
- 更新了 `BuildFromFilePath` 方法中的 `JsonOptions` 引用。
- 将 `Waypoint` 类移到单独的文件中,并添加了相关属性和注释。
- 添加了 `SaveToFile` 方法,用于将 `PathingTask` 对象保存到文件。
- 更新了 `PathExecutor` 中的 `TaskControl` 引用,简化了代码。
- 更新了 `PathRecorder` 的属性和方法,使用私有字段 `_pathingTask`。
- 更新了 `MapPathingPage.xaml` 的命令绑定。
- 更新了 `HotKeyPageViewModel` 和 `MapPathingViewModel` 的逻辑。
- 添加了新的 `PathingTaskConfig` 类,用于配置路径任务。
2024-09-08 02:23:45 +08:00
辉鸭蛋
5818bcd7ed refactor the path task-related code, using the new enum class
在 `PathingTask.cs`、`PathExecutor.cs` 和 `PathRecorder.cs` 中,删除了 `WaypointType`、`MoveType`、`ActionType` 和 `PathingTaskType` 枚举,并将其替换为 `Enum` 命名空间中的类。更新了 `PathingTaskInfo` 类的属性默认值和新增属性。在 `PathExecutor.cs` 中,使用 `.Code` 属性进行比较,并优化了 `prevPositions` 列表的索引。在 `HotKeyPageViewModel.cs` 中,重命名了变量并更新了回调函数。在 `ActionEnum.cs`、`MoveStatusType.cs`、`PathingTaskType.cs` 和 `WaypointType.cs` 中,定义了新的枚举类及其静态实例和相关方法。
2024-09-07 14:53:25 +08:00
辉鸭蛋
7c1febf307 add pathing ui 2024-09-01 20:15:47 +08:00
辉鸭蛋
5955f90c03 update pathing page 2024-09-01 02:10:13 +08:00
lwh9346
cc245b0e8a change file structure 2024-08-14 14:01:21 +08:00
lwh9346
f61a7c32d4 add basic code for auto pathing 2024-08-14 00:36:57 +08:00