199 Commits

Author SHA1 Message Date
辉鸭蛋
44190a522b team identification support online
修复错误信息,改进联机状态处理

更新了 `BetterGenshinImpact.csproj` 文件中的程序集版本号,从 `0.35.2` 更新为 `0.35.4`。

修正了 `ScriptProject.cs` 文件中抛出 `FileNotFoundException` 异常时的错误信息,将 "manifest.json文件存在" 改为 "manifest.json文件不存在"。

在 `AutoFightAssets.cs` 文件中:
- 为 `AvatarSideIconRectList` 和 `AvatarIndexRectList` 添加了注释,解释其在非联机状态下的用途。
- 添加了多个新的属性和注释,用于处理联机状态下的角色头像和对应的白色块位置。
- 初始化了 `OnePRa` 和 `PRa` 两个识别对象,用于识别联机状态下的1P和P图标。

在 `Avatar.cs` 文件中:
- 修改了角色切换逻辑,使用 `CombatScenes.ExpectedTeamAvatarNum` 替代硬编码的数字。
- 在 `TrySwitch` 方法中添加了 `needLog` 参数,并在切换成功时记录日志。
- 移除了部分注释代码,并在日志中保存了角色切换和索引区域的截图。
- 添加了 `System.Diagnostics` 的引用。

在 `CombatScenes.cs` 文件中:
- 将 `Avatars` 初始化为空数组。
- 添加了 `ExpectedTeamAvatarNum` 属性,默认值为4。
- 在 `InitializeTeam` 方法中添加了联机状态的判断和处理逻辑。
- 修改了队伍识别逻辑,使用动态数组替代固定长度的数组。
- 修改了 `CheckTeamInitialized` 方法,使用 `ExpectedTeamAvatarNum` 替代硬编码的数字。
- 修改了 `BuildAvatars` 方法,添加了对联机状态下角色编号位置信息的处理。
- 修改了 `SelectAvatar` 方法,使用 `GetValueOrDefault` 替代 `TryGetValue`。

在 `ScriptControlViewModel.cs` 文件中,设置 `WindowStartupLocation` 为 `WindowStartupLocation.CenterOwner`。

添加了 `1p.png` 和 `p.png` 两个新图像文件,用于识别联机状态下的1P和P图标。
2024-10-27 17:15:55 +08:00
辉鸭蛋
98d2664c28 auto pathing: use group config & fix bug 2024-10-27 00:51:10 +08:00
辉鸭蛋
72c2e38f94 add pathing settings for script group 2024-10-26 21:11:59 +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
辉鸭蛋
404e7215fa add icon for pathing ui 2024-10-24 00:48:58 +08:00
辉鸭蛋
960cfea102 fix script repo web
重构:移出 localRepoJsonPath 赋值和 null 检查逻辑

将 localRepoJsonPath 的赋值和 null 检查逻辑移出 if (needUpdate) 代码块,以确保无论 needUpdate 的值如何,这段逻辑都会被执行。
2024-10-22 00:36:26 +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
辉鸭蛋
11ec9bc45d refactor: CancellationTokenSource -> CancellationToken 2024-10-19 01:50:21 +08:00
辉鸭蛋
3d2b1b376e 0.35.0 2024-10-14 00:24:11 +08:00
辉鸭蛋
c4a7823c83 fix js pathingScript 2024-10-13 22:58:42 +08:00
辉鸭蛋
b2cf62a21c add local script repo web
重构了 `AvatarClassifyGen.cs` 中的图像读取逻辑,现在只读取一个图像文件。`AllConfig.cs` 中添加了 `ScriptConfig` 类的配置,并监听其属性变化。`ScriptRepoUpdater.cs` 中引入了多个新命名空间,添加了 `_logger` 和 `_webWindow` 字段,新增了 `AutoUpdate` 方法,修改了 `UpdateCenterRepo` 方法,新增了 `FindCenterRepoPath`、`ImportScriptFromUri` 和 `OpenLocalRepoInWebView` 方法。`WebpagePanel.cs` 中添加了 `OnWebViewInitializedAction` 属性。`WebpageWindow.cs` 中注释掉了背景色设置。`MainWindow.xaml` 中修改了标题栏图标路径。`JsListPage.xaml`、`KeyMouseRecordPage.xaml` 和 `MapPathingPage.xaml` 中修改了按钮命令绑定。`MainWindowViewModel.cs` 中添加了 `AutoUpdate` 方法调用。`JsListViewModel.cs`、`KeyMouseRecordPageViewModel.cs` 和 `MapPathingViewModel.cs` 中添加了 `Config` 属性和 `OnOpenLocalScriptRepo` 命令。新增了 `ScriptConfig.cs` 和 `RepoWebBridge.cs` 文件,定义了 `ScriptConfig` 和 `RepoWebBridge` 类。
2024-10-13 18:13:28 +08:00
辉鸭蛋
c75dbbc241 add script repo downloader 2024-10-13 13:36:06 +08:00
辉鸭蛋
bb18350457 fix mouse move for js 2024-10-11 03:12:38 +08:00
辉鸭蛋
c13db0a501 rename 2024-10-08 00:21:56 +08:00
辉鸭蛋
876a833590 fix: js script bug 2024-10-04 19:04:32 +08:00
辉鸭蛋
160e45c75a fix JustTp 2024-10-04 14:24:42 +08:00
辉鸭蛋
66f15488e1 add bgi version 2024-10-03 20:14:04 +08:00
辉鸭蛋
389dac879b js: add CaptureGameRegion 2024-10-03 16:24:56 +08:00
辉鸭蛋
8b6351cbd6 update: simulator for js 2024-10-03 00:40:07 +08:00
辉鸭蛋
ca126e0d66 js: +func 2024-10-02 19:20:25 +08:00
辉鸭蛋
6c0b293328 js: add solo task 2024-10-01 21:34:33 +08:00
辉鸭蛋
8de5bcf987 auto pick: ForceInteraction 2024-10-01 20:10:46 +08:00
辉鸭蛋
8bb1d728ff refactor: solo task 2024-09-22 23:56:39 +08:00
辉鸭蛋
8d2b36d5fd refactor: script run 2024-09-10 23:27:04 +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
辉鸭蛋
7c1febf307 add pathing ui 2024-09-01 20:15:47 +08:00
辉鸭蛋
b68b0d85f6 Js -> JS 2024-08-24 02:28:31 +08:00
辉鸭蛋
461b0b00d1 add JS script dynamic settings 2024-08-24 02:13:46 +08:00
辉鸭蛋
b7d492e5d2 I don't know why this error occurred, but I fixed it 2024-08-20 23:35:08 +08:00
辉鸭蛋
b62e4a7425 add script group editor 2024-08-18 21:41:12 +08:00
辉鸭蛋
c6680ced12 add js script page 2024-08-17 16:02:54 +08:00
辉鸭蛋
8b0bdef670 edit script group name 2024-08-15 23:55:57 +08:00
辉鸭蛋
f904fe024b Merge remote-tracking branch 'origin/main' into pr/522 2024-08-14 21:57:11 +08:00
qhy040404
c490d29aa1 code cleanup 2024-08-14 18:01:02 +08:00
lwh9346
49bc6befb7 add script support 2024-08-14 14:00:56 +08:00
lwh9346
f61a7c32d4 add basic code for auto pathing 2024-08-14 00:36:57 +08:00
辉鸭蛋
ed9a47a3a1 fix dispather thread safe 2024-08-11 20:14:32 +08:00
辉鸭蛋
8fa071722e js : dispatcher.addTimer 2024-08-11 17:58:22 +08:00
辉鸭蛋
a7153a47f6 auto crystalfly init 2024-08-11 02:32:00 +08:00
辉鸭蛋
0edf6c13ef script group ui3 2024-08-10 21:18:48 +08:00
辉鸭蛋
ad288c60cc script group ui 2 2024-08-10 19:16:35 +08:00
辉鸭蛋
308d398036 script group ui 2024-08-10 13:37:29 +08:00
辉鸭蛋
c1072d0574 script: support running macros 2024-08-07 01:07:58 +08:00
辉鸭蛋
d5ac4c523e add crud helper 2024-08-04 23:47:54 +08:00
辉鸭蛋
4610c9e7ca add script engine 2024-08-03 19:41:48 +08:00
辉鸭蛋
917df88099 add cancel task hotkey #501 2024-07-30 00:12:18 +08:00
辉鸭蛋
076a7596a0 refactor some code 2024-07-21 19:21:01 +08:00
辉鸭蛋
4243972eeb script async test 2024-07-21 12:42:39 +08:00