Compare commits

...
729 Commits
Author SHA1 Message Date
DismissedLight 45f55f94cd part 2 2025-01-21 22:10:50 +08:00
DismissedLight d4aae4508a init test 2025-01-21 17:31:09 +08:00
辉鸭蛋 7f7d28825e fixed #1043 #1044 2025-01-21 02:00:26 +08:00
辉鸭蛋 ccb8025676 auto start capture on solo task start2 #1048 2025-01-21 01:56:42 +08:00
辉鸭蛋 2ff5a8930d Revert "auto start capture on solo task start #1048"
This reverts commit ef92586af6.
2025-01-21 01:46:53 +08:00
辉鸭蛋 ef92586af6 auto start capture on solo task start #1048 2025-01-21 01:43:48 +08:00
辉鸭蛋 bd1702af23 quick tp: support Obsidian Totem Pole 2025-01-21 00:03:05 +08:00
辉鸭蛋 23c922d67a Merge pull request #1039 from Scarlet1ssimo/betterscan
优化锄地战斗后捡掉落物的逻辑
2025-01-20 23:46:23 +08:00
辉鸭蛋 89acd1fc65 fix daily reward 2025-01-20 23:17:59 +08:00
辉鸭蛋 c61691ec1e init key binding on first run 2025-01-20 00:56:12 +08:00
辉鸭蛋 ca96204e01 install path 2025-01-20 00:22:40 +08:00
Scarlet fb61b83df5 remove extra logging; refine comments 2025-01-18 21:30:30 -06:00
Scarlet 79aa1505d3 feature: better scan pick 2025-01-18 21:20:02 -06:00
辉鸭蛋 dcafd64139 save theme 2025-01-18 17:54:59 +08:00
辉鸭蛋 5ab63a9e76 retry for open party choose ui 2025-01-18 15:53:40 +08:00
辉鸭蛋 9ddd3c5564 code clean 2025-01-18 15:12:35 +08:00
辉鸭蛋 a36f938e8a Merge pull request #1025 from mfkvfhpdx/main
路径追踪增加增加  允许在jsScript脚本中启用此路径追踪配置、覆盖JS中的自动战斗配置 。
2025-01-18 15:06:58 +08:00
辉鸭蛋 5a7721c534 Merge pull request #1022 from physligl/main
修复传送时遇到的部分问题
2025-01-18 15:06:49 +08:00
辉鸭蛋 12beabc6a2 fixed #971 2025-01-18 12:25:08 +08:00
辉鸭蛋 3da43f3543 fixed #997 2025-01-18 12:05:58 +08:00
辉鸭蛋 ba3f97c63f pathing: run -> dash
持续跑动改成多次冲刺
2025-01-18 11:16:12 +08:00
zjl f14c61145f 重试时战斗策略不跳过 2025-01-18 09:15:41 +08:00
辉鸭蛋 daf6525172 pathing opt
stop_flying下落后都会有个类似target逼近的过程,path类型节点可以取消这个表现
2025-01-18 01:13:28 +08:00
辉鸭蛋 38ea7833c1 opt
优化月卡的的领取
减少获取历练点的点击次数
2025-01-18 01:08:39 +08:00
辉鸭蛋 39da7b489f lock start 2025-01-18 00:53:47 +08:00
辉鸭蛋 e08b0875ee fix lag 2025-01-17 23:12:14 +08:00
zjl e2d0ca5974 去掉战斗部分,主界面判断,减少误判 2025-01-17 14:07:47 +08:00
秋云 89e00207cb 优化传送到七天神像回血的体验。 2025-01-17 03:27:58 +08:00
辉鸭蛋 02f6309a11 fix auto domain dont walk to F 2025-01-17 01:52:43 +08:00
zjl 1a0d61ac94 路径追踪增加 允许在jsScript脚本中启用此路径追踪配置、覆盖JS中的自动战斗配置 。默认为否,开启后可以使JS脚本中的路径追踪和自动战斗,使用该调度器所配置的参数运行 2025-01-16 23:53:17 +08:00
秋云 1538445990 把原本删除的INF级别时间显示回复,并改为DBG级别。 2025-01-16 10:16:43 +08:00
秋云 8a63ac8914 fix typo. 2025-01-16 08:24:08 +08:00
秋云 c87ba278e9 修复了影向山和太山府附近点错传送锚点的问题。 2025-01-16 08:18:50 +08:00
秋云 55b2b48e43 修改日志中时间的时间显示格式。 2025-01-16 08:16:39 +08:00
秋云 30a1b4d40f Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-16 01:27:37 +08:00
辉鸭蛋 4f6724613a fix some bug 2025-01-16 01:13:05 +08:00
辉鸭蛋 04399c1780 fix log 2025-01-15 23:44:02 +08:00
辉鸭蛋 48ddd1751c + elemental collect avatar
早柚
2025-01-15 23:18:41 +08:00
辉鸭蛋 ccc5c68c1c auto tcg force check resolution 2025-01-15 01:05:28 +08:00
辉鸭蛋 340c4caf49 fix 4 am skip blessing of the welkin moon 2025-01-15 01:03:16 +08:00
辉鸭蛋 9ef5cff886 0.39.3 2025-01-13 22:55:10 +08:00
秋云 ad4993c3cf Add some comments 2025-01-13 08:38:10 +08:00
秋云 01fe05e0c8 Remove unused code from FeatureStorage.cs 2025-01-13 08:36:03 +08:00
辉鸭蛋 a22002966e auto update 2025-01-13 01:17:11 +08:00
辉鸭蛋 8666c931d9 auto path opt
1. 超时直接放弃路径点
2. 所有时间都现取现用
2025-01-12 22:55:51 +08:00
辉鸭蛋 1b7ea8b16b Merge remote-tracking branch 'origin/main' 2025-01-12 22:29:37 +08:00
辉鸭蛋 5552813d61 more pick black item 2025-01-12 22:08:18 +08:00
辉鸭蛋 5e03a29a8e Merge pull request #996 from mfkvfhpdx/main
功能调整和日志分析增加锄地统计
2025-01-12 22:00:05 +08:00
辉鸭蛋 dd9e700485 more game resolution check 2025-01-12 21:45:02 +08:00
辉鸭蛋 d5838017d7 fix script import bug 2025-01-12 21:09:48 +08:00
mfkvfhpdx 64feced367 Merge branch 'babalae:main' into main 2025-01-11 22:43:53 +08:00
辉鸭蛋 9d504443f7 Merge pull request #1001 from physligl/main
添加路径追踪中输出日志的功能。
2025-01-11 11:04:39 +08:00
秋云 1f70cfb364 Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-11 01:58:30 +08:00
秋云 5f18901e22 添加路径追踪中输出日志的功能。 2025-01-11 01:58:23 +08:00
mfkvfhpdx c4e2f49f4b Merge branch 'babalae:main' into main 2025-01-11 00:33:16 +08:00
辉鸭蛋 1fe5281018 Merge pull request #994 from atiasn/auto-music
增加所有乐曲达成【大音天籁】
2025-01-11 00:06:03 +08:00
辉鸭蛋 dfc8c61c8d test code 2025-01-11 00:01:02 +08:00
NextKale 21bef81374 remove old code 2025-01-10 22:55:26 +08:00
NextKale a90f22a8d5 music level 2025-01-10 22:52:18 +08:00
mfkvfhpdx 31994ce2f4 更多功能增加脚本仓库入口,方便订阅更新。 2025-01-10 22:00:21 +08:00
mfkvfhpdx b0f0b26092 增加了复制组功能,和根据文件夹更新功能 2025-01-10 21:52:01 +08:00
mfkvfhpdx 58db3ad04c 修正分析计时 2025-01-10 17:54:49 +08:00
mfkvfhpdx b686d88134 日志分析开放更多的天数选择 2025-01-10 17:13:59 +08:00
mfkvfhpdx 017f8ed5b0 调整统计排序 2025-01-10 15:07:30 +08:00
mfkvfhpdx 2c727d5e6d 调整使用真正的gameinfo 2025-01-10 11:08:16 +08:00
mfkvfhpdx ebd8031f2c Merge branch 'main' into main 2025-01-10 10:29:53 +08:00
mfkvfhpdx 7d872704c2 日志分析增加锄地分析,锄地分析基于米游社旅行札记,需要输入token才能看到锄地分析地数据。 2025-01-10 10:25:30 +08:00
辉鸭蛋 6e7c7fb78e eye catching tips 2025-01-10 01:56:19 +08:00
辉鸭蛋 1469da4699 ui #936 2025-01-10 01:32:21 +08:00
辉鸭蛋 fcac4aa811 tp wait 1 min #932 2025-01-10 01:18:40 +08:00
辉鸭蛋 072943baf9 #955 2025-01-10 01:07:15 +08:00
辉鸭蛋 6591c8a387 fixed #951 2025-01-10 01:04:31 +08:00
辉鸭蛋 9f11fc984d add no select domain option 2025-01-10 00:59:31 +08:00
辉鸭蛋 902b319211 触发器触发频率必须大于0 2025-01-10 00:51:35 +08:00
辉鸭蛋 2e27154871 mandatory verification of game resolution
自动战斗 秘境 强制校验游戏分辨率
2025-01-10 00:11:22 +08:00
辉鸭蛋 e2afabc7f6 fixed #988
修复战斗策略参数校验提示在()不存在时未正确展示的问题
2025-01-10 00:04:14 +08:00
辉鸭蛋 7853901137 log text optimization
文本优化(战斗策略文件不存在、sendInput被拦截、路径追踪中战斗策略日志打印修改)
2025-01-09 23:58:28 +08:00
辉鸭蛋 cd3713175a auto pathing: don't get close during the battle.
战斗时不需要接近点位
2025-01-09 23:49:49 +08:00
辉鸭蛋 3f2a3b118a auto pathing: add auto run config
并且枫丹合成台不自动跑步
2025-01-09 23:41:53 +08:00
NextKale 7edd0c2565 music 2025-01-09 21:16:31 +08:00
NextKale 66fc5fc080 music 2025-01-09 21:10:19 +08:00
NextKale a52dddb70a Merge branch 'main' into auto-music 2025-01-09 21:00:53 +08:00
NextKale 2df7598304 Merge branch 'main' of github.com:atiasn/better-genshin-impact 2025-01-09 21:00:18 +08:00
mfkvfhpdx a9d8659be7 界面去除了偏色调整,战斗识别颜色调整为范围白和范围黄。当万叶技能cd大于3秒或当前一人次就结束了战斗(基本为没有怪物情况),则跳过此次万叶也拾取。未知界面检查,支持暂停情况。 2025-01-09 19:25:42 +08:00
辉鸭蛋 74f0aa71c3 Merge pull request #989 from physligl/main
添加日志分析匹配日志文件带后缀的情况。
2025-01-08 23:57:56 +08:00
秋云 3239003b22 Merge branch 'babalae:main' into main 2025-01-08 22:33:35 +08:00
秋云 4415e85856 添加匹配日志文件带后缀的情况。 2025-01-08 22:29:46 +08:00
NextKale 291652d75f Merge branch 'babalae:main' into auto-music 2025-01-08 11:46:38 +08:00
辉鸭蛋 828d673509 Merge pull request #983 from physligl/main
修复地图移动的一些已知问题
2025-01-08 01:16:07 +08:00
秋云 b92c52cb5c 合并。 2025-01-08 00:56:31 +08:00
秋云 e11af29b45 Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-08 00:54:03 +08:00
秋云 b9dd66f87a 合并。 2025-01-08 00:53:49 +08:00
秋云 65e2da4123 Merge branch 'babalae:main' into main 2025-01-08 00:47:42 +08:00
秋云 a85129b087 修复移动地图时概率持续点击标记。 2025-01-08 00:47:07 +08:00
辉鸭蛋 be31d0962f Merge pull request #976 from Womsxd/fix/nested-directories-installer
fix(Setup): 修复BGI安装包多一层文件夹
2025-01-07 23:34:26 +08:00
NextKale 64efabde8f auto music 2025-01-07 23:06:51 +08:00
NextKale a0993b172b Merge branch 'main' of github.com:atiasn/better-genshin-impact 2025-01-07 22:41:00 +08:00
辉鸭蛋 2a6f8fcab2 Merge pull request #980 from HZYgrandma/patch-5
Update README.md
2025-01-07 16:18:00 +08:00
洪籽阳外婆 887e812b28 Update README.md 2025-01-07 14:57:05 +08:00
Womsxd 48b51a60e1 fix(Setup): 修复BGI安装包多一层文件夹 2025-01-07 11:49:05 +08:00
辉鸭蛋 3fb35051d1 update UnityLogGameLocator 2025-01-07 01:08:52 +08:00
秋云 e2530a1001 Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-07 01:03:20 +08:00
辉鸭蛋 07b8899a51 auto domain: extend the waiting time 2025-01-07 00:33:21 +08:00
辉鸭蛋 55fb63782e remove force team names 2025-01-07 00:22:51 +08:00
辉鸭蛋 1b46502374 0.39.2 2025-01-07 00:19:07 +08:00
辉鸭蛋 580c4754a4 Merge pull request #914 from mfkvfhpdx/main
路径追踪支持 未知界面检查关闭,主要用来解决狗粮、或锄地捡物品,有小概率误触烹饪界面的问题。
2025-01-07 00:17:03 +08:00
辉鸭蛋 30827b2ff4 fix conflicts 2025-01-07 00:14:39 +08:00
辉鸭蛋 9f46fb00be Merge branch 'main' into main 2025-01-07 00:12:41 +08:00
辉鸭蛋 b0236a7a04 Merge pull request #956 from Ayu0K/feat/key-binding-config
[feature] 添加按键绑定自定义功能
2025-01-07 00:09:38 +08:00
Ayu0K 608f135640 mod: 修改打开派蒙界面的按键,使其支持改键 2025-01-06 23:59:55 +08:00
辉鸭蛋 b776ec73a4 Merge pull request #973 from chisato2233/main
美化了部分窗口表现
2025-01-06 23:46:51 +08:00
Ayu0K 2bf74c466b fix: 删除了中途更改全局改键功能的实现方式时遗留的无用代码 2025-01-06 23:30:36 +08:00
辉鸭蛋 76829bd3e1 Merge branch 'main' into feat/key-binding-config 2025-01-06 23:24:09 +08:00
Ayu0K 00ece6ce7a mod: 修改了界面绑定设置UI的描述 2025-01-06 22:55:08 +08:00
Ayu0K 71876a5e65 mod: 更改开书按键 2025-01-06 22:55:08 +08:00
Ayu0K 89109958a2 mod: 更改纪行按键 2025-01-06 22:55:08 +08:00
Ayu0K d179eb9949 mod: 修改剧情选项交互按键 2025-01-06 22:55:08 +08:00
Ayu0K be98f10851 mod: 修改按键方式 2025-01-06 22:55:08 +08:00
Ayu0K 6067058530 mod: 更改移动、跳跃、下落的方式 2025-01-06 22:55:08 +08:00
Ayu0K 19f1315d0a mod: 更改打开任务菜单、开启任务追踪、控制角色前进的方法 2025-01-06 22:55:08 +08:00
Ayu0K 56e4dc2dd6 mod: 修改控制角色前进的方法 2025-01-06 22:55:08 +08:00
Ayu0K e37be52f0e mod: 修改向前移动和跳起的方式 2025-01-06 22:55:08 +08:00
Ayu0K 543e36f77e mod: 更改打开地图的方式 2025-01-06 22:55:08 +08:00
Ayu0K 3b54844e6b mod: 修改打开背包的方式 2025-01-06 22:55:08 +08:00
Ayu0K 8822346f3b mod: 修改ScanPickTask控制角色向前的方式 2025-01-06 22:55:08 +08:00
Ayu0K d54d31454d mod: 修改SwitchPartyTask打开编队界面的方式 2025-01-06 22:55:08 +08:00
Ayu0K 5f525f82d7 mod: 修改QuickSereniteaPotTask发送虚拟按键的方式 2025-01-06 22:55:08 +08:00
Ayu0K f78d7bfcec mod: 修改PathExecutor发送虚拟按键的方式 2025-01-06 22:55:08 +08:00
Ayu0K 2e331dbbc6 fix: 修改了KeyBindingSettingModel的命名空间 2025-01-06 22:55:08 +08:00
Ayu0K f77251551e mod: 修改115行中写死的VK_F为PickVK 2025-01-06 22:55:08 +08:00
Ayu0K 68d6cb18ef mod: 替换为使用扩展方法,不直接调用SimulateKeyHelper 2025-01-06 22:55:07 +08:00
Ayu0K 6d430429f7 add: 为GIActions扩展转换为KeyId的方法 2025-01-06 22:55:07 +08:00
Ayu0K bd811b1bdf mod: 使用新方案替代直接从KeyBindingsConfig中取值 2025-01-06 22:55:07 +08:00
Ayu0K 15f363196c mod: 使用新方案替代直接从KeyBindings中读取按键 2025-01-06 22:55:07 +08:00
Ayu0K c904ae5150 mod: 使用新方案改写自动战斗逻辑Avatar 2025-01-06 22:55:07 +08:00
Ayu0K c7e2d83fb8 mod: 使用新方案改写AutoFightTask 2025-01-06 22:55:07 +08:00
Ayu0K a11639f243 mod: 使用新的方案改写AutoDomain 2025-01-06 22:55:07 +08:00
Ayu0K 19558c9c53 add&mod: 将SimulateAction改为扩展方法,不再继承PostMessageSimulator和InputSimulatorExtension;对于部分不支持的按键和功能(如PostMessageSimulator中的鼠标侧键)予以忽略处理 2025-01-06 22:55:07 +08:00
Ayu0K b183762df7 行尾字符标准化 2025-01-06 22:55:07 +08:00
Ayu0K b32b0f8af1 fix: 监听按键松开时未使用配置的值 2025-01-06 22:55:07 +08:00
Ayu0K daf2b3d1ba add: 添加Simulation2用于根据需要的操作进行按键 2025-01-06 22:55:07 +08:00
Ayu0K c4b705c350 mod: 修改UpDownGrabLeaf中的抓取四叶印(某些模式下的交互)按键,直接使用KeyBindingsConfig中的值 2025-01-06 22:55:07 +08:00
Ayu0K e7d76cdae1 mod: 修改PickAroundHandler,直接使用KeyBindings中的值 2025-01-06 22:55:07 +08:00
Ayu0K 8d577050d1 mod: 修改NahidaCollectHandler中元素战技的按键,直接从KeyBindingsConfig中获取值 2025-01-06 22:55:07 +08:00
Ayu0K 242832edc9 mod: 修改ElementalSkillHandler使用的按键,直接获取KeyBindingsConfig中的值 2025-01-06 22:55:07 +08:00
Ayu0K e39eb9ef93 mod: 修改AutoFight下Avatar(角色战斗逻辑)中的按键,由于该类不是Base On ISoloTask接口的,因此将读取配置文件的操作放在构造函数中。 2025-01-06 22:55:07 +08:00
Ayu0K 2db2c1957a mod: 为连发功能提供改键支持 2025-01-06 22:55:07 +08:00
Ayu0K 60ccbfbace fix: 删除不需要的异常处理结构 2025-01-06 22:55:07 +08:00
Ayu0K 5786ba7634 mod: 修改提示文本 2025-01-06 22:55:07 +08:00
Ayu0K bc6970b6c5 mod: 更改KeyBindingTextBox的行为,在获得焦点时显示输入提示,并忽略取得焦点前的鼠标左键单击事件 2025-01-06 22:55:07 +08:00
Ayu0K 06ee8ab1cc mod: 修改了注释 2025-01-06 22:55:07 +08:00
Ayu0K ac866f9293 fix: 按键名称Unknown 2025-01-06 22:55:07 +08:00
Ayu0K ca3b31f84e mod: 将按键设置与VK解耦合,并提供KeyId向WPF按键、WPF鼠标按键以及VK的互相转换。 2025-01-06 22:55:07 +08:00
Ayu0K a80f6fc423 fix: 修改VK_OEM_PLUS对应的按键名称 2025-01-06 22:55:07 +08:00
Ayu0K 4cfff57b2c mod: 修改AutoFightTask中检测战斗结束使用的打开编队界面和取消攀爬的按键为KeyBindingsConfig记录的按键;修改方案参考AutoWood,在调用Start方法时将该模块需要用到的按键从KeyBindingsConfig中取出 2025-01-06 22:55:07 +08:00
Ayu0K 114a84a9e8 fix: 修正默认的编队键位 2025-01-06 22:55:07 +08:00
Ayu0K 9fa2bcb5a7 mod: 将AutoDomain启动秘境与领取奖励的识别目标和拾取按键与AutoPick统一 2025-01-06 22:55:07 +08:00
Ayu0K 5d80d6d53b mod: 修改AutoDomain中角色移动(用于支持非QWERTY布局的键盘)、冲刺、吃药的按键为KeyBindingsConfig记录的按键;修改方案参考AutoWood,在调用Start方法时将该模块需要用到的按键从KeyBindingsConfig中取出 2025-01-06 22:55:07 +08:00
Ayu0K 5a19b7d2ef mod: 将AutoDomain启动秘境与领取奖励的识别目标和拾取按键与AutoPick统一 2025-01-06 22:55:07 +08:00
Ayu0K accd0280bb add: 添加从注册表中读取按键的功能(待完善:星之归还、隐藏UI按键无法获取;拾取按键、派蒙菜单按键可能存在错误) 2025-01-06 22:55:07 +08:00
Ayu0K 317a526f16 add: 按键绑定的GUI实现(初步) 2025-01-06 22:55:07 +08:00
Ayu0K 8dd6131c94 add: 集成按键绑定配置 2025-01-06 22:55:07 +08:00
Feiran Zhang 0a04734a40 添加茜特菈莉作为循环短E角色 2025-01-06 22:55:07 +08:00
辉鸭蛋 38e5de35a2 Delete 1岩水雷火四神.txt 2025-01-06 22:55:07 +08:00
洪籽阳外婆 5353231810 Update README.md
Update Screenshot
2025-01-06 22:55:07 +08:00
秋云 476f36a19a 确保传送任务开始前一定位于地图界面。 2025-01-06 22:55:07 +08:00
Baisbt 8a6bb597c4 Add files via upload 2025-01-06 22:55:07 +08:00
masm611 b90a6c4227 修正windows10_1909版本WGC故障
windows10_1909版本的WGC不支持IsCursorCaptureEnabled,加了个动态判断防止异常与抓屏失败等。
但是这样就有可能会抓到光标导致图像识别失败,但是个人认为瘦死的骆驼比马大,没有这个api就不调用即可,好歹还能用一下
如果有必要,后面可以考虑加一个弹窗警告一下啥的,但是这样可能会让用户糟心,总不能逼人家换个系统吧?但是不弹窗呢又好像向用户隐藏了某些可能存在的错误,好像又不太对啥的。
只能说云原神的限制还是大了一点,要不要加弹窗我无法决策,还是由大佬来吧
2025-01-06 22:55:07 +08:00
辉鸭蛋 0650bebefa fix genshin install path get 2025-01-06 22:55:07 +08:00
__Chisato__ 6536cad9fd 增加了更改窗口模糊的选项 2025-01-06 20:11:51 +08:00
__Chisato__ 63d7d230dc 优化了PickerWindow的表现效果 2025-01-06 18:35:11 +08:00
zjl abea63bcda Merge branch 'main' of https://github.com/mfkvfhpdx/better-genshin-impact 2025-01-06 14:24:16 +08:00
zjl 653df2f7cc 去掉一个信息提示 2025-01-06 14:22:34 +08:00
zjl ebc8870478 调度器,更多功能中增加日志分析,以列表形式展示配置组耗时和拾取物。 2025-01-06 14:20:05 +08:00
mfkvfhpdx 958c5ab7cd Merge branch 'babalae:main' into main 2025-01-06 14:08:08 +08:00
秋云 99831beb40 修复了地图移动的时候狂点标记问题,修复了移动次数从0开始计算的问题。 2025-01-06 11:51:14 +08:00
辉鸭蛋 a7fae09464 Merge pull request #969 from zhangfeiran/patch-1
添加茜特菈莉作为循环短E角色
2025-01-06 03:22:11 +08:00
Feiran Zhang 57a83cc171 添加茜特菈莉作为循环短E角色 2025-01-06 03:00:04 +08:00
辉鸭蛋 f0af8134ce Delete 1岩水雷火四神.txt 2025-01-05 19:09:59 +08:00
辉鸭蛋 463555c054 Merge pull request #960 from HZYgrandma/patch-3
Update README.md
2025-01-05 18:58:19 +08:00
洪籽阳外婆 01eaa190d8 Update README.md
Update Screenshot
2025-01-05 18:54:35 +08:00
辉鸭蛋 0c487dafd4 Merge pull request #948 from physligl/main
确保传送任务开始前一定位于地图界面。
2025-01-05 17:39:48 +08:00
zjl 1f6e3b78a5 去掉异常处理中的派蒙检查,对于战斗脚本,结束后会误触发 2025-01-05 15:08:50 +08:00
辉鸭蛋 a7da741342 Merge remote-tracking branch 'origin/main' 2025-01-05 14:58:58 +08:00
辉鸭蛋 a57aed9ce7 fix genshin install path get 2025-01-05 14:57:54 +08:00
zjl aa164adb52 Merge remote-tracking branch 'origin/main' 2025-01-05 14:57:46 +08:00
zjl e8b939fbee 未知界面检查常驻于pathing中,去除了该可配置项,以支持js中的路径追踪。pathing逻辑用try块包了起来,最后finally保证,额外开启的线程必定关闭。异常界面检查,当不存在派蒙时尝试按ESC(即使判断错误,也会由未知界面检查,关闭该弹出)。 2025-01-05 14:57:32 +08:00
mfkvfhpdx d872b511d0 Merge branch 'babalae:main' into main 2025-01-05 14:31:16 +08:00
辉鸭蛋 c2dbbe85cd Merge pull request #949 from Baisbt/main
战斗脚本:岩水雷火四神
2025-01-05 13:09:35 +08:00
辉鸭蛋 a75cc84773 Merge pull request #954 from masm611/main
修正windows10_1909版本WGC故障
2025-01-05 13:05:02 +08:00
masm611 1ceb991c1b 修正windows10_1909版本WGC故障
windows10_1909版本的WGC不支持IsCursorCaptureEnabled,加了个动态判断防止异常与抓屏失败等。
但是这样就有可能会抓到光标导致图像识别失败,但是个人认为瘦死的骆驼比马大,没有这个api就不调用即可,好歹还能用一下
如果有必要,后面可以考虑加一个弹窗警告一下啥的,但是这样可能会让用户糟心,总不能逼人家换个系统吧?但是不弹窗呢又好像向用户隐藏了某些可能存在的错误,好像又不太对啥的。
只能说云原神的限制还是大了一点,要不要加弹窗我无法决策,还是由大佬来吧
2025-01-05 12:53:03 +08:00
NextKale 1226f85196 Merge branch 'main' of github.com:atiasn/better-genshin-impact 2025-01-05 11:35:09 +08:00
Baisbt e3a5c491be Add files via upload 2025-01-05 02:36:00 +08:00
秋云 7137e52605 确保传送任务开始前一定位于地图界面。 2025-01-05 01:57:16 +08:00
zjl 3174dc75c8 删除了错误的注释 2025-01-03 20:51:25 +08:00
zjl 4c0d9955b3 阵亡后,重试该路线。但重试,准备传回来时,有几率未打开地图界面,导致传送失败,所以加了每次重试都检查是否打开地图界面。 2025-01-03 20:50:50 +08:00
zjl 8345eb4bdc Merge remote-tracking branch 'origin/main' 2025-01-03 20:14:07 +08:00
zjl 57953933d3 由于地图关闭按钮和烹饪关闭按钮一样,无法作为通用判断,所以依旧使用单个界面检查,调整了检查烹饪的图片范围,增加了按ESC出uid的那个界面也会ESC返回,未知界面检查默认开启。 2025-01-03 20:13:51 +08:00
mfkvfhpdx a0af8405b7 Merge branch 'babalae:main' into main 2025-01-03 08:32:50 +08:00
辉鸭蛋 e6e549814d Merge remote-tracking branch 'origin/main' 2025-01-02 22:51:04 +08:00
辉鸭蛋 c80799cbee 0.39.1 & fix some bug 2025-01-02 22:49:38 +08:00
辉鸭蛋 c2fce8618d Merge pull request #916 from haokaiyang/main
auto tcg: update character card config to v5.3
2025-01-02 12:50:07 +08:00
haokaiyang 663277a990 auto tcg: update character card config to v5.3 2025-01-02 11:55:57 +08:00
mfkvfhpdx 3d775241cc Merge branch 'babalae:main' into main 2025-01-02 07:30:31 +08:00
辉鸭蛋 c0fecd079e 0.39.0 2025-01-02 01:16:05 +08:00
辉鸭蛋 97f1000370 fix auto album task end 2025-01-02 01:15:31 +08:00
辉鸭蛋 02f2c1321a auto album 2025-01-02 01:05:03 +08:00
辉鸭蛋 f9d0bd4521 music test 2025-01-01 23:08:01 +08:00
辉鸭蛋 5e929d3d07 fix walk to domain 2025-01-01 23:07:12 +08:00
zjl b52af1e9a7 把检查移入pathing中,对烹饪做了二次判断,第一可能会在战斗时,误判 2025-01-01 22:15:53 +08:00
mfkvfhpdx 942bb3a6dd Merge branch 'babalae:main' into main 2025-01-01 20:56:24 +08:00
zjl 3eecea21aa 路径追踪支持 未知界面检查关闭,主要用来解决狗粮、或锄地捡物品,有小概率误触烹饪界面的问题。 2025-01-01 20:54:19 +08:00
辉鸭蛋 3c393087eb auto music opt 2025-01-01 19:34:39 +08:00
辉鸭蛋 85c7707c7a avatar 5.3 2025-01-01 19:33:14 +08:00
辉鸭蛋 a41a0bdba1 5.3 avatar 2025-01-01 14:10:02 +08:00
辉鸭蛋 5de2067489 auto music opt 2025-01-01 13:59:06 +08:00
辉鸭蛋 c95343e953 #846 daily reward party 2025-01-01 10:48:29 +08:00
mfkvfhpdx f34e6c3530 当最后出招人为万叶,并且剩余cd>3时,跳过此次万叶拾取 (#906) 2025-01-01 09:20:08 +08:00
辉鸭蛋 2d3395b491 typo & ui 2025-01-01 01:52:41 +08:00
zjl ed3cbd47f5 当最后出招人为万叶,并且剩余cd>3时,跳过此次万叶拾取 2024-12-31 22:33:45 +08:00
辉鸭蛋 d86959297c fix skip blessing of the welkin moon 2024-12-31 01:50:38 +08:00
辉鸭蛋 726863462a 0.38.1 2024-12-31 01:00:09 +08:00
辉鸭蛋 9971817e44 fixed #609 2024-12-31 00:59:48 +08:00
辉鸭蛋 bfeaa1b14a fix pathing bug 2024-12-31 00:44:27 +08:00
秋云 71fa4eaf3a Merge pull request #899 from physligl/main
新的传送点数据集 @Limint
2024-12-31 00:28:34 +08:00
辉鸭蛋 9049c85be7 Merge pull request #897 from mfkvfhpdx/main
修正开启万叶拾取后,不生效的问题。修正战斗检查时间的换算问题,以及一个逻辑判断问题。
2024-12-30 22:23:03 +08:00
zjl ac85cda170 修正开启万叶拾取后,不生效的问题。修正战斗检查时间的换算问题,以及一个逻辑判断问题。 2024-12-30 21:42:03 +08:00
辉鸭蛋 178d253c38 Merge pull request #894 from greepar/greepar-patch-3
修复虹灵的净土秘境消失的问题
2024-12-30 14:08:15 +08:00
greepar 8ba5b16710 Update tp.json
修复了自动秘境中纳塔-虹灵的净土秘境消失的问题
2024-12-30 12:26:40 +08:00
辉鸭蛋 25373cac2a 0.38 2024-12-30 00:12:01 +08:00
辉鸭蛋 2411e1dbef Merge remote-tracking branch 'origin/main' 2024-12-29 22:04:09 +08:00
辉鸭蛋 4118e7b6f2 opt 2024-12-29 22:03:26 +08:00
辉鸭蛋 d6c4f5ab57 Merge pull request #892 from mfkvfhpdx/main
战斗未检查成功时,如果按空格会跳跃,导致队伍切换失败。改成x后,应不会影响其他操作
2024-12-29 21:40:26 +08:00
zjl ac2c7e7ac7 战斗未检查成功时,如果按空格会跳跃,导致队伍切换失败。改成x后,应不会影响其他操作 2024-12-29 21:13:22 +08:00
辉鸭蛋 07e5ea643a Merge pull request #891 from mfkvfhpdx/main
增加针对战斗的细化配置
2024-12-29 21:04:24 +08:00
mfkvfhpdx f4f9f22977 Merge branch 'babalae:main' into main 2024-12-29 21:01:27 +08:00
zjl e6c8804b09 1、判断战斗结束、万叶捡材料、自动拾取,三个配置独立执行。
2、增加 更快检查结束战斗配置,可以根据时间或角色,在一轮角本未走完情况下检查,而加快检查战斗速度。
3、增加了万叶拾取的配置
4、增加 检查战斗结束的延时 ,可根据不同人物更精细的制定策略。
2024-12-29 20:59:05 +08:00
辉鸭蛋 d71ff06868 fix domain and map retry 2024-12-29 20:54:31 +08:00
辉鸭蛋 741da4e0c7 #869 2024-12-29 20:22:00 +08:00
辉鸭蛋 a66b802bbd fixed #661 2024-12-29 19:00:26 +08:00
辉鸭蛋 60f1a271c4 Merge remote-tracking branch 'origin/main' 2024-12-29 18:07:32 +08:00
辉鸭蛋 2396daf206 #767 2024-12-29 18:07:00 +08:00
辉鸭蛋 d8f06598aa Merge pull request #890 from physligl/main
更新5.2的传送锚点和神像。
2024-12-29 17:16:13 +08:00
辉鸭蛋 6127fab70b auto domain retry 2024-12-29 17:10:02 +08:00
辉鸭蛋 6432ff1aed fix key mouse 2024-12-29 17:08:08 +08:00
秋云 0670fd9c0d fix typos 2024-12-29 16:37:32 +08:00
秋云 c14025181c 更新5.2的传送锚点和神像。 2024-12-29 16:31:57 +08:00
辉鸭蛋 2b658afad6 fix the character is still fighting after resurrection 2024-12-29 16:27:14 +08:00
辉鸭蛋 54eecbe046 ui & log 2024-12-29 16:20:27 +08:00
辉鸭蛋 9d807e1e42 1. walk to F 2. auto music 2024-12-29 16:02:35 +08:00
辉鸭蛋 c3ef67f57a Merge branch 'pr/884' 2024-12-29 00:52:01 +08:00
辉鸭蛋 13f3272b9c Merge pull request #887 from physligl/main
优化鼠标移动逻辑。
2024-12-29 00:48:50 +08:00
辉鸭蛋 7e04d77f88 kazuha e hold when fight end 2024-12-29 00:28:53 +08:00
秋云 8f1cf62449 优化鼠标移动逻辑。 2024-12-29 00:20:56 +08:00
辉鸭蛋 cad2cf039d more daily path 2024-12-29 00:08:29 +08:00
辉鸭蛋 215f2ce450 Merge pull request #884 from mfkvfhpdx/main
路径追踪支持战斗配置
2024-12-28 23:02:17 +08:00
辉鸭蛋 0a5c78ebbe code format 2024-12-28 23:01:22 +08:00
辉鸭蛋 f9671467fc fix script control low level check 2024-12-28 22:32:44 +08:00
辉鸭蛋 621a91638a support weekly domain config 2024-12-28 22:06:50 +08:00
秋云 34d0917818 合并分支。 2024-12-28 22:05:12 +08:00
秋云 2b371cce33 fix typos. 2024-12-28 22:01:06 +08:00
mfkvfhpdx 510ca82304 Merge branch 'babalae:main' into main 2024-12-28 21:48:21 +08:00
辉鸭蛋 b83017f52e add GetBigMapZoomLevel 2024-12-28 21:29:42 +08:00
秋云 dd6b26ae8d 提高了MouseMoveMap中最小的steps数量以避免除0错误。 2024-12-28 19:22:03 +08:00
mfkvfhpdx cb19255fb4 Merge branch 'babalae:main' into main 2024-12-28 18:23:01 +08:00
辉鸭蛋 71f2c2f52e Merge pull request #885 from physligl/main
fix typos.
2024-12-28 18:21:51 +08:00
秋云 5d780ec4f8 fix typos. 2024-12-28 18:10:48 +08:00
mfkvfhpdx a091bb6734 Merge remote-tracking branch 'origin/main' 2024-12-28 17:21:14 +08:00
mfkvfhpdx 81a7518f72 暂停后按下的键会释放,增加战斗检查偏色配置,由于跟队伍无关,只在独立任务,自动战斗处设置。 2024-12-28 17:12:47 +08:00
mfkvfhpdx 340a3142e5 Merge branch 'babalae:main' into main 2024-12-28 06:16:34 +08:00
辉鸭蛋 dfad3022c2 Merge pull request #882 from physligl/main
修复移动地图时遇到的部分问题
2024-12-28 00:39:55 +08:00
秋云 bb8ccd2297 fix typos. 2024-12-27 23:57:00 +08:00
秋云 17282a3cef 回退修改。 2024-12-27 23:51:40 +08:00
mfkvfhpdx bb7d84ffe3 战斗配置增加超时,调度器增加清空功能 2024-12-27 23:47:58 +08:00
秋云 28ceb3dd85 未知原因导致合并冲突。 2024-12-27 23:24:14 +08:00
秋云 ce75d038b2 修复地图移动前伟打开主界面的问题(上个修改导致)。限制地图最小缩放等级,以节约时间。合并冲突。 2024-12-27 23:21:22 +08:00
秋云 17dd19aa47 合并冲突。 2024-12-27 23:08:59 +08:00
unknown a861a335ac 1. 修复移动到部分传送点时经过开放区域导致移动失败的问题。2. 修复因为初始地图缩放等级过大无法点击传送点的问题。 2024-12-27 22:54:47 +08:00
mfkvfhpdx c439403231 Merge branch 'babalae:main' into main 2024-12-27 21:48:28 +08:00
zjl a63ed2f2d2 路径追踪支持可配置 2024-12-27 21:46:52 +08:00
辉鸭蛋 c9634abebb fix install path get 2024-12-27 02:37:46 +08:00
辉鸭蛋 1214ca2d65 Merge remote-tracking branch 'origin/main' 2024-12-27 00:58:33 +08:00
辉鸭蛋 dc853f2307 new game path loader 2024-12-27 00:57:18 +08:00
辉鸭蛋 875058ae5b Merge pull request #876 from physligl/main
修复地图移动的已知问题。
2024-12-25 00:28:59 +08:00
辉鸭蛋 e9d715876b Merge pull request #874 from mfkvfhpdx/main
降低L识别结束精度,更快的检查战斗结束。
2024-12-25 00:27:49 +08:00
unknown 57bcb3cd6b 修复地图移动的已知问题。 2024-12-25 00:24:08 +08:00
unknown ff993f642f Revert "修复地图移动的已知问题。"
This reverts commit 4aa8c69d0e.
2024-12-25 00:19:42 +08:00
unknown 4aa8c69d0e 修复地图移动的已知问题。 2024-12-25 00:17:39 +08:00
mfkvfhpdx 7511ccc637 Merge branch 'babalae:main' into main 2024-12-24 18:30:23 +08:00
辉鸭蛋 e9d206eca0 0.37.8 2024-12-24 01:33:55 +08:00
辉鸭蛋 88110a21cc ui: more script repo button 2024-12-24 01:33:28 +08:00
辉鸭蛋 84c7fcec21 fix ui bug 2024-12-24 01:26:11 +08:00
zjl b19adcfba4 更快的检查战斗结束,以及降低L识别结束精度。 2024-12-23 23:37:56 +08:00
辉鸭蛋 404457922d 0.37.7 2024-12-23 00:38:02 +08:00
辉鸭蛋 733e5fb98a more settings 2024-12-23 00:37:04 +08:00
辉鸭蛋 a04d2e437a persistent configuration 2024-12-23 00:01:51 +08:00
辉鸭蛋 08b921b982 one dragon configs 2024-12-22 23:24:11 +08:00
辉鸭蛋 e6e78aded0 fix pathing config ineffective 2024-12-22 21:07:06 +08:00
辉鸭蛋 df600c6016 start game when start one dragon 2024-12-22 20:52:39 +08:00
辉鸭蛋 d374a95bb8 new game loading 2024-12-22 14:56:25 +08:00
辉鸭蛋 f5e8edccb8 collapse multiple checkboxes and add filter 2024-12-22 00:17:34 +08:00
辉鸭蛋 f690bc849b Merge pull request #868 from physligl/main
降低鼠标后半部分移动速度,以避免惯性,作为补偿前面一半的速度变快了。
2024-12-21 18:57:16 +08:00
unknown c3c272c241 降低鼠标后半部分移动速度,以避免惯性,作为补偿前面一半的速度变快了。 2024-12-21 16:20:58 +08:00
辉鸭蛋 537f647ba7 fix auto skip plot when pathing 2024-12-21 15:19:01 +08:00
辉鸭蛋 ca353fea70 remove log 2024-12-21 15:06:52 +08:00
辉鸭蛋 9bf82a1bbb Merge pull request #861 from mfkvfhpdx/main
参考失焦,增加了快捷键暂停。调度器任务支持从指定任务开始(右键 下一个任务从此执行,重启软件,或取出待执行任务后,该状态将会清空)。
2024-12-21 14:41:42 +08:00
辉鸭蛋 e497f6ec79 1. 抽离部分内部类,格式化代码
2. ValueTuple 已过时,元组建议使用 ()
3. 暂停变量不建议放在 TaskContext.Instance().Config.Suspend 中,会被持久化到配置内
4. 修改一些方法和变量的存放位置
2024-12-21 14:35:42 +08:00
zjl 36e49bcbc7 1、战斗优化,只保留按L的情况下
2、暂停功能根据点位状态记录,支持暂停后,当判断路径过于远时,会不消耗重试次数重试此任务
3、重试点位时,将只保留跑图的那部分,跳过如打架、挖矿等操作,提升效率
2024-12-21 12:49:39 +08:00
mfkvfhpdx 7c1568a809 Merge branch 'babalae:main' into main 2024-12-20 20:14:43 +08:00
zjl b99144cd3d 调整暂停为sleep方式,能一直维持,除了离开太远,会跳过当前任务,应该没多大问题。低血量尝试队伍回血。调度器右键重命名。 2024-12-20 20:13:51 +08:00
辉鸭蛋 d5d65b7820 use system tick count instead of DateTime 2024-12-20 02:52:00 +08:00
zjl 7d04997300 去掉遗留的注释 2024-12-17 23:16:33 +08:00
zjl 36cbd168ed Merge branch 'main' of https://github.com/mfkvfhpdx/better-genshin-impact 2024-12-17 23:14:55 +08:00
zjl 5162bcc88f 参考失焦,增加了快捷键暂停。调度器任务支持从指定任务开始(右键 下一个任务从此执行,重启软件,或取出待执行任务后,该状态将会清空)。 2024-12-17 23:12:56 +08:00
zjl 1a2cdbbfd7 参考失焦,简易的实现了快捷键暂停。调度器任务配置支持指定下一次从某个任务开始执行。右键下一次从此任务开始执行,同时名称颜色变绿。重启软件,或执行过滤操作后,清空该状态。 2024-12-17 23:06:30 +08:00
辉鸭蛋 ec8fa6e824 KeyDown -> KeyUp 2024-12-14 20:52:19 +08:00
辉鸭蛋 3266b63187 alt use sendInput 2024-12-14 19:56:38 +08:00
辉鸭蛋 294d096229 fixed Alt does not take effect when playing macros 2024-12-14 18:59:16 +08:00
辉鸭蛋 48b5ab8af6 macro: add mouse wheel 2024-12-14 18:40:14 +08:00
辉鸭蛋 e00b38eb66 remove library 2024-12-14 01:23:26 +08:00
辉鸭蛋 0c435a9393 fix #852 2024-12-13 02:23:57 +08:00
辉鸭蛋 3ca7ab6d4c Merge pull request #851 from physligl/main
修复部分已知问题,调快了鼠标移动速度。
2024-12-12 01:09:15 +08:00
unknown c480cf484e 同上 2024-12-11 05:04:32 +08:00
unknown 2ce4e6d665 同上 2024-12-11 04:47:31 +08:00
unknown 7b158c442e 由于修改,默认初始zoomLevel=4,部分传送点识别到之后无法点击传送,原因未知,修改之后识别和点击传送点基本都在zoomLevel=2的时候执行。 2024-12-11 04:20:55 +08:00
unknown 9180b58d94 修复部分已知问题,调快了鼠标移动速度,无需再担忧寻找传送点的苦恼。 2024-12-11 02:43:25 +08:00
辉鸭蛋 5b8caef75a one dragon : 0.37.4 2024-12-11 00:00:49 +08:00
辉鸭蛋 c22edcd39a pathing: dash behind press E, and don't press E when it's too close to the target point
疾跑放在开E后面,离目标点过近的时候不再开E
2024-12-10 23:58:49 +08:00
辉鸭蛋 7e88c9a57d Merge pull request #848 from physligl/main
修改了缩放的逻辑,以及因为缩放导致的bug
2024-12-10 22:05:53 +08:00
unknown 49fc8ed260 清理部分变量 2024-12-10 04:48:02 +08:00
unknown f37d1d34a6 修改了缩放的逻辑,并且缩放后更新鼠标移动的距离,避免因为缩放导致移动距离不够或者过多。 2024-12-10 04:38:02 +08:00
unknown 76dd2f3903 修改了缩放的逻辑,并且缩放后更新鼠标移动的距离,避免因为缩放导致移动距离不够或者过多。 2024-12-10 04:32:58 +08:00
辉鸭蛋 5e94037722 Merge pull request #847 from physligl/main
修改传送过程中移动到目标传送点的逻辑。
2024-12-10 01:20:41 +08:00
unknown 57610a3945 修改传送过程中移动到目标传送点的逻辑。 2024-12-10 01:13:31 +08:00
辉鸭蛋 11dda84592 pick drops 2024-12-09 00:57:17 +08:00
辉鸭蛋 b600d577c4 fix action params not valid 2024-12-08 15:29:06 +08:00
辉鸭蛋 dd19afaca5 update ui 2024-12-08 00:46:48 +08:00
辉鸭蛋 c2cd6dbe9c pathing: pre judgment of recovery
* 强制判断分辨率
* 切换队伍前判断是否需要复苏
2024-12-07 01:47:01 +08:00
辉鸭蛋 c059611edb update ui 2024-12-06 00:32:52 +08:00
辉鸭蛋 7ebbfda15d fix mail reward 2024-12-05 00:11:33 +08:00
辉鸭蛋 54887b90f6 fix daily reward collection judgment 2024-12-04 23:06:17 +08:00
辉鸭蛋 77cfcbe73f fix big map tp shielded area 2024-12-04 01:59:36 +08:00
辉鸭蛋 f3e16fbb77 fixed #837 2024-12-04 01:58:50 +08:00
辉鸭蛋 99c8cd450e add claim mail 2024-12-04 01:33:17 +08:00
辉鸭蛋 dffccd0740 fix auto domain camera bug 2024-12-02 23:40:54 +08:00
辉鸭蛋 6cfa4b27a6 Merge pull request #835 from babalae/feat/new-camera
new camera orientation algorithm
2024-12-02 22:55:21 +08:00
辉鸭蛋 e2a25e4492 new camera orientation algorithm by https://github.com/Limint 2024-12-02 22:53:40 +08:00
辉鸭蛋 b6220db756 update 2024-12-02 22:13:46 +08:00
辉鸭蛋 958703dcd7 V3 test 2024-12-01 23:52:34 +08:00
辉鸭蛋 c182ec13f9 init V3 2024-12-01 23:23:06 +08:00
辉鸭蛋 ff0533288a fix ClaimBattlePass 2024-12-01 22:56:41 +08:00
辉鸭蛋 2383761b5d more js methods to expose 2024-12-01 16:43:42 +08:00
辉鸭蛋 ebc6ed8e07 prevent shortcut key conflicts 2024-12-01 14:37:29 +08:00
辉鸭蛋 9ab518d593 v2 2024-11-30 18:10:26 +08:00
辉鸭蛋 df84cc9ef1 add auto claim Battle Pass rewards 2024-11-29 20:37:27 +08:00
辉鸭蛋 60bd96f1f4 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-11-29 01:42:23 +08:00
辉鸭蛋 d9faefd446 fix ArtifactSalvageTask 2024-11-29 01:37:41 +08:00
辉鸭蛋 19530e6c50 Merge pull request #821 from OPPO9008/patch-1
添加纳塔训练大师名字
2024-11-27 17:15:28 +08:00
OPPO9008 842f8506a5 添加纳塔训练大师名字 2024-11-27 11:46:09 +08:00
辉鸭蛋 2083caa9d7 one dragon: params opt 2024-11-26 23:47:40 +08:00
辉鸭蛋 67a418b984 one dragon: task series connection 2024-11-26 00:46:38 +08:00
辉鸭蛋 216c78d4d5 0.37.2 2024-11-25 22:50:45 +08:00
辉鸭蛋 fa1809a1f0 add PickAroundHandler action params 2024-11-25 22:37:19 +08:00
辉鸭蛋 fa9eacf4ac divide the path by tp point 2024-11-25 22:27:04 +08:00
辉鸭蛋 968048baa9 new PickAroundHandler @Limint 2024-11-25 22:04:02 +08:00
辉鸭蛋 436dfef2ee Merge remote-tracking branch 'origin/main' 2024-11-24 19:38:31 +08:00
辉鸭蛋 c2f81877dd Update bug.md 2024-11-24 19:38:12 +08:00
辉鸭蛋 0d6ab88c4a add ClaimEncounterPointsRewardsTask 2024-11-24 19:04:52 +08:00
辉鸭蛋 d7302b65c3 auto domain: tp & switch party & artifact salvage 2024-11-24 17:48:23 +08:00
辉鸭蛋 74acb4eb1c 0.37.1 2024-11-24 11:35:21 +08:00
辉鸭蛋 026dcd4488 auto domain: tp & switch party 2024-11-24 02:45:49 +08:00
辉鸭蛋 1cad8c3a00 pathing: config ui 2024-11-24 01:10:30 +08:00
辉鸭蛋 84629942bc pathing: use gadget #799 2024-11-24 00:49:49 +08:00
辉鸭蛋 a6f6ce55dd pathing: add OnlyInTeleportRecover config #779 2024-11-24 00:32:41 +08:00
辉鸭蛋 62a19c0052 auto pick: add black list #800 2024-11-24 00:01:32 +08:00
辉鸭蛋 3d63f18831 auto skip: background opt 2024-11-23 22:09:43 +08:00
辉鸭蛋 99c593cb7d 0.37.0 2024-11-23 19:44:00 +08:00
辉鸭蛋 93640f0b55 update: UI/UX 2024-11-23 14:03:25 +08:00
辉鸭蛋 2a2acb5b0d auto skip: background skip use key (5.2) 2024-11-23 00:49:11 +08:00
辉鸭蛋 382f31bbe7 auto domain: fix ocr region 2024-11-22 22:52:22 +08:00
辉鸭蛋 e3689cd21a ui opt 2024-11-22 22:36:32 +08:00
辉鸭蛋 258848edba new model 2024-11-22 22:18:02 +08:00
辉鸭蛋 0a5dc888a0 5.2 avatar + Yap model 2024-11-22 00:49:59 +08:00
辉鸭蛋 e27e22acaa 5.2 avatar 2024-11-22 00:29:54 +08:00
辉鸭蛋 a89af32560 pathing: fix bug, init mining 2024-11-22 00:23:21 +08:00
辉鸭蛋 d34d24cd5e fix auto domain skip 2024-11-21 23:41:32 +08:00
辉鸭蛋 175db6a792 Merge pull request #802 from babalae/feat/refine-ui
Refine Script Control Page
2024-11-21 17:25:03 +08:00
DismissedLight a8b105f7ee Refine Script Control Page 2024-11-21 17:11:04 +08:00
辉鸭蛋 142bf0a47f Merge pull request #801 from haokaiyang/main
auto tcg: update character card config to v5.2
2024-11-21 12:09:17 +08:00
haokaiyang 36c0fb0f13 auto tcg: update character card config to v5.2 2024-11-21 11:32:42 +08:00
辉鸭蛋 008f09cbe9 5.2 map 2024-11-20 22:49:35 +08:00
辉鸭蛋 7feb204789 fix stopfly not work 2024-11-18 23:07:25 +08:00
辉鸭蛋 d82859177f extend waiting time 2024-11-17 00:45:37 +08:00
辉鸭蛋 bbe1dc1968 0.36.4 2024-11-16 22:50:31 +08:00
辉鸭蛋 9580dd916a pathing: add action combat_script 2024-11-16 22:48:26 +08:00
辉鸭蛋 bb13aac0a9 fix rider error tips 2024-11-16 13:40:57 +08:00
辉鸭蛋 2c3352f1bc don't switch teams while online 2024-11-15 00:31:41 +08:00
辉鸭蛋 7a5efe208f pathing opt
在 `PathExecutor` 类中添加了 `EndAction` 和 `EndJudgment` 属性,用于判断路径追踪的结束条件,并在路径执行过程中调用 `ResolveAnomalies` 和 `EndJudgment` 方法处理异常和结束条件。处理 `NormalEndException` 异常并记录日志。检查游戏窗口分辨率,低于 1920x1080 记录错误日志。

更新 `冒险家协会_枫丹.json` 文件,将路径点类型从 `path` 修改为 `target`。

在 `GoToAdventurersGuildTask` 和 `GoToCraftingBenchTask` 类中,添加结束日志信息,移除交互代码,并添加 `EndAction` 属性判断任务结束条件。
2024-11-13 23:42:15 +08:00
辉鸭蛋 8941f6ce8c fix elemental collect avatar name
将“心海”更改为“珊瑚宫心海”。
将“万叶”更改为“枫原万叶”。
2024-11-13 23:00:26 +08:00
辉鸭蛋 b2db1e0b84 add GoToCraftingBenchTask
更新了 `BetterGenshinImpact.csproj` 文件中的程序集版本号,从 `0.36.2` 更新到 `0.36.3`。在 `ElementAssets.cs` 文件中,添加了 `CraftCondensedResin` 识别对象,并在 `ElementAssets` 类的构造函数中初始化了该对象。在 `ChooseTalkOptionTask.cs` 文件中,添加了 `BetterGenshinImpact.Core.Config` 的引用,并增加了在选项文本包含指定内容时保存截图的功能。修改了 `SelectLastOptionUntilEnd` 方法,增加了 `endAction` 参数和重试次数 `retry` 参数,并在循环中增加了对 `endAction` 的判断。修改了 `IsOrangeOption` 方法中的颜色阈值参数。在 `GoToAdventurersGuildTask.cs` 文件中,添加了 `Vanara.PInvoke` 的引用,并增加了等待对话界面的延迟时间和领取每日委托奖励后的点击操作。在 `HotKeyPageViewModel.cs` 文件中,修改了 `Test2Hotkey` 的回调函数,改为执行 `GoToCraftingBenchTask` 任务。

添加了多个命名空间引用,包括 `BetterGenshinImpact.Core.Config`、`BetterGenshinImpact.GameTask.AutoPathing`、`BetterGenshinImpact.GameTask.AutoPathing.Model`、`BetterGenshinImpact.GameTask.AutoSkip.Assets`、`BetterGenshinImpact.GameTask.AutoSkip`、`BetterGenshinImpact.GameTask.Common.BgiVision`、`Microsoft.Extensions.Logging`、`System`、`System.Threading`、`System.Threading.Tasks`、`BetterGenshinImpact.Core.Simulator`、`BetterGenshinImpact.GameTask.Common.Element.Assets` 和 `Vanara.PInvoke`。

新增了 `GoToCraftingBenchTask` 类,并定义了其命名空间 `BetterGenshinImpact.GameTask.Common.Job`。在 `GoToCraftingBenchTask` 类中,定义了 `Name` 属性,表示任务名称。定义了 `_retryTimes` 字段,表示重试次数。定义了 `_chooseTalkOptionTask` 字段,用于选择对话选项。新增了 `Start` 方法,接受 `country` 和 `CancellationToken` 参数,表示任务的开始。在 `Start` 方法中,添加了重试机制,调用 `DoOnce` 方法执行任务,并在异常情况下进行重试。新增了 `DoOnce` 方法,接受 `country` 和 `CancellationToken` 参数,表示单次任务的执行。在 `DoOnce` 方法中,定义了前往合成台、交互、等待合成界面、判断浓缩树脂是否存在等步骤。新增了 `GoToCraftingBench` 方法,接受 `country` 和 `CancellationToken` 参数,表示前往合成台的操作。在 `GoToCraftingBench` 方法中,使用 `PathingTask` 和 `PathExecutor` 执行路径任务。
2024-11-12 23:42:56 +08:00
辉鸭蛋 3c2739c5c5 add GoToAdventurersGuildTask
优化项目结构并新增任务和路径文件

主要更改:
- 在 `BetterGenshinImpact.csproj` 文件中,添加了对 `GameTask\Common\Element\Assets\Json\**` 目录的处理,并确保其内容始终复制到输出目录。
- 在 `RecognitionObject.cs` 文件中,新增了多个静态方法 `Ocr` 和一个静态实例 `OcrThis`。
- 在 `PathExecutor.cs` 文件中,优化了路径执行逻辑,新增 `GetPosition` 方法,并调整了超时判断。
- 在 `AutoPickAssets.cs` 文件中,添加了多个 `using` 语句,新增 `_logger` 和 `PickRo` 字段,并在构造函数中添加了自定义拾取按键的处理逻辑。
- 在 `AutoPickTrigger.cs` 文件中,移除了自定义拾取按键的初始化逻辑。
- 在 `OneKeyExpeditionTask.cs` 文件中,注释掉了 `Cv2.ImWrite` 方法的调用。
- 在 `TpTask.cs` 文件中,添加了点位很近时不切换的判断逻辑。
- 在 `BvSimpleOperation.cs` 文件中,新增了多个点击按钮的方法和 `FindF`、`FindFAndPress` 方法。
- 在 `BvStatus.cs` 文件中,新增了多个方法用于判断是否在对话界面并等待对话界面加载完成。
- 在 `GameTaskManager.cs` 文件中,添加了 `MapAssets.DestroyInstance` 方法的调用。
- 在 `HotKeyPageViewModel.cs` 文件中,注释掉了 `ElementalCollectHandler` 的测试代码,并添加了 `GoToAdventurersGuildTask` 的测试代码。
- 在 `TaskSettingsPageViewModel.cs` 文件中,更新了 `OnGoToAutoGeniusInvokationUrlAsync` 方法中的 URL。
- 添加了 `BetterGenshinImpact - Backup.csproj` 文件,配置了项目属性、资源文件和包引用。
- 添加了 `冒险家协会_枫丹.json`、`合成台_枫丹.json` 和 `合成台_璃月.json` 文件,定义了前往相应地点的路径和动作。
- 添加了 `ChooseTalkOptionTask.cs` 文件,实现了选择对话选项的任务。
- 添加了 `GoToAdventurersGuildTask.cs` 文件,实现了前往冒险家协会领取奖励的任务。
2024-11-10 22:49:55 +08:00
辉鸭蛋 648dfd3f41 ensure that the 'settings' object passed into JS is not empty 2024-11-10 13:22:56 +08:00
辉鸭蛋 ef20a5448b fixed the issue where the pathing cannot be used properly when the resolution is below 1920x1080 2024-11-10 13:13:10 +08:00
辉鸭蛋 23973bb679 auto task opt 2024-11-10 12:28:53 +08:00
辉鸭蛋 ebc2b7b42e edit fight end judge 2 2024-11-10 01:24:35 +08:00
辉鸭蛋 8d2ee35b7c edit fight end judge 2024-11-10 01:20:45 +08:00
辉鸭蛋 68d3061523 switch party: shorten the time for Hutao 2024-11-10 01:02:31 +08:00
辉鸭蛋 435d04b52d pathing: add more settings 2024-11-10 00:51:47 +08:00
辉鸭蛋 244ce1c27f pathing: add exception handling for entering conversations 2024-11-10 00:02:18 +08:00
辉鸭蛋 adcd08421a fix: incorrect host judgment methods #777 2024-11-09 17:49:42 +08:00
辉鸭蛋 19c7b10b01 fix repo update 2024-11-09 17:37:46 +08:00
辉鸭蛋 fe1d67bf16 add tool tip for js page 2024-11-09 09:42:50 +08:00
辉鸭蛋 9c7651702a add auto BlessingOfTheWelkinMoonTask 2024-11-09 00:38:57 +08:00
辉鸭蛋 b0b3768ee7 https://github.com/babalae/bettergi-scripts-list/pull/15 2024-11-08 23:17:02 +08:00
辉鸭蛋 462741d3fb 0.36.1 2024-11-05 22:50:58 +08:00
辉鸭蛋 32bec1656b default pathing condition config 2024-11-05 22:50:34 +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
辉鸭蛋 9c9bd7d138 js: extend click time
修改了 `GlobalMethod` 类中的 `Click` 方法,现在调用 `LeftButtonClick` 方法而不是 `Simulation.SendInput.Mouse.LeftButtonClick`。
修改了 `GlobalMethod` 类中的 `LeftButtonClick` 方法,现在使用 `Simulation.SendInput.Mouse.LeftButtonDown().Sleep(60).LeftButtonUp()` 代替 `Simulation.SendInput.Mouse.LeftButtonClick`。
修改了 `GlobalMethod` 类中的 `RightButtonClick` 方法,现在使用 `Simulation.SendInput.Mouse.RightButtonDown().Sleep(60).RightButtonUp()` 代替 `Simulation.SendInput.Mouse.RightButtonClick`。
2024-11-05 22:00:16 +08:00
辉鸭蛋 5b054bf31b 0.36.0 2024-11-04 21:33:07 +08:00
ema a960f76920 feat: restore from another instance 2024-11-04 03:45:08 +08:00
辉鸭蛋 00447d3e78 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-11-03 22:30:24 +08:00
辉鸭蛋 c5de098865 new doc url 2024-11-03 22:26:14 +08:00
辉鸭蛋 4ce7d02e75 Merge pull request #763 from FannieMC/main
增加对多人联机下进入尘歌壶的支持
2024-11-03 21:33:20 +08:00
Fannie MC c7827d0fa3 增加对多人联机下进入尘歌壶的支持 2024-11-03 21:10:08 +08:00
辉鸭蛋 7513e75f74 remove 'textRegion' from the log record The > character of Text `
修改了日志记录的代码,将 `textRegion.Text` 中的 `>` 字符去掉后再记录日志。
2024-11-03 20:54:07 +08:00
辉鸭蛋 0923b0802c auto tp opt 2024-11-03 20:21:25 +08:00
辉鸭蛋 2c9c78f933 edit ui style 2024-11-03 19:01:06 +08:00
辉鸭蛋 c1ef7c141f + drag drop 2024-11-03 00:04:54 +08:00
辉鸭蛋 a98934fc9a fix bug 2024-11-02 22:56:35 +08:00
辉鸭蛋 2b8f38b758 finsh pathing config 2024-11-02 21:03:58 +08:00
辉鸭蛋 2545581807 new pathing config 2024-11-02 19:49:38 +08:00
辉鸭蛋 e595b67d33 msg more info 2024-11-02 13:05:48 +08:00
辉鸭蛋 dcd7831368 auto fix win11 bitblt 2024-11-02 12:57:58 +08:00
辉鸭蛋 4725af5491 impl js run task 2024-11-01 21:37:44 +08:00
辉鸭蛋 a1cdf15c7e fix bug 2024-11-01 19:19:47 +08:00
辉鸭蛋 c461938ddd add elemental collect handler
在 `DefaultAutoFightConfig.cs` 中,将 `JsonSerializer.Deserialize` 替换为 `Newtonsoft.Json.JsonConvert.DeserializeObject` 来反序列化 `combat_avatar.json` 文件。

在 `ActionFactory.cs` 中,添加了 `BetterGenshinImpact.GameTask.AutoGeniusInvokation.Model` 的引用,并在 `ActionFactory` 类中添加了新的元素采集处理器(`hydro_collect`、`electro_collect`、`anemo_collect`)。

在 `HotKeyPageViewModel.cs` 中,添加了 `BetterGenshinImpact.GameTask.AutoGeniusInvokation.Model` 的引用,并修改了 `Test1Hotkey` 的处理逻辑,使用 `ElementalCollectHandler` 进行元素采集。

新增了 `ElementalCollectHandler.cs` 文件,定义了 `ElementalCollectHandler` 类,用于处理元素采集逻辑。该类根据元素类型筛选角色,并执行相应的攻击或技能操作。同时定义了 `ElementalCollectAvatar` 和 `ElementalCollectAvatarConfigs` 类,用于配置和管理不同元素类型的角色。
2024-11-01 01:47:10 +08:00
辉鸭蛋 3d6546b528 time consuming of calculation script 2024-11-01 00:07:11 +08:00
辉鸭蛋 b0d4068eb2 pathing opt 2024-10-31 23:10:11 +08:00
辉鸭蛋 b0d8e1a274 add condition settings 2024-10-31 23:06:40 +08:00
辉鸭蛋 a39aefb44c retry when TpPointNotActivate 2024-10-31 12:36:21 +08:00
辉鸭蛋 adf824519b waiting for map movement to complete 2024-10-31 12:25:55 +08:00
辉鸭蛋 4cb5442161 add switch party task
在 `BetterGenshinImpact.csproj` 文件中,添加了两个新文件夹路径 `GameTask\OneDragon\` 和 `User\AutoPathing\`。

在 `BvStatus.cs` 文件中:
- 将 `WaitForMainUi` 方法的默认重试次数从 25 次减少到 10 次。
- 添加了 `IsInPartyViewUi` 和 `WaitForPartyViewUi` 方法。

在 `ElementAssets.cs` 文件中:
- 添加并初始化了 `PartyBtnChooseView` 和 `PartyBtnDelete` 两个新的识别对象。

在 `NewRetry.cs` 文件中:
- 添加了 `using System.Threading.Tasks;` 引用。
- 添加了 `WaitForAction` 方法。

在 `Region.cs` 文件中,添加了一个新的 `ClickTo` 方法,该方法接受 `double` 类型的参数。

在 `ReturnMainUiTask.cs` 文件中:
- 删除了旧的 `ReturnMainUiTask` 类。
- 添加了新的 `ReturnMainUiTask` 类,内容与旧的类似,但文件路径和命名空间有所变化。

在 `RunnerContext.cs` 文件中,移除了 `using BetterGenshinImpact.GameTask.OneDragon;` 引用,添加了 `using BetterGenshinImpact.GameTask.Common.Job;` 引用。

在 `HotKeyPageViewModel.cs` 文件中:
- 添加了多个 `using` 引用,包括 `using System.Threading.Tasks;` 和 `using BetterGenshinImpact.GameTask.Common.Job;`。
- 修改了多个方法的代码格式,使其更加简洁。
- 添加了多个新的快捷键设置。

添加了两个新的 PNG 图片文件 `party_btn_choose_view.png` 和 `party_btn_delete.png`。

在 `SwitchPartyTask.cs` 文件中,添加了新的 `SwitchPartyTask` 类,用于切换队伍。
2024-10-29 01:41:43 +08:00
辉鸭蛋 b74e09ac8b add continuous execution & add pathing ui right menu & real time updates of script repository
更新了 `BetterGenshinImpact.csproj` 文件中的 `WPF-UI.Violeta` 包版本,从 `3.0.5.21` 升级到 `3.0.5.23`。
在 `RepoWebBridge.cs` 文件中,注释掉了检查本地 `repo.json` 文件是否存在的代码,并直接调用 `ScriptRepoUpdater.Instance.UpdateCenterRepo()` 方法更新仓库。更新后的异常信息也进行了修改。
在 `MapPathingPage.xaml` 文件中,删除了 `ui:TreeListView` 控件的 `behavior:RightClickSelectBehavior.Enabled` 属性。
在 `ScriptControlPage.xaml` 文件中,添加了一个新的 `RowDefinition`,并在 `Grid` 中添加了一个新的 `ui:Button`,用于执行连续脚本组的命令。
在 `ScriptControlViewModel.cs` 文件中,添加了 `System.Windows.Media` 的引用。
在 `ScriptControlViewModel.cs` 文件中,添加了一个新的异步方法 `OnStartMultiScriptGroupAsync`,用于显示一个包含全选按钮和配置组复选框的对话框,并执行选中的脚本组。
2024-10-28 00:25:14 +08:00
辉鸭蛋 dd9433f565 update pathing ui 2024-10-27 23:47:26 +08:00
辉鸭蛋 a802ffa0e5 tp.json supplement 2024-10-27 23:05:15 +08:00
辉鸭蛋 fe12b59b5c Pathing has been stuck 3 times. Try the route again or abandon it!
将 `_retryTimes` 字段改为常量 `RetryTimes`,并将其值设为 2。添加了新的字段 `_inTrap`,用于记录陷入困境的次数。在 `Pathing` 方法中,将 `for` 循环中的 `_retryTimes` 替换为 `RetryTimes`。在路径执行过程中,增加了对陷入困境的检测逻辑。如果在 8 个位置内的移动距离小于 3,则认为可能陷入困境,并增加 `_inTrap` 计数器。如果 `_inTrap` 超过 2 次,则抛出 `RetryException` 异常,提示路线出现 3 次卡死,重试或放弃此路线。检测到疑似卡死时,记录警告日志,并调用 `TrapEscaper` 的方法尝试脱困。
2024-10-27 22:24:14 +08:00
辉鸭蛋 5f40e28332 修复后台自动剧情启用的情况下,自动领取探索奖励失效的问题 2024-10-27 22:18:32 +08:00
辉鸭蛋 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
辉鸭蛋 94418cbe56 auto pathing: add retry 2024-10-26 23:37:55 +08:00
辉鸭蛋 72c2e38f94 add pathing settings for script group 2024-10-26 21:11:59 +08:00
辉鸭蛋 be5c8ad6e3 update logo 2024-10-26 21:08:09 +08:00
辉鸭蛋 255f328b67 update logo 2024-10-26 20:24:17 +08:00
辉鸭蛋 1dbb9e3bf1 auto pathing: optimize avatar switch 2024-10-26 14:46:38 +08:00
辉鸭蛋 df7b55e47c support recognition of semi transparent avatars 2024-10-26 14:45:53 +08:00
辉鸭蛋 ed77d955ef add AvatarClassifyTransparentGen 2024-10-26 01:47:41 +08:00
辉鸭蛋 e4e7b37fd2 the whole team is defeated
在 `PathExecutor.cs` 中,`RecoverWhenLowHp` 方法进行了修改:
- 使用 `using` 语句来捕获区域。
- 如果当前角色血量过低,调用新的 `TpStatueOfTheSeven` 方法进行传送和恢复。
- 增加了一个新的分支,如果检测到复苏提示,点击复苏并等待主界面加载完成,然后再调用 `TpStatueOfTheSeven` 方法。
- 新增了 `TpStatueOfTheSeven` 方法,用于处理传送到七天神像并恢复血量的逻辑。

在 `BvStatus.cs` 中:
- 增加了 `System.Threading.Tasks` 和 `System.Threading` 的引用。
- 在 `Bv` 类中新增了 `WaitForMainUi` 方法,用于等待主界面加载完成。
- 在 `Bv` 类中新增了 `ClickIfInReviveModal` 方法,用于检测并点击复苏提示。
2024-10-26 00:21:51 +08:00
辉鸭蛋 9f728fdf30 new banner 2024-10-26 00:20:50 +08:00
辉鸭蛋 7c96adb591 improve low hp detection and resurrection logic
改进低血量检测和复活逻辑

在 `BetterGenshinImpact.csproj` 文件中,将 `<AssemblyVersion>` 从 `0.35.1` 更新为 `0.35.2`。

在 `AutoDomainTask.cs` 文件中:
- 添加了 `using BetterGenshinImpact.GameTask.Common.BgiVision;` 引用。
- 将 `IsLowHealth` 方法替换为 `Bv.CurrentAvatarIsLowHp(CaptureToRectArea())` 方法。
- 在 `catch` 语句中添加了异常日志记录 `Logger.LogDebug(e, "红血自动吃药检测时发生异常")`。
- 删除了 `IsLowHealth` 方法的实现。

在 `Avatar.cs` 文件中:
- 修改了 `using` 引用,添加了 `BetterGenshinImpact.Core.Recognition`。
- 在 `ThrowWhenDefeated` 方法中,将 `region.Find(AutoFightContext.Instance.FightAssets.ConfirmRa)` 替换为 `Bv.IsInRevivePrompt(region)` 方法,并添加了复活逻辑。

在 `PathExecutor.cs` 文件中:
- 在 `foreach` 循环中添加了 `await RecoverWhenLowHp();` 方法调用。
- 添加了 `RecoverWhenLowHp` 方法,用于检测并处理低血量恢复。

在 `TpTask.cs` 文件中:
- 添加了 `ReviveStatueOfTheSevenPointX` 和 `ReviveStatueOfTheSevenPointY` 静态变量,用于复活点的坐标。

在 `BvStatus.cs` 文件中:
- 添加了多个 `using` 引用。
- 在 `Bv` 类中添加了 `IsInRevivePrompt` 和 `CurrentAvatarIsLowHp` 方法,用于检测复苏提示和当前角色是否低血量。
2024-10-25 23:49:07 +08:00
辉鸭蛋 14a1d3be74 auto pathing: add settings ui 2024-10-25 01:17:00 +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
辉鸭蛋 b3f6002846 add pathing config 2024-10-22 01:21:11 +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
辉鸭蛋 d23ba65d51 fix #732 2024-10-20 20:38:38 +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
辉鸭蛋 81b754125a update ui 2024-10-20 10:51:41 +08:00
辉鸭蛋 29544507eb one dragon: fill
添加 OneDragon 相关 ViewModel 和页面,删除旧配置

在 `App.xaml.cs` 中添加了 `using BetterGenshinImpact.ViewModel.Pages.OneDragon` 语句,并在 `App` 类中添加了一系列 `OneDragon` 相关的 ViewModel 到服务集合中。
在 `OneDragonTaskItem.cs` 中调整了 `using` 语句的顺序,初始化了一些属性的默认值,并添加了两个构造函数。
删除了 `LoginConfigPage.xaml`、`LoginConfigPage.xaml.cs`、`MailConfigPage.xaml`、`MailConfigPage.xaml.cs`、`LoginConfigViewModel.cs` 和 `MailConfigViewModel.cs` 文件的内容。
在 `OneDragonFlowPage.xaml` 中更新了 `oneDragonView` 的命名空间,并添加了多个 `DataTemplate` 以支持新的 ViewModel。
在 `OneDragonFlowViewModel.cs` 中调整了 `using` 语句的顺序,并更新了 `_taskList` 的初始化内容。
添加了多个新的 ViewModel 文件,包括 `CraftViewModel.cs`、`DailyCommissionViewModel.cs`、`DailyRewardViewModel.cs`、`DomainViewModel.cs`、`ForgingViewModel.cs`、`LeyLineBlossomViewModel.cs`、`MailViewModel.cs`、`OneDragonBaseViewModel.cs`、`SereniteaPotViewModel.cs` 和 `TcgViewModel.cs`。
添加了多个新的页面文件,包括 `CraftPage.xaml`、`CraftPage.xaml.cs`、`DailyCommissionPage.xaml`、`DailyCommissionPage.xaml.cs`、`DailyRewardPage.xaml`、`DailyRewardPage.xaml.cs`、`DomainPage.xaml`、`DomainPage.xaml.cs`、`ForgingPage.xaml`、`ForgingPage.xaml.cs`、`LeyLineBlossomPage.xaml`、`LeyLineBlossomPage.xaml.cs`、`MailPage.xaml`、`MailPage.xaml.cs`、`SereniteaPotPage.xaml`、`SereniteaPotPage.xaml.cs` 和 `TcgPage.xaml`、`TcgPage.xaml.cs`。
2024-10-19 19:29:44 +08:00
辉鸭蛋 8471d5ef88 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-19 17:43:07 +08:00
辉鸭蛋 a4bc632ae7 ui test
新增任务类属性和配置页面,优化日志记录

在 `BetterGenshinImpact.csproj` 文件中,添加了两个新文件夹路径 `GameTask\OneDragon\` 和 `User\AutoPathing\`。

在多个任务类文件中(如 `AutoDomainTask.cs`、`AutoFightTask.cs`、`AutoGeniusInvokationTask.cs`、`AutoMusicGameTask.cs`、`AutoWoodTask.cs`),新增了 `Name` 属性。

在 `PickAroundHandler.cs` 文件中,优化了 `RunAsync` 方法的日志记录,并添加了超时检查。

在 `ISoloTask.cs` 文件中,新增了 `Name` 属性和 `Start` 方法的接口定义。

在 `OneDragonTaskItem.cs` 文件中,新增了 `ViewModel` 属性。

在 `OneDragonFlowPage.xaml` 文件中,右侧配置部分从 `StackPanel` 改为 `ContentControl`,并添加了 `DataTemplate` 以支持不同任务类型的配置页面。

在 `IViewModel.cs` 文件中,将 `IViewModel` 接口的访问修饰符从 `internal` 改为 `public`。

在 `OneDragonFlowViewModel.cs` 文件中,初始化了任务项的 `ViewModel` 属性。

在 `ScriptControlViewModel.cs` 文件中,移除了构造函数的 `HomePageViewModel` 参数。

新增了 `LoginConfigViewModel.cs` 和 `MailConfigViewModel.cs` 文件,定义了相应的 ViewModel 类。

新增了 `LoginConfigPage.xaml` 和 `MailConfigPage.xaml` 文件,定义了相应的 XAML 布局及其交互逻辑。
2024-10-19 17:42:58 +08:00
DismissedLight 1f2d3a40d9 Add HutaoInterop Pipe 2024-10-19 15:20:58 +08:00
辉鸭蛋 3a88da3c6e code cleanup 2024-10-19 14:34:30 +08:00
辉鸭蛋 790d42cee0 Merge pull request #726 from babalae/feat-cts
refactor: CancellationTokenSource -> CancellationToken
2024-10-19 13:10:38 +08:00
辉鸭蛋 c9f541362d Merge branch 'main' into feat-cts 2024-10-19 13:09:44 +08:00
辉鸭蛋 efd2808a2e Merge pull request #721 from jbcaaa/main_testing
添加PickAround实现(浅测试)
2024-10-19 13:08:43 +08:00
辉鸭蛋 11ec9bc45d refactor: CancellationTokenSource -> CancellationToken 2024-10-19 01:50:21 +08:00
jbcaaa 74645e8e93 修正错误 2024-10-18 22:43:20 +08:00
辉鸭蛋 af7209af48 dispather ui : fix the issue of multi-level directories not being displayed
在 `TpTask.cs` 文件中:
- 修改了异常处理的日志记录逻辑。
- 修复了一个多余的 `}`。

在 `ScriptControlViewModel.cs` 文件中:
- 添加了新的 `using` 语句。
- 修改了 `OnAddPathing` 方法,替换了 `LoadAllPathingScripts` 方法。
- 重构了 `CreatePathingScriptSelectionPanel` 方法,修改了参数类型。
- 添加了 `AddNodesToPanel` 方法,用于递归添加节点。
- 修改了 `SetChildCheckBoxesState` 方法,增加了对嵌套 `StackPanel` 的处理。
- 修改了 `AddSelectedPathingScripts` 方法,调整了 `FileInfo` 的创建方式。
- 添加了对 `item.Project` 的空值检查。
- 添加了 `item.Project.LoadSettingUi` 方法的调用。
- 添加了 `oldItem.Projects.CollectionChanged` 事件的取消订阅。
2024-10-18 21:52:11 +08:00
jbcaaa 7df31c66d2 缩小旋转角度转大圈 2024-10-18 21:31:40 +08:00
jbcaaa 0bb45c8390 Merge branch 'babalae:main' into main_testing 2024-10-18 21:24:22 +08:00
辉鸭蛋 07e682d488 auto pathing: code clean & opt 2024-10-18 20:59:58 +08:00
辉鸭蛋 a1508a7b05 Merge pull request #711 from jbcaaa/main
Support using both key-mouse-record and auto-pathing in js scripts
2024-10-18 20:14:12 +08:00
辉鸭蛋 57989fd8b9 update ui 2024-10-18 19:57:39 +08:00
jbcaaa c4031069c6 Merge branch 'babalae:main' into main_testing 2024-10-18 18:46:56 +08:00
jbcaaa ecaab5dc76 添加PickAround实现(未测试) 2024-10-18 17:57:13 +08:00
jbcaaa a220dd2377 修正某些默认方法的使用问题 2024-10-18 15:19:40 +08:00
jbcaaa e1149bc254 分离行走逻辑和避障逻辑 2024-10-18 14:45:23 +08:00
jbcaaa 6a53efce1e 增加注释,辅助理解 2024-10-18 10:51:19 +08:00
jbcaaa a67adc0070 修复许多问题,增加小脱困 2024-10-18 08:24:58 +08:00
jbcaaa 03f6b6331f 设置为非攀爬时进入攀爬,自动脱离 2024-10-18 07:41:43 +08:00
jbcaaa ee720f8dfd try again 2024-10-18 07:06:06 +08:00
jbcaaa b152486327 统一脱困跳跃方法 2024-10-18 06:57:57 +08:00
jbcaaa 70f1f69067 回退一个数值更改 2024-10-18 06:44:27 +08:00
jbcaaa f56465ebf3 fixed the problem causes autopathing cannot run correctly. 2024-10-18 06:41:24 +08:00
jbcaaa 3b8b1ef9db Update PathExecutor.cs 2024-10-18 00:48:57 +08:00
jbcaaa a4bb2eeca2 changed some value 2024-10-18 00:23:26 +08:00
jbcaaa f222431784 [testing] madly modified move actions in autopathing 2024-10-17 21:15:58 +08:00
辉鸭蛋 7c5958f8ad Update README.md 2024-10-17 21:01:05 +08:00
jbcaaa 561f1b8b72 Support using both key-mouse-record and auto-pathing in js scripts 2024-10-17 16:04:27 +08:00
辉鸭蛋 9ad1062020 update one-stop service ui 2024-10-17 03:25:25 +08:00
辉鸭蛋 2ed7a883b3 One-stop service init 2024-10-17 02:48:21 +08:00
辉鸭蛋 4859c4dc4a add log & pathing opt 2024-10-16 01:31:44 +08:00
辉鸭蛋 03f25ebcfb revert #697 2024-10-16 01:06:22 +08:00
辉鸭蛋 0580ec68e9 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-16 01:03:44 +08:00
辉鸭蛋 b4e6565443 normal attack & elemental_skill 2024-10-16 00:54:56 +08:00
辉鸭蛋 e74d6b6bd4 Merge pull request #697 from ccccccggggg/main
加入四个战斗脚本
2024-10-15 06:11:38 +08:00
鹤望兰 b8c9dc971f Add files via upload 2024-10-15 01:59:36 +08:00
辉鸭蛋 b51200c1f3 fix pick 声望 2024-10-14 23:47:39 +08:00
鹤望兰 943bd4fc4d Add files via upload 2024-10-14 21:58:11 +08:00
辉鸭蛋 3d2b1b376e 0.35.0 2024-10-14 00:24:11 +08:00
辉鸭蛋 73cd48f8b1 fix nahida collect 2024-10-13 23:49:04 +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
辉鸭蛋 228d50bb5d Revert "feat: 优化autopath MoveTo逻辑"
This reverts commit 504f853893.
2024-10-13 21:09:41 +08:00
辉鸭蛋 5e16f48cf2 update pating ui 2024-10-13 20:51:02 +08:00
辉鸭蛋 6fb29ddfad Xilonen 5.1 2024-10-13 20:46:56 +08:00
辉鸭蛋 ac4dde6bf0 Merge pull request #685 from gqzcl/main_path
feat: 优化autopath MoveTo逻辑
2024-10-13 18:50:49 +08:00
辉鸭蛋 6c643b2419 删除一些默认用户配置 2024-10-13 18:27:03 +08:00
辉鸭蛋 2f44905c27 rm script 2024-10-13 18:24:06 +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
辉鸭蛋 245c05b208 1st logo #671 2024-10-13 15:42:49 +08:00
辉鸭蛋 333ad6f0b4 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-13 13:36:10 +08:00
辉鸭蛋 c75dbbc241 add script repo downloader 2024-10-13 13:36:06 +08:00
ema 421b11504f fix: titlebar accent color #442 2024-10-13 03:02:19 +08:00
辉鸭蛋 bb18350457 fix mouse move for js 2024-10-11 03:12:38 +08:00
辉鸭蛋 831f28b2aa WPF-UI.Violeta 3.0.5.18 https://github.com/emako/wpfui.violeta/issues/5 2024-10-10 22:00:30 +08:00
辉鸭蛋 475b9bbd00 update ui text & ProxySpeedTester
删除了 `ClickOffset` 类及其相关代码。
在 `MainWindow.xaml` 中,将导航菜单项的内容从“脚本”更改为“JS 脚本”。
在 `JsListPage.xaml` 和 `KeyMouseRecordPage.xaml` 中,更新了文本内容,并添加了指向相关教程的超链接。
在 `JsListViewModel.cs` 和 `KeyMouseRecordPageViewModel.cs` 中,分别添加了 `OnGoToJsScriptUrl` 和 `OnGoToKmScriptUrl` 方法,用于打开对应的教程 URL。
新增了 `ProxySpeedTester.cs` 文件,包含一个用于测试代理速度的类 `ProxySpeedTester`,提供了获取最快代理地址的方法。
2024-10-10 21:58:35 +08:00
辉鸭蛋 a963a8595a auto pick: add black list
新增黑名单条目至 pick_black_lists.json
2024-10-10 01:20:41 +08:00
辉鸭蛋 5c712c5a31 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-09 23:56:01 +08:00
辉鸭蛋 8651ec74a6 update ui 2024-10-09 23:53:55 +08:00
辉鸭蛋 6fadd528f1 Merge pull request #690 from haokaiyang/main
auto tcg: update character card config to v5.1
2024-10-09 13:32:26 +08:00
haokaiyang f20cf89d5f auto tcg: update character card config to v5.1 2024-10-09 11:25:59 +08:00
辉鸭蛋 c13db0a501 rename 2024-10-08 00:21:56 +08:00
辉鸭蛋 7b80867bd1 update ui 2024-10-06 21:05:42 +08:00
辉鸭蛋 a2f877c455 increase the minimum waiting time for the transmission panel delay to 300 milliseconds
增加传送面板延迟的最小等待时间至 300 毫秒

将 `time` 的最小值从 100 毫秒增加到 300 毫秒。这意味着在等待传送面板延迟时,最小等待时间从 100 毫秒变为 300 毫秒。
2024-10-06 14:50:53 +08:00
gqzcl 504f853893 feat: 优化autopath MoveTo逻辑 2024-10-05 14:04:20 +08:00
辉鸭蛋 b1f6c062fb auto tp: add blocked click area
主要变更:
- 在 `TpTask` 构造函数中添加了两个新的私有只读字段 `_captureRect` 和 `_zoomOutMax1080PRatio`。
- 在 `TpOnce` 方法中,使用新的私有字段 `_zoomOutMax1080PRatio` 替代局部变量 `s`。
- 将 `while` 循环条件改为调用新的私有方法 `IsPointInBigMapWindow`。
- 删除了原来计算点击坐标的代码,改为调用新的私有方法 `ConvertToGameRegionPosition`。
- 添加了新的私有方法 `IsPointInBigMapWindow` 和 `ConvertToGameRegionPosition`。
- 更新了子项目的提交版本。

这些更改通过引入新的私有方法和字段,减少了重复代码,并使逻辑更加清晰,代码变得更加模块化,便于后续的维护和扩展。
2024-10-04 19:57:18 +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
辉鸭蛋 aee54cc115 js config 2024-10-01 20:25:39 +08:00
辉鸭蛋 2817479d33 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-01 20:10:51 +08:00
辉鸭蛋 8de5bcf987 auto pick: ForceInteraction 2024-10-01 20:10:46 +08:00
辉鸭蛋 a25cc951c9 new banner 2024-10-01 20:10:23 +08:00
辉鸭蛋 50ee1d1a3e Merge pull request #679 from lwh9346/main
添加了一些可靠的路径追踪捡狗粮路线
2024-10-01 19:15:22 +08:00
lwh9346 7f39062f14 添加了一些可靠的路径追踪捡狗粮路线 2024-10-01 16:56:31 +08:00
ema 619cb667cd chore: doc about game cli #665 2024-10-01 14:16:13 +08:00
ema 4da6efd54e fix the all about scrollable 2024-10-01 13:50:59 +08:00
辉鸭蛋 5fe3db52bf fix hotkey bug 2024-10-01 13:36:53 +08:00
辉鸭蛋 d760f2411a Merge pull request #676 from babalae/feat/btn
add TwoStateButton
2024-10-01 12:42:31 +08:00
辉鸭蛋 1706312957 wpfui.violeta 3.0.5.16 2024-10-01 12:35:08 +08:00
辉鸭蛋 d686fdcb5a auto skip black list #677 2024-10-01 12:17:01 +08:00
辉鸭蛋 a93839e0be refactor: hotkey UI to a tree view 2024-10-01 01:58:00 +08:00
辉鸭蛋 6e00e3f91e collect fight screenshots 2024-10-01 01:56:53 +08:00
qhy040404 41c5f4c226 fix wrong state 2024-10-01 00:04:35 +08:00
qhy040404 95f7b76a03 add TwoStateButton 2024-09-30 23:17:10 +08:00
辉鸭蛋 c137daec40 fix ui 2024-09-30 22:04:01 +08:00
辉鸭蛋 c89e2d4e84 upgrade build ps1
在 `upload_1_build_dist.cmd` 文件中:
- 添加了切换到当前脚本目录的命令 `cd /d %~dp0`。
- 添加了删除 `dist` 目录及其子目录的命令 `if exist dist rd /s /q dist`。
- 添加了创建 `dist\BetterGI` 目录的命令 `mkdir dist\BetterGI`。
- 添加了准备编译器的命令,使用 `vswhere.exe` 查找最新的 Visual Studio 安装路径并设置环境变量。
- 添加了准备版本信息的命令,使用 PowerShell 从 `BetterGenshinImpact.csproj` 文件中提取 `AssemblyVersion`。
- 添加了设置临时文件夹和归档文件名的命令。
- 添加了使用 Visual Studio 2022 构建应用程序的命令。
- 添加了使用 7z 打包应用程序的命令。
- 添加了删除特定文件(如 `.lib` 和 `ffmpeg` DLL 文件)的命令。
- 添加了从特定路径复制文件到临时文件夹的命令。
- 添加了暂停命令 `@pause`。

在 `upload_2_zip_dist.ps1` 文件中:
- 添加了导入 `Microsoft.PowerShell.Archive` 模块的命令。
- 添加了设置目录路径、输出 JSON 路径和目标目录路径的命令。
- 添加了将相对路径转换为绝对路径的命令。
- 添加了初始化排除目录列表的命令。
- 添加了初始化一个空的哈希表来存储文件路径和哈希值的命令。
- 添加了获取目录中所有文件的命令。
- 添加了遍历文件列表并计算每个文件的 SHA256 哈希值的命令。
- 添加了将文件路径和哈希值添加到哈希表中的命令。
- 添加了压缩文件并替换原文件的命令。
- 添加了将哈希表转换为 JSON 格式并写入文件的命令。
- 添加了获取所有 `.zip` 文件并复制到目标目录的命令。
- 添加了删除原始目录的命令。
2024-09-30 22:03:55 +08:00
辉鸭蛋 1901246bab Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-09-30 14:02:45 +08:00
辉鸭蛋 c15cb33c2c rename variables and properties, refactor code, add new configuration options
重命名变量和属性,重构代码,添加新配置选项

主要更改:
* 将 `AutoFightConfig` 和 `AutoFightParam` 类中的字段和属性重命名,以提高名称的清晰度和一致性。
* 移除不必要的 `using` 语句,并调整顺序。
* 重构 `AutoFightTask` 和 `AutoFightHandler` 类中的条件判断和方法逻辑。
* 调整 `CameraRotateTask` 类中的参数值。
* 在 `PathExecutor` 类中添加 `_rotateTask` 字段,并修改相关方法调用。
* 在 `TaskSettingsPage.xaml` 中添加新的配置选项。
* 在 `HotKeyPageViewModel` 类中添加 `using` 语句,并修改热键回调逻辑。
* 修改 `TaskSettingsPageViewModel` 类中 `AutoFightParam` 的初始化。
2024-09-30 13:42:11 +08:00
ema 377de9e244 update: use embedded pdb 2024-09-30 10:29:19 +08:00
ema 335b053b32 change: moved image assets to new folder 2024-09-30 10:12:13 +08:00
辉鸭蛋 2516f9b248 fix tp task 2024-09-30 00:30:00 +08:00
辉鸭蛋 d9e5f2f1dd add rotate task
在 `BgiYoloV8Predictor.cs` 文件中,添加了 `System.Diagnostics`、`System.Drawing.Imaging` 和 `System.IO` 的引用,并在 YOLOv8 识别结果返回前,添加了调试输出,使用 `JsonSerializer` 序列化识别结果并输出到调试窗口。

在 `AutoFightTask.cs` 文件中,添加了 `System.Collections.Generic` 和 `BetterGenshinImpact.GameTask.AutoPathing` 的引用,修改了 `combatScenes.BeforeTask` 方法的调用,使用新的取消令牌 `cts2`。在战斗操作的 `Task.Run` 中添加了 `try-catch` 块,以捕获并忽略异常。修改了战斗结束检测线程,使用 `async` 和 `await` 关键字,并在检测战斗结束时添加了 `try-catch` 块。修改了 `CheckFightFinish` 方法,改为异步方法 `CheckFightFinish`,并在检测战斗结束时添加了旋转视角的逻辑。

在 `PathExecutor.cs` 文件中,添加了关于 DPI 和分辨率影响转动速度的注释。

在 `TaskSettingsPageViewModel.cs` 文件中,在获取战斗策略后,创建了 `AutoFightParam` 对象,并设置了 `EndDetect` 和 `AutoPickAfterFight` 参数。修改了 `RunSoloTaskAsync` 方法的调用,传入了新的 `AutoFightParam` 对象。

在 `CameraRotateTask.cs` 文件中,添加了新的 `CameraRotateTask` 类,用于处理相机视角的旋转,实现了 `RotateToApproach` 方法,用于将视角旋转到接近目标角度,实现了 `WaitUntilRotatedTo` 异步方法,用于等待视角旋转到目标角度。
2024-09-30 00:10:08 +08:00
辉鸭蛋 0549df75b6 auto fight: init end detect
在 `BetterGenshinImpact.csproj` 文件中,删除了 `Assets\Model\World\` 和 `Script\JustTp\` 文件夹的包含项。

在 `AutoFightConfig.cs` 文件中,`AutoFightConfig` 类新增了两个属性:`_endDetect` 和 `_autoPickAfterFight`,并且默认值分别为 `true`。

在 `AutoFightParam.cs` 文件中,`AutoFightParam` 类新增了两个属性:`EndDetect` 和 `AutoPickAfterFight`,并且默认值分别为 `false`。

在 `AutoFightTask.cs` 文件中:
  * 修改了 `using` 引用,添加了 `BetterGenshinImpact.Core.Config` 和 `BetterGenshinImpact.GameTask.Model.Area`,删除了 `BetterGenshinImpact.GameTask.AutoGeniusInvokation.Exception`。
  * 在 `AutoFightTask` 类中,新增了 `_predictor` 和 `_lastFightFlagTime` 字段。
  * 在 `AutoFightTask` 构造函数中,增加了对 `EndDetect` 和 `AutoPickAfterFight` 属性的检查,并在满足条件时初始化 `_predictor`。
  * 修改了 `Start` 方法,增加了战斗结束检测线程和自动拾取掉落物的功能。
  * 新增了 `CheckFightFinish` 和 `HasFightFlag` 方法,用于检测战斗是否结束。

在 `BetterGenshinImpact.Core.Recognition.ONNX` 命名空间下新增了 `BgiYoloV8Predictor` 类,并实现了 `IDisposable` 接口。
  * 添加了一个只读字段 `_predictor`,并通过 `YoloV8Builder` 创建了一个默认的 YoloV8 预测器。
  * 添加了一个 `Predictor` 属性,用于获取 `_predictor`。
  * 添加了一个 `Detect` 方法,该方法接受一个 `ImageRegion` 对象作为参数,并返回一个包含类别和矩形框的字典。
  * 添加了 `Dispose` 方法,用于释放 `_predictor` 的资源。
2024-09-29 23:01:29 +08:00
辉鸭蛋 35264bc855 auto tp: throwing an exception when the tp point is not activated
在 `TpTask.cs` 文件中,添加了 `using BetterGenshinImpact.GameTask.Common.Exceptions;` 引用,并在 `TpTask` 类中添加了对 `TpPointNotActivate` 异常的处理逻辑,当传送点未激活或不存在时,按下 ESC 键返回大地图界面,并抛出异常。同时在 `ClickTpPoint` 方法中,修改了判断逻辑,增加了对传送点未激活或不存在的异常处理。

在 `MapAssets.cs`、`NewRetry.cs`、`TaskControl.cs` 文件中,将 `Exception` 修改为 `System.Exception`。

在 `NormalEndException.cs` 和 `RetryException.cs` 文件中,删除了旧的异常类定义,并重新添加了新的异常类定义。

在 `TpPointNotActivate.cs` 文件中,添加了新的异常类 `TpPointNotActivate`。
2024-09-29 21:37:54 +08:00
辉鸭蛋 5167ce0ba8 Merge pull request #658 from iris10086/iris-dev
在路径追踪中添加了一个AutoFightAction实现
2024-09-25 10:58:16 +08:00
辉鸭蛋 7df330a9fb 低分辨率缩放 2024-09-24 01:18:26 +08:00
辉鸭蛋 24c2d2cbf0 直接调用重构后的自动战斗独立任务
移除了 `AutoFightHandler` 类中的 `_combatScriptBag` 相关代码,并替换为新的 `AutoFightTask` 任务。
添加了新的命名空间引用,包括 `BetterGenshinImpact.GameTask.AutoFight`、`BetterGenshinImpact.GameTask.Common.TaskControl`、`System.IO` 和 `Wpf.Ui.Violeta.Controls`。
在 `StartFight` 方法中,替换了原有的战斗操作逻辑,使用 `AutoFightTask` 类来处理战斗任务。
添加了新的 `GetFightStrategy` 方法,用于获取战斗策略文件路径。
修改了战斗结束检测逻辑,将 `checkFightFinish` 方法重命名为 `CheckFightFinish`,并调整了检测逻辑。
调整了任务取消的逻辑,使用新的 `CancellationTokenSource` 实例 `cts2` 来管理任务取消。
将原有的 `Task` 实例替换为 `Task.Run` 方法来启动任务。
调整了任务等待逻辑,使用 `Task.WhenAll` 方法等待战斗任务和结束检测任务的完成。
2024-09-23 22:24:58 +08:00
辉鸭蛋 d51139025b 便携营养袋 的判断进行前置,减少无意义的性能损耗 2024-09-23 22:21:12 +08:00
辉鸭蛋 e7148f827d Merge branch 'iris-dev' of https://github.com/iris10086/better-genshin-impact into pr/658 2024-09-23 21:59:59 +08:00
辉鸭蛋 3d5d918d24 Merge branch 'main' into pr/658 2024-09-23 21:59:16 +08:00
何杰泽 ff969abbc7 自动吃药 添加了是否携带食物的检测 2024-09-23 21:18:24 +08:00
iris10086 541e9331c0 Merge branch 'babalae:main' into iris-dev 2024-09-23 20:44:10 +08:00
辉鸭蛋 f182e345c2 Merge pull request #660 from babalae/feat-solo-task
refactor: solo task
2024-09-23 10:07:59 +08:00
辉鸭蛋 5a0f7226ed update ISoloTask
更新 Start 方法以接受 CancellationTokenSource 参数

这些更改主要是为了使 `Start` 方法能够接受 `CancellationTokenSource` 参数,从而更好地控制任务的取消操作。通过传递 `CancellationTokenSource`,可以在需要时取消正在运行的任务,提高了代码的灵活性和可控性。

具体更改包括:
- 将 `Start` 方法的签名从无参数更改为接受 `CancellationTokenSource` 参数。
- 在多个任务类(如 `AutoDomainTask.cs`、`AutoFightTask.cs`、`AutoGeniusInvokationTask.cs`、`AutoMusicGameTask.cs`、`AutoWoodTask.cs`)中,更新 `Start` 方法以接受并使用传入的 `CancellationTokenSource`。
- 在 `Duel.cs` 中,更新 `RunAsync` 和 `Run` 方法的参数以接受 `CancellationTokenSource`,并将 `Cts` 赋值为传入的 `cts`。
- 在 `ISoloTask.cs` 接口中,更新 `Start` 方法的签名以接受 `CancellationTokenSource` 参数。
- 在 `TaskRunner.cs` 中,调用 `soloTask.Start` 时传入 `CancellationContext.Instance.Cts` 作为参数。
2024-09-23 00:04:09 +08:00
辉鸭蛋 8bb1d728ff refactor: solo task 2024-09-22 23:56:39 +08:00
辉鸭蛋 38e05830a2 nahida collect opt
优化 NahidaCollectHandler 逻辑并更新 HotKeyPageViewModel

在 NahidaCollectHandler.cs 文件中,调整了 RunAsync 方法的多个参数和延迟时间,增加了条件判断以优化逻辑。在 HotKeyPageViewModel.cs 文件中,添加了新的引用,并修改了 Test1Hotkey 的回调函数以调用 NahidaCollectHandler 的 RunAsync 方法。
2024-09-22 00:27:49 +08:00
辉鸭蛋 89340c42b0 code cleanup 2024-09-22 00:01:10 +08:00
辉鸭蛋 8e44643a51 auto eat #649 2024-09-21 23:41:20 +08:00
辉鸭蛋 7afbbee3e1 add more interrupt operation
在 KeyMouseMacroPlayer 类中添加取消请求检查

在 `KeyMouseMacroPlayer` 类中添加了一个检查取消请求的功能。
在处理每个宏事件之前,增加了以下代码:
    if (ct.IsCancellationRequested)
    {
        return;
    }
这段代码用于在取消请求被触发时,立即终止宏事件的重放。
2024-09-21 18:11:47 +08:00
iris10086 6cf96c71f3 Merge branch 'babalae:main' into iris-dev 2024-09-21 16:02:40 +08:00
何杰泽 997059dd4b 添加fight action。战斗结束策略比较low。 2024-09-21 15:56:37 +08:00
辉鸭蛋 b445cbf42f Merge pull request #649 from iris10086/iris-dev
添加了一个自动吃药的实时触发。
2024-09-21 15:47:00 +08:00
何杰泽 19e7c9d02e Merge branches 'main' and 'main' of github.com:iris10086/better-genshin-impact into iris-dev 2024-09-19 08:30:26 +08:00
何杰泽 d3f0f89da1 添加autoEat功能。 2024-09-19 08:24:41 +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
辉鸭蛋 1a4682bf29 Update README.md 2024-09-18 21:37:23 +08:00
ema 19fbcc48ab chore: hint audio resource for #640 2024-09-18 17:08:50 +08:00
辉鸭蛋 c63ac6947a fix big map shrink 2024-09-18 00:56:34 +08:00
何杰泽 98da4e072c Merge remote-tracking branch 'origin/main' into iris-dev 2024-09-17 22:24:44 +08:00
何杰泽 a2adfe5b6f 修改自动秘境战斗策略,添加自动吃药任务。但是没进行判断。 2024-09-17 22:18:00 +08:00
辉鸭蛋 9cc91b4568 test new pic 2024-09-17 18:18:31 +08:00
辉鸭蛋 068cbd6e20 删除重复点位 2024-09-17 17:54:27 +08:00
辉鸭蛋 f713847df2 add missing tp points #630 #603 #586 2024-09-17 16:29:47 +08:00
辉鸭蛋 c39a882272 auto tp: shrink big map #604 2024-09-17 15:24:09 +08:00
辉鸭蛋 5f9ca6b399 auto pathing: add force tp for tp point 2024-09-17 15:06:32 +08:00
辉鸭蛋 bfe6b69edd fix build bat 2024-09-17 12:24:58 +08:00
辉鸭蛋 8dbdf0840c add map pos editor 2024-09-17 01:41:20 +08:00
辉鸭蛋 4cba618722 edit ui text 2024-09-16 22:13:11 +08:00
辉鸭蛋 4cc4aa27f0 fix path recorder 2024-09-16 21:31:40 +08:00
辉鸭蛋 3e69e6c3ac fix map pos not reset during feature match #619 2024-09-16 21:15:59 +08:00
辉鸭蛋 6414210095 add log #631 2024-09-16 20:27:52 +08:00
辉鸭蛋 83e6798439 add an entry to open the log folder #632 2024-09-16 20:12:58 +08:00
辉鸭蛋 779fbaad86 add refresh context menu #627
添加刷新命令菜单项及刷新方法

在 `JsListPage.xaml` 和 `MapPathingPage.xaml` 中,添加了新的菜单项 `<MenuItem>`,用于绑定 `RefreshCommand` 命令,并设置了相应的 `CommandParameter` 和 `Header` 属性。

在 `JsListViewModel.cs` 中,添加了 `using BetterGenshinImpact.GameTask.AutoPathing.Model;` 语句,并修改了 `OnOpenScriptProjectFolder` 方法,将 `item` 为 `null` 时的处理逻辑改为使用 `scriptPath`。

在 `JsListViewModel.cs` 和 `MapPathingViewModel.cs` 中,添加了 `OnRefresh` 方法,该方法通过调用 `InitScriptListViewData` 来刷新脚本列表视图数据。
2024-09-16 10:52:34 +08:00
辉鸭蛋 962d47722d tp with retry
将 `Tp` 方法重命名为 `TpOnce`,以便区分新的 `Tp` 方法。
新增了一个 `Tp` 方法,该方法会重试调用 `TpOnce` 方法最多三次,如果三次都失败则抛出异常。
修改了一个重试机制的时间间隔,从 500 毫秒重试 10 次改为 500 毫秒重试 5 次。
2024-09-15 19:44:44 +08:00
辉鸭蛋 89079f74d8 if the current map location recognition fails, the national location will be directly used for large-scale map positioning
重构大地图中心点位置获取逻辑

在 `TpTask.cs` 文件中,添加了一个新的方法 `GetPositionFromBigMapNullable`,该方法在调用 `GetBigMapCenterPoint` 时使用了 `try-catch` 结构来捕获异常,并在发生异常时返回 `null`。

修改了原有代码中获取大地图中心点位置的逻辑。原先直接调用 `GetPositionFromBigMap` 方法,现在改为调用新的 `GetPositionFromBigMapNullable` 方法,并在获取到非空值时计算距离和记录日志。

将计算 `minDistance` 的逻辑从直接计算改为在获取到有效的大地图中心点位置后再进行计算。
2024-09-15 19:37:11 +08:00
辉鸭蛋 8dc074e987 tile map 2024-09-15 19:34:59 +08:00
辉鸭蛋 12d4c60f7a fix absolute path for pathing in dispatcher 2024-09-15 19:34:40 +08:00
何杰泽 fae49c4c3b 添加自动吃药的功能。 2024-09-12 15:34:53 +08:00
ema a4e55ab164 change: WindowBackdropType 2024-09-12 00:08:59 +08:00
辉鸭蛋 dc8c1e063e update the naming format for saving path files #600
将保存路径文件的命名格式从“yyyy-MM-dd HH:mm:ss:ffff”更改为“yyyyMMdd_HHmmss”。
2024-09-11 22:35:27 +08:00
辉鸭蛋 1d9168d96e Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-09-11 22:31:27 +08:00
辉鸭蛋 2d4a6192f2 fix #606 2024-09-11 22:30:34 +08:00
ema 7b51c018a7 feat: ExceptionReport 2024-09-11 22:28:59 +08:00
辉鸭蛋 121bfbaa8e fix #608 2024-09-11 21:50:17 +08:00
辉鸭蛋 8d2b36d5fd refactor: script run 2024-09-10 23:27:04 +08:00
辉鸭蛋 c83d3e336f Update README.md 2024-09-10 16:17:42 +08:00
辉鸭蛋 5f76749be7 use System.Windows.Forms.MessageBox for unhandled exception 2024-09-10 00:32:12 +08:00
辉鸭蛋 57d2257283 fix map hotkey not save 2024-09-10 00:20:07 +08:00
辉鸭蛋 1657beb9a8 fix open map viewer 2024-09-10 00:01:04 +08:00
辉鸭蛋 1829498647 update ui
更新文本提示和超链接,修改热键名称

在 `JsListPage.xaml` 文件中,更新了文本内容,增加了“建议在调度器中使用!”的提示。
在 `MapPathingPage.xaml` 文件中,更新了文本内容,增加了“建议在调度器中使用!”的提示,并添加了一个超链接,指向地图追踪使用教程。
在 `HotKeyPageViewModel.cs` 文件中,将热键设置模型的名称从“添加记录点”更改为“添加路径点”。
在 `MapPathingViewModel.cs` 文件中,新增了一个 `OnGoToPathingUrl` 方法,该方法通过超链接打开地图追踪使用教程的网页。
2024-09-09 23:19:07 +08:00
辉鸭蛋 cb53c74c6c log opt 2024-09-09 22:55:52 +08:00
辉鸭蛋 4e6190ac7b fixed #598 2024-09-09 22:42:35 +08:00
辉鸭蛋 bb374ee491 update script 2024-09-09 22:00:34 +08:00
辉鸭蛋 a06f0fcdb2 auto pathing: fix not releasing the mouse and keyboard when stopping tasks
更新日志和黑名单

移除 `PathExecutor.cs` 中的无用引用,重构 `Pathing` 方法,添加 `InitializePathing` 和 `ConvertWaypoints` 方法,提取传送点处理逻辑到 `HandleTeleportWaypoint` 方法。修改 `TpTask.cs` 中的日志格式为浮点数格式。将 `TaskRunner.cs` 中的 `FireAndForgetAsync` 方法重命名为 `RunThreadAsync`,并在 `ScriptService.cs` 中相应替换调用。为 `DpiHelper.cs` 中的 `ScaleY` 属性添加注释。更新 `pick_black_lists.json`,添加新的黑名单项 `"摆放巧像"`。在 `MapPathingViewModel.cs` 中添加 `_mapViewer` 字段,并在 `OnOpenMapViewer` 方法中使用。
2024-09-09 21:57:48 +08:00
辉鸭蛋 1a2b63fff7 update submodule
更新子项目提交版本

更新了子项目的提交版本,从 `2a839bffb0a74d7289b0009de817a7aa523dab68` 变更为 `076ca948ca5d7888f3b42b5cc002363e13489e6b`。
2024-09-09 21:10:06 +08:00
辉鸭蛋 220d6a4f9b fix multi thread ui bug & rotate with dpi
优化 DPI 处理和异步任务执行

在 `PathExecutor.cs` 中,添加了对 `BetterGenshinImpact.Helpers` 的引用,并引入了 `DpiHelper` 来调整 `_dpi` 变量。
在 `PathExecutor` 类中,添加了 `_dpi` 变量,并在 `Pathing` 方法中初始化 `_dpi` 为 `DpiHelper.ScaleY`。
修改了 `RotateTo` 方法的 `controlRatio` 参数类型,从 `int` 改为 `double`,并在调用 `Simulation.SendInput.Mouse.MoveMouseBy` 时乘以 `_dpi` 进行 DPI 缩放。
在 `TaskRunner.cs` 中,添加了 `FireAndForgetAsync` 方法,用于异步执行任务。
在 `ScriptService.cs` 中,添加了对 `BetterGenshinImpact.Helpers` 的引用。
修改了 `ScriptService` 类中调用 `TaskRunner` 的方式,从 `RunAsync` 改为 `FireAndForgetAsync`。
在 `ScriptControlViewModel.cs` 中,简化了调用 `_scriptService.RunMulti` 的方式,去掉了多余的 `Task.Run` 包装。
2024-09-09 00:44:24 +08:00
辉鸭蛋 d6860d5294 0.34.0 2024-09-08 23:36:53 +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
辉鸭蛋 5984adf015 auto pathing: add pick timer
更新地图特征点路径和UI文本,地图追踪时添加自动拾取

在 `FeatureStorage.cs` 中,将 `rootPath` 的路径从 `Global.Absolute(@"User\Map\");` 修改为 `Global.Absolute(@"Assets\Map\");`。
在 `Navigation.cs` 中,更新了日志信息的内容,使其更加明确首次加载速度较慢。
在 `BigMap.cs` 中,将 `FeatureMatcher` 的初始化参数从 `MapAssets.Instance.MainMap256BlockMat.Value` 修改为 `new Size(4096, 3328)`。
在 `MapPathingPage.xaml` 中,更新了部分 UI 文本,使其更加准确和清晰。例如,将“查看地图”修改为“查看实时追踪地图”,并在功能描述中添加了“尝鲜”字样。
在 `MapPathingPage.xaml` 中,注释掉了一个 `GridViewColumn`,该列包含了一个操作按钮。
在 `MapPathingViewModel.cs` 中,添加了 `using BetterGenshinImpact.Core.Script.Dependence.Model;` 引用。
在 `MapPathingViewModel.cs` 中,修改了 `TaskRunner` 的初始化参数,并在执行路径任务前添加了一个触发器。
在 `PickHandler.cs` 中,添加了一个新的类 `PickHandler`,并标记为 `[Obsolete]`,表示该类暂时不需要。
2024-09-08 20:28:50 +08:00
辉鸭蛋 4276957837 tp opt & F11 can cancel script task
优化日志记录和任务取消逻辑

在 `PathExecutor.cs` 中添加了 `using System.Diagnostics;` 语句。
注释掉了 `PathExecutor` 类中的部分日志信息。
将 `MoveTo` 和 `MoveCloseTo` 方法中的日志记录改为使用 `Debug.WriteLine`。
修改了 `MoveTo` 和 `MoveCloseTo` 方法中的循环条件,改为 `while (!cts.IsCancellationRequested)`。
将 `MoveTo` 方法中的超时时间从 30 秒改为 60 秒。
在 `TpTask.cs` 中增加了对配置项的最小值检查。
在 `MapAssets.cs` 中添加了新的地图坐标 `{ "纳塔", [8973.5, -1879.1] }`。
在 `HomePageViewModel.cs` 中添加了 `using BetterGenshinImpact.Core.Script;` 语句。
在 `HomePageViewModel` 类的 `Stop` 方法中,添加了取消独立任务的逻辑。
2024-09-08 19:44:34 +08:00
辉鸭蛋 a0691f1c19 auto pathing: add mapper viewer 2024-09-08 19:08:46 +08:00
辉鸭蛋 ca6994a720 auto pathing : first version 2024-09-08 15:16:02 +08:00
辉鸭蛋 cb09a369c2 auto pathing: fix jump and fly 2024-09-08 12:33:58 +08:00
辉鸭蛋 535f6b4551 auto hangout: fix 诺艾尔第二幕 #581
更新诺艾尔第二幕结局对话内容

修改了多个结局的对话内容,删除了一些冗余语句,并新增了更简洁的表达:
- 结局1: 删除“换个地方,缓解一下紧张感吧”和“去港口吧,说不定能向千岩军请教”,新增“缓解一下紧张感吧”和“去港口吧”。
- 结局2: 删除“换个地方,缓解一下紧张感吧”和“去[三碗不过港]吧,然后再往前走走”,新增“缓解一下紧张感吧”和“三碗不过港”。
- 结局3: 删除“不要逃避,直面考试压力吧”,新增“直面考试压力吧”。
- 结局4: 删除“不要逃避,直面考试压力吧”,新增“直面考试压力吧”。
- 结局5: 删除“不要逃避,直面考试压力吧”和“可以成为琴那样的[代理团长]”,新增“直面考试压力吧”和“琴那样”。
- 结局6: 删除“不要逃避,直面考试压力吧”和“可以成为凯亚那样的[骑兵队长]”,新增“直面考试压力吧”和“凯亚那样”。
2024-09-08 12:33:30 +08:00
辉鸭蛋 1f798b9a3a auto hangout: fix 班尼特+重云 #581
更新班尼特和重云结局中的对话和标题

修改了“班尼特结局6:辛运的可能性”中的一行对话,从“怎么能让你承担危险呢”改为“承担危险”。
修改了“重云结局4”的标题,从“试菜员罗伊斯”改为“一无所获”。
2024-09-08 10:26:53 +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
辉鸭蛋 93250f84cf update UI experience
在 `App.xaml` 中添加了 `BooleanToEnableTextConverter` 转换器。
在 `ScriptControlPage.xaml` 中:
  * 更新了文本描述,增加了对配置组排序的说明。
  * 添加了一个新的 `TextBlock` 和 `Button`,用于新增配置组。
  * 将“启用状态”列从简单的文本显示改为 `ToggleSwitch` 控件,并使用 `BooleanToEnableTextConverter` 进行绑定。
  * 将 `ListBox.ContextMenu` 更改为 `ListView.ContextMenu`。
  * 为“修改JS脚本自定义配置”菜单项添加了样式和触发器,以根据脚本类型动态显示或隐藏。
在 `ScriptControlViewModel.cs` 中:
  * 添加了 `System.ComponentModel` 的引用。
  * 注释掉了 `WriteScriptGroup` 的循环调用。
  * 修改了 `ShowEditWindow` 方法,将关闭按钮文本从“确定”改为“关闭”。
  * 在 `EditJsScriptSettings` 方法中,添加了对 `LoadSettingUi` 返回值的检查,并在未提供自定义配置时显示警告。
  * 在 `ScriptProjectsCollectionChanged` 方法中,添加了对项目属性变化的事件处理。
  * 添加了 `ScriptProjectsPChanged` 方法,用于处理项目属性变化事件。
  * 更新了 `OnGoToScriptGroupUrl` 方法中的 URL。
新增了 `BooleanToEnableTextConverter.cs` 文件,实现了 `BooleanToEnableTextConverter` 转换器,用于将布尔值与启用状态文本进行转换。
2024-09-07 12:31:07 +08:00
辉鸭蛋 010beebcb6 add open fight script command #569 2024-09-06 00:35:31 +08:00
辉鸭蛋 e6aa70a74c add pick black list 2024-09-06 00:06:25 +08:00
辉鸭蛋 f6801eeaab update ui text #583
原来的文本块内容是“在游戏内剧情‘自动’开启时,快速跳过文本、自动选择选项”,现在被修改为“快速跳过剧情文本、自动选择选项、自动提交物品等”。
2024-09-05 00:49:40 +08:00
辉鸭蛋 522d0517a6 update script 2024-09-03 01:20:09 +08:00
辉鸭蛋 c90fb15557 add 5.0 tp pos 2024-09-03 01:05:37 +08:00
辉鸭蛋 5726e73d40 更新传送点绘制逻辑及界面文本
在 `MainWindow.xaml` 中,修改了按钮文本,将“超大地图标点”改为“画传送点”,并调整了按钮属性顺序以符合 XAML 标准格式。

在 `MapTeleportPointDraw.cs` 中:
- 添加命名空间引用。
- 修改 `Draw` 方法中的文件路径和数据源,增加从 `MapAssets.Instance.TpPositions` 中加载传送点。
- 修改 `DrawTeleportPoint` 方法参数类型为 `List<GiWorldPosition>`,增加坐标转换和文字标注。
- 修改 `LoadTeleportPoint` 方法返回类型为 `List<GiWorldPosition>`。
- 修改 `Transform` 方法返回类型为 `GiWorldPosition`,简化坐标转换逻辑。

在 `ScaleTest.cs` 中:
- 修改 `ZoomOutTest` 方法加载的图像模式为彩色图。
- 修改缩小倍数为 4 倍,调整目标文件路径和图像尺寸。
2024-09-03 00:50:03 +08:00
辉鸭蛋 5d70782c49 auto pick: hard-coding #573 2024-09-02 23:25:24 +08:00
辉鸭蛋 3430e116e3 auto tp: retry after failed map recognition 2024-09-02 01:38:01 +08:00
辉鸭蛋 139b2089d5 fix _submitGoodsEnabled & _closePopupPagedEnabled not vaild 2024-09-01 20:48:45 +08:00
辉鸭蛋 0056dcfc11 #558 2024-09-01 20:46:34 +08:00
辉鸭蛋 c5d5ccab0e fix: trigger may not obtain the latest screenshot 2024-09-01 20:23:10 +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
辉鸭蛋 8931a633f1 update pick_black_lists 2024-09-01 00:46:47 +08:00
辉鸭蛋 ae5dbab855 update pick_black_lists 2024-09-01 00:38:18 +08:00
辉鸭蛋 fe09e9c35f Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-09-01 00:35:20 +08:00
辉鸭蛋 023733d88f Merge pull request #573 from rong-xiaoli/main
[bug] Fix: AutoPick chose wrong option
2024-09-01 00:33:55 +08:00
辉鸭蛋 93944250e6 update avatar classify model to 5.0 2024-09-01 00:22:45 +08:00
辉鸭蛋 c9f7b3a14b auto wood: automatically disable logging function upon initial failure 2024-09-01 00:22:08 +08:00
容小狸 ae75e9007d Update pick_black_lists.json
Added:
  "我在「回声之子」的声望…";
  "我在「悬木人」的声望…";
  "我在「流泉之众」的声望…";
2024-08-31 21:31:59 +08:00
辉鸭蛋 181b486db7 update avatar to 5.0 2024-08-31 14:17:28 +08:00
辉鸭蛋 4e7349fac4 update Yap to 5.0 2024-08-31 13:29:00 +08:00
辉鸭蛋 36da78cb78 update map data to 5.0 2024-08-31 13:22:05 +08:00
辉鸭蛋 bfddb53fa0 update script repo 2024-08-31 01:24:21 +08:00
辉鸭蛋 185ce4d930 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-31 01:09:52 +08:00
辉鸭蛋 7d82b1af9f add scripts submodule 2024-08-31 01:09:19 +08:00
辉鸭蛋 cb47bf730b delete scripts 2024-08-31 01:07:54 +08:00
辉鸭蛋 b2fecf1155 Merge pull request #567 from haokaiyang/main
auto tcg: update character card config to v5.0
2024-08-30 11:40:40 +08:00
haokaiyang 201ac734cb auto tcg: update character card config to v5.0 2024-08-30 11:23:39 +08:00
辉鸭蛋 bb6aa9e121 auto skip: add pause text #552 2024-08-26 23:17:35 +08:00
辉鸭蛋 b68b0d85f6 Js -> JS 2024-08-24 02:28:31 +08:00
辉鸭蛋 7f03157c25 add GetBigMapPosHotkey 2024-08-24 02:22:52 +08:00
辉鸭蛋 461b0b00d1 add JS script dynamic settings 2024-08-24 02:13:46 +08:00
ema 24d798d6b2 UI/UX: use MessageBox from Violeta 2024-08-20 23:46:29 +08:00
辉鸭蛋 447fd103de support high dpi keyboard and mouse recording 2024-08-20 23:40:25 +08:00
辉鸭蛋 b7d492e5d2 I don't know why this error occurred, but I fixed it 2024-08-20 23:35:08 +08:00
辉鸭蛋 3b701735e6 fix kmscript dpi adapt 2024-08-20 23:22:40 +08:00
辉鸭蛋 928f9612c0 Update README.md 2024-08-20 01:17:31 +08:00
辉鸭蛋 a440729a67 Merge pull request #535 from lwh9346/main
继续完善自动寻路
2024-08-20 01:16:10 +08:00
辉鸭蛋 64c5ab78bc Merge branch 'main' into main 2024-08-20 01:15:55 +08:00
辉鸭蛋 c370410d53 add runner 2024-08-20 01:04:59 +08:00
辉鸭蛋 98b1376111 0.33.1 2024-08-19 23:14:55 +08:00
lwh9346 622a4d5fde allow adding target points 2024-08-19 11:25:55 +08:00
lwh9346 fb0c63f8a8 optimize fly mode and path recording 2024-08-19 11:14:37 +08:00
lwh9346 1610f1cd31 remove redundant screen capture 2024-08-18 22:47:23 +08:00
lwh9346 ab2d6c1de4 copy when transforming coordinate 2024-08-18 21:55:08 +08:00
辉鸭蛋 b62e4a7425 add script group editor 2024-08-18 21:41:12 +08:00
lwh9346 8f64c0ca4e remove unnecessary task run 2024-08-18 21:28:03 +08:00
lwh9346 57138a7be0 Merge branch 'main' of github.com:babalae/better-genshin-impact 2024-08-18 17:41:13 +08:00
辉鸭蛋 6aa02b94d9 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-18 14:49:00 +08:00
qhy040404 be89383add fix relative path 2024-08-18 09:06:58 +08:00
辉鸭蛋 0097bfa8c3 edit auto crystalfly script 2024-08-17 20:23:29 +08:00
lwh9346 9393b0cb24 test and make "move to" functional 2024-08-17 19:16:26 +08:00
辉鸭蛋 6812f30732 optimize script execution 2024-08-17 18:00:03 +08:00
辉鸭蛋 c6680ced12 add js script page 2024-08-17 16:02:54 +08:00
辉鸭蛋 b47ce6f529 modify menu hierarchy 2024-08-17 12:09:03 +08:00
NextKale d17a29890f Merge branch 'main' of github.com:atiasn/better-genshin-impact 2024-08-16 08:01:16 +08:00
ema 9b874d3747 small trial with using Toast instead of MessageBox 2024-08-16 00:43:32 +08:00
辉鸭蛋 2b6465be22 edit kmscript name 2024-08-16 00:38:41 +08:00
辉鸭蛋 d2574022fc Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-16 00:34:29 +08:00
ema 87ae5e437a update: PresentMonFps version 2024-08-16 00:26:50 +08:00
辉鸭蛋 c486b860d0 0.32.6 2024-08-16 00:11:53 +08:00
辉鸭蛋 4784551e10 expand the orange option recognition range 2024-08-16 00:11:20 +08:00
辉鸭蛋 030caec91f fix: auto skip ClosePopupPagedEnabled not effective 2024-08-16 00:02:20 +08:00
辉鸭蛋 8b0bdef670 edit script group name 2024-08-15 23:55:57 +08:00
辉鸭蛋 6651ec7d9f attempt to correct coordinates 2024-08-15 00:00:12 +08:00
辉鸭蛋 d4fe1f2ab0 add BfMatch instead of FlannMatch 2024-08-14 23:21:03 +08:00
辉鸭蛋 4e1a0673c9 fix GetMiniMapPositionByFeatureMatch = 0 2024-08-14 22:25:15 +08:00
辉鸭蛋 f904fe024b Merge remote-tracking branch 'origin/main' into pr/522 2024-08-14 21:57:11 +08:00
ema bb41bcb25e Merge pull request #525 from babalae/cleanup
code cleanup
2024-08-14 19:43:21 +08:00
lwh9346 743debb58b Merge branch 'babalae:main' into main 2024-08-14 16:20:32 +08:00
lwh9346 180fc2d228 Merge branch 'main' of github.com:lwh9346/better-genshin-impact 2024-08-14 16:20:16 +08:00
lwh9346 d148014b7f testing code 2024-08-14 16:11:13 +08:00
lwh9346 9fa721d5e4 Merge branch 'babalae:main' into main 2024-08-14 15:10:41 +08:00
lwh9346 8a5d1d5f64 add path executor 2024-08-14 15:08:37 +08:00
lwh9346 cc245b0e8a change file structure 2024-08-14 14:01:21 +08:00
lwh9346 49bc6befb7 add script support 2024-08-14 14:00:56 +08:00
lwh9346 f82e35382c add UNTESTED path executor 2024-08-14 10:17:16 +08:00
lwh9346 224fc9917a add walk and swim to "move to" function 2024-08-14 01:39:27 +08:00
lwh9346 eb0b681b9d Merge branch 'main' of github.com:lwh9346/better-genshin-impact 2024-08-14 00:37:46 +08:00
lwh9346 f61a7c32d4 add basic code for auto pathing 2024-08-14 00:36:57 +08:00
NextKale af86c1147c Merge branch 'main' of github.com:atiasn/better-genshin-impact 2024-07-13 15:37:15 +08:00
NextKale 1c5fe7ec64 wood 2024-06-19 08:57:35 +08:00
484 changed files with 42828 additions and 8395 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
---
name: Bug report / 错误报告
about: Create a report to help us improve / 创建报告以帮助我们改进
title: "[bug] "
title: "[bug]请补充标题内容"
labels: bug
---
+1
View File
@@ -29,3 +29,4 @@ node_modules/
# Rider
.idea
_ReSharper.Caches/
+3
View File
@@ -0,0 +1,3 @@
[submodule "BetterGenshinImpact/Script"]
path = BetterGenshinImpact/Script
url = https://github.com/babalae/bettergi-scripts.git
@@ -0,0 +1,19 @@
<Project Sdk="MSTest.Sdk/3.6.4">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseVSTest>true</UseVSTest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BetterGenshinImpact.CombatScript\BetterGenshinImpact.CombatScript.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,52 @@
namespace BetterGenshinImpact.CombatScript.Test;
[TestClass]
public sealed class ScriptEmitTest
{
[TestMethod]
public void TestEmit()
{
ScriptUnit scriptUnit = new(
[
new CommentSymbol("测试注释"),
new LineBreakTriviaSymbol(),
new AvatarInstructionListSymbol(new("钟离"), [new SpaceTriviaSymbol()], new(
[
new WalkSymbol(WalkDirection.Backward, [new DoubleSymbol(0.1)], [], new CommaTriviaSymbol()),
new SkillSymbol(true, [new HoldSymbol()], [new SpaceTriviaSymbol()], new CommaTriviaSymbol()),
new WaitSymbol([new DoubleSymbol(0.3)], [new SpaceTriviaSymbol()], new CommaTriviaSymbol()),
new WalkSymbol(WalkDirection.Forward, [new DoubleSymbol(0.1)], [new SpaceTriviaSymbol()], default),
])),
new LineBreakTriviaSymbol(),
new AvatarInstructionListSymbol(new("芙宁娜"), [new SpaceTriviaSymbol()], new(
[
new SkillSymbol(true, [], new CommaTriviaSymbol()),
new BurstSymbol(true, [new SpaceTriviaSymbol()], default)
])),
new LineBreakTriviaSymbol(),
new AvatarInstructionListSymbol(new("行秋"), [new SpaceTriviaSymbol()], new(
[
new SkillSymbol(true, [], new CommaTriviaSymbol()),
new BurstSymbol(true, [new SpaceTriviaSymbol()], new CommaTriviaSymbol()),
new SkillSymbol(true, [new SpaceTriviaSymbol()], default),
])),
]);
Console.WriteLine(scriptUnit.Emit(new SymbolEmitter()));
}
[TestMethod]
public void TestParse()
{
ReadOnlySpan<char> raw = """
// 测试注释
钟离 s(0.1),e(hold),wait(0.3),w(0.1)
芙宁娜 e,q
行秋 e,q,e
""";
ScriptUnit scriptUnit = SymbolParser.Parse(raw);
Console.WriteLine(scriptUnit.Emit(new SymbolEmitter()));
}
}
@@ -0,0 +1,31 @@
using System;
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class AttackSymbol : InstructionSymbol, IInstructionSymbolHasDuration
{
public AttackSymbol(ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("attack", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [0, 1]);
if (parameterList.Length is 1)
{
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out DoubleSymbol doubleSymbol);
HasDuration = true;
Duration = TimeSpan.FromSeconds(doubleSymbol.Value);
}
}
public AttackSymbol(ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("attack", leadingTriviaList, tailingTrivia)
{
}
public bool HasDuration { get; }
public TimeSpan Duration { get; }
}
@@ -0,0 +1,24 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public sealed class AvatarInstructionListSymbol : BaseSymbol
{
public AvatarInstructionListSymbol(AvatarSymbol avatar, ImmutableArray<TriviaSymbol> triviaList, InstructionListSymbol instructionList)
{
Avatar = avatar;
TriviaList = triviaList;
InstructionList = instructionList;
}
public AvatarSymbol Avatar { get; }
public ImmutableArray<TriviaSymbol> TriviaList { get; }
public InstructionListSymbol InstructionList { get; }
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(Avatar).Append(TriviaList).Append(InstructionList);
}
}
@@ -0,0 +1,16 @@
namespace BetterGenshinImpact.CombatScript;
public sealed class AvatarSymbol : BaseSymbol
{
public AvatarSymbol(string name)
{
Name = name;
}
public string Name { get; }
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(Name);
}
}
@@ -0,0 +1,6 @@
namespace BetterGenshinImpact.CombatScript;
public abstract class BaseSymbol : ISymbol
{
public abstract void Emit(ISymbolEmitter emitter);
}
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
@@ -0,0 +1,25 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class BurstSymbol : InstructionSymbol, IInstructionSymbolHasAlias
{
public BurstSymbol(bool isAlias, ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("burst", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [0]);
IsAlias = isAlias;
}
public BurstSymbol(bool isAlias, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("burst", leadingTriviaList, tailingTrivia)
{
IsAlias = isAlias;
}
public string AliasName { get; } = "q";
public bool IsAlias { get; }
}
@@ -0,0 +1,31 @@
using System;
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class ChargeSymbol : InstructionSymbol, IInstructionSymbolHasDuration
{
public ChargeSymbol(ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("charge", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [0, 1]);
if (parameterList.Length is 1)
{
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out DoubleSymbol doubleSymbol);
HasDuration = true;
Duration = TimeSpan.FromSeconds(doubleSymbol.Value);
}
}
public ChargeSymbol(ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("charge", leadingTriviaList, tailingTrivia)
{
}
public bool HasDuration { get; }
public TimeSpan Duration { get; }
}
@@ -0,0 +1,17 @@
namespace BetterGenshinImpact.CombatScript;
public sealed class CommaTriviaSymbol : TriviaSymbol
{
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(',');
}
}
public sealed class SemicolonTriviaSymbol : TriviaSymbol
{
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(';');
}
}
@@ -0,0 +1,16 @@
namespace BetterGenshinImpact.CombatScript;
public sealed class CommentSymbol : TriviaSymbol
{
public CommentSymbol(string comment)
{
Comment = comment;
}
public string Comment { get; }
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append("//").Append(Comment);
}
}
@@ -0,0 +1,31 @@
using System;
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class DashSymbol : InstructionSymbol, IInstructionSymbolHasDuration
{
public DashSymbol(ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("dash", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [0, 1]);
if (parameterList.Length is 1)
{
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out DoubleSymbol doubleSymbol);
HasDuration = true;
Duration = TimeSpan.FromSeconds(doubleSymbol.Value);
}
}
public DashSymbol(ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("dash", leadingTriviaList, tailingTrivia)
{
}
public bool HasDuration { get; }
public TimeSpan Duration { get; }
}
@@ -0,0 +1,16 @@
namespace BetterGenshinImpact.CombatScript;
public sealed class DoubleSymbol : BaseSymbol, IParameterSymbol
{
public DoubleSymbol(double value)
{
Value = value;
}
public double Value { get; }
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(Value);
}
}
@@ -0,0 +1,9 @@
namespace BetterGenshinImpact.CombatScript;
public sealed class HoldSymbol : BaseSymbol, IParameterSymbol
{
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append("hold");
}
}
@@ -0,0 +1,8 @@
namespace BetterGenshinImpact.CombatScript;
public interface IInstructionSymbolHasAlias
{
public string AliasName { get; }
public bool IsAlias { get; }
}
@@ -0,0 +1,10 @@
using System;
namespace BetterGenshinImpact.CombatScript;
public interface IInstructionSymbolHasDuration
{
public bool HasDuration { get; }
public TimeSpan Duration { get; }
}
@@ -0,0 +1,5 @@
namespace BetterGenshinImpact.CombatScript;
public interface IParameterSymbol : ISymbol
{
}
@@ -0,0 +1,6 @@
namespace BetterGenshinImpact.CombatScript;
public interface ISymbol
{
void Emit(ISymbolEmitter emitter);
}
@@ -0,0 +1,14 @@
namespace BetterGenshinImpact.CombatScript;
public interface ISymbolEmitter
{
string Emit();
ISymbolEmitter Append(char value);
ISymbolEmitter Append(char value, int repeatCount);
ISymbolEmitter Append(double value);
ISymbolEmitter Append(string value);
}
@@ -0,0 +1,18 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public sealed class InstructionListSymbol : BaseSymbol
{
public InstructionListSymbol(ImmutableArray<InstructionSymbol> instructions)
{
Instructions = instructions;
}
public ImmutableArray<InstructionSymbol> Instructions { get; }
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(Instructions);
}
}
@@ -0,0 +1,59 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public abstract class InstructionSymbol : BaseSymbol
{
protected InstructionSymbol(string name, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
{
Name = name;
HasParameterList = false;
LeadingTriviaList = leadingTriviaList;
TailingTrivia = tailingTrivia;
}
protected InstructionSymbol(string name, ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
{
Name = name;
HasParameterList = true;
ParameterList = parameterList;
LeadingTriviaList = leadingTriviaList;
TailingTrivia = tailingTrivia;
}
public string Name { get; }
public bool HasParameterList { get; }
public ImmutableArray<IParameterSymbol> ParameterList { get; }
public ImmutableArray<TriviaSymbol> LeadingTriviaList { get; }
public TriviaSymbol? TailingTrivia { get; set; }
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(LeadingTriviaList);
if (this is IInstructionSymbolHasAlias {IsAlias: true } hasAlias)
{
emitter.Append(hasAlias.AliasName);
}
else
{
emitter.Append(Name);
}
if (HasParameterList)
{
emitter.Append('(');
emitter.Append(ParameterList);
emitter.Append(')');
}
if (TailingTrivia is not null)
{
emitter.Append(TailingTrivia);
}
}
}
@@ -0,0 +1,35 @@
using System;
using System.Collections.Frozen;
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public static class InstructionThrowHelper
{
public static void ThrowIfParameterListIsDefault(ImmutableArray<IParameterSymbol> parameterList)
{
if (parameterList.IsDefault)
{
throw new ArgumentException($"Parameter list can not be default.");
}
}
public static void ThrowIfParameterListCountNotCorrect(ImmutableArray<IParameterSymbol> parameterList, FrozenSet<int> allowedCounts)
{
if (!allowedCounts.Contains(parameterList.Length))
{
throw new ArgumentException($"Instruction parameter count not correct.");
}
}
public static void ThrowIfParameterAtIndexIsNot<T>(ImmutableArray<IParameterSymbol> parameterList, int index, out T symbol)
where T : IParameterSymbol
{
if (parameterList.Length <= index || parameterList[index] is not T result)
{
throw new ArgumentException($"Instruction's parameter at index {index} must be a {typeof(T).Name}.");
}
symbol = result;
}
}
@@ -0,0 +1,25 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class JumpSymbol : InstructionSymbol, IInstructionSymbolHasAlias
{
public JumpSymbol(bool isAlias, ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("jump", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [0]);
IsAlias = isAlias;
}
public JumpSymbol(bool isAlias, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("jump", leadingTriviaList, tailingTrivia)
{
IsAlias = isAlias;
}
public string AliasName { get; } = "j";
public bool IsAlias { get; }
}
@@ -0,0 +1,28 @@
using System;
namespace BetterGenshinImpact.CombatScript;
public class LineBreakTriviaSymbol : TriviaSymbol
{
private readonly string lineBreak;
public LineBreakTriviaSymbol()
{
lineBreak = Environment.NewLine;
}
public LineBreakTriviaSymbol(string lineBreak)
{
if (lineBreak is not ("\r\n" or "\n" or "\r" or ";"))
{
throw new ArgumentException("Invalid line break.");
}
this.lineBreak = lineBreak;
}
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(lineBreak);
}
}
@@ -0,0 +1,23 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public sealed class ScriptUnit
{
public ScriptUnit(ImmutableArray<ISymbol> symbols)
{
Symbols = symbols;
}
public ImmutableArray<ISymbol> Symbols { get; }
public string Emit(ISymbolEmitter emitter)
{
foreach (ref readonly ISymbol symbol in Symbols.AsSpan())
{
symbol.Emit(emitter);
}
return emitter.Emit();
}
}
@@ -0,0 +1,30 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class SkillSymbol : InstructionSymbol, IInstructionSymbolHasAlias
{
public SkillSymbol(bool isAlias, ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("skill", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [0, 1]);
if (parameterList.Length is 1)
{
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out HoldSymbol _);
}
IsAlias = isAlias;
}
public SkillSymbol(bool isAlias, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("skill", leadingTriviaList, tailingTrivia)
{
IsAlias = isAlias;
}
public string AliasName { get; } = "e";
public bool IsAlias { get; }
}
@@ -0,0 +1,21 @@
namespace BetterGenshinImpact.CombatScript;
public class SpaceTriviaSymbol : TriviaSymbol
{
private readonly int count;
public SpaceTriviaSymbol()
{
count = 1;
}
public SpaceTriviaSymbol(int count)
{
this.count = count;
}
public override void Emit(ISymbolEmitter emitter)
{
emitter.Append(' ', count);
}
}
@@ -0,0 +1,37 @@
using System.Text;
namespace BetterGenshinImpact.CombatScript;
public sealed class SymbolEmitter : ISymbolEmitter
{
private readonly StringBuilder builder = new();
public string Emit()
{
return builder.ToString();
}
public ISymbolEmitter Append(char value)
{
builder.Append(value);
return this;
}
public ISymbolEmitter Append(char value, int repeatCount)
{
builder.Append(value, repeatCount);
return this;
}
public ISymbolEmitter Append(double value)
{
builder.Append(value);
return this;
}
public ISymbolEmitter Append(string value)
{
builder.Append(value);
return this;
}
}
@@ -0,0 +1,23 @@
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public static class SymbolEmitterExtensions
{
public static ISymbolEmitter Append(this ISymbolEmitter emitter, ISymbol symbol)
{
symbol.Emit(emitter);
return emitter;
}
public static ISymbolEmitter Append<TSymbol>(this ISymbolEmitter emitter, ImmutableArray<TSymbol> symbolList)
where TSymbol : ISymbol
{
foreach(ref readonly TSymbol symbol in symbolList.AsSpan())
{
symbol.Emit(emitter);
}
return emitter;
}
}
@@ -0,0 +1,193 @@
using System;
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
namespace BetterGenshinImpact.CombatScript;
public static class SymbolParser
{
public static ScriptUnit Parse(ReadOnlySpan<char> raw)
{
ImmutableArray<ISymbol>.Builder symbols = ImmutableArray.CreateBuilder<ISymbol>();
ParseLines(raw, symbols);
return new(symbols.ToImmutable());
}
private static void ParseLines(ReadOnlySpan<char> raw, ImmutableArray<ISymbol>.Builder symbols)
{
bool skipNextRange = false;
ref readonly char end = ref raw[^1];
foreach(Range range in raw.SplitAny(['\r', '\n', ';']))
{
if (skipNextRange)
{
skipNextRange = false;
continue;
}
int offset = range.End.GetOffset(raw.Length);
if (offset >= raw.Length)
{
break;
}
ref readonly char peek = ref raw[offset];
LineBreakTriviaSymbol lineBreakTrivia;
if (peek is '\r')
{
if (Unsafe.IsAddressLessThan(in peek, in end) && Unsafe.Add(ref Unsafe.AsRef(in peek), 1) is '\n')
{
// It's a CRLF
lineBreakTrivia = new("\r\n");
skipNextRange = true;
}
else
{
// It's a CR
lineBreakTrivia = new("\r");
}
}
else if (peek is '\n')
{
// It's a LF
lineBreakTrivia = new("\n");
}
else if (peek is ';')
{
lineBreakTrivia = new(";");
}
else
{
throw new InvalidOperationException($"Failed to parse line break trivia at {range}.");
}
if (ParseLine(raw[range]) is { } symbol)
{
symbols.Add(symbol);
}
symbols.Add(lineBreakTrivia);
}
}
private static ISymbol? ParseLine(ReadOnlySpan<char> raw)
{
if (raw.IsEmpty)
{
return default;
}
if (raw.StartsWith("//"))
{
return new CommentSymbol(raw[2..].ToString());
}
int indexOfSpace = raw.IndexOf(' ');
ReadOnlySpan<char> avatarIdentifier = raw[..indexOfSpace];
AvatarSymbol avatarSymbol = new(avatarIdentifier.ToString());
ImmutableArray<TriviaSymbol> triviaList = ParseTriviaList(raw[indexOfSpace..], out int advanced);
InstructionListSymbol listSymbol = ParseInstructionList(raw[(indexOfSpace + advanced)..]);
return new AvatarInstructionListSymbol(avatarSymbol, triviaList, listSymbol);
}
private static InstructionListSymbol ParseInstructionList(ReadOnlySpan<char> raw)
{
ImmutableArray<InstructionSymbol>.Builder builder = ImmutableArray.CreateBuilder<InstructionSymbol>();
foreach (Range range in raw.Split(','))
{
ReadOnlySpan<char> current = raw[range];
ImmutableArray<TriviaSymbol> leadingTriviaList = ParseTriviaList(current, out int advanced);
if (ParseInstruction(current[advanced..], leadingTriviaList) is { } symbol)
{
builder.Add(symbol);
}
}
return new(builder.ToImmutable());
}
private static InstructionSymbol? ParseInstruction(ReadOnlySpan<char> raw, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
{
if (raw.IsEmpty)
{
return default;
}
switch (raw[0])
{
// attack|a
case 'a':
break;
// burst
case 'b':
return new BurstSymbol(false, [], leadingTriviaList, tailingTrivia);
break;
// charge
case 'c':
break;
// dash|d
case 'd':
break;
// jump|j
case 'j':
break;
// q
case 'q':
return new BurstSymbol(true, [], leadingTriviaList, tailingTrivia);
break;
// skill|s
case 's':
break;
// wait|walk|w
case 'w':
break;
}
return default;
}
// Handle ','&' '
private static ImmutableArray<TriviaSymbol> ParseTriviaList(ReadOnlySpan<char> raw, out int advanced)
{
advanced = 0;
if (raw.IsEmpty)
{
return ImmutableArray<TriviaSymbol>.Empty;
}
ImmutableArray<TriviaSymbol>.Builder builder = ImmutableArray.CreateBuilder<TriviaSymbol>();
int spaceCount = 0;
foreach (ref readonly char value in raw)
{
advanced++;
if (value is ' ')
{
spaceCount++;
}
else
{
if (spaceCount is not 0)
{
builder.Add(new SpaceTriviaSymbol(spaceCount));
spaceCount = 0;
}
if (value is ',')
{
builder.Add(new CommaTriviaSymbol());
}
else
{
break;
}
}
}
return builder.ToImmutable();
}
}
@@ -0,0 +1,5 @@
namespace BetterGenshinImpact.CombatScript;
public abstract class TriviaSymbol : BaseSymbol
{
}
@@ -0,0 +1,23 @@
using System;
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class WaitSymbol : InstructionSymbol, IInstructionSymbolHasDuration
{
public WaitSymbol(ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("wait", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [1]);
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out DoubleSymbol doubleSymbol);
HasDuration = true;
Duration = TimeSpan.FromSeconds(doubleSymbol.Value);
}
public bool HasDuration { get; }
public TimeSpan Duration { get; }
}
@@ -0,0 +1,9 @@
namespace BetterGenshinImpact.CombatScript;
public enum WalkDirection
{
Forward,
Backward,
Left,
Right
}
@@ -0,0 +1,70 @@
using System;
using System.Collections.Immutable;
namespace BetterGenshinImpact.CombatScript;
public class WalkSymbol : InstructionSymbol, IInstructionSymbolHasAlias, IInstructionSymbolHasDuration, IParameterSymbol
{
public WalkSymbol(WalkDirection direction, ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("walk", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [1]);
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out DoubleSymbol doubleSymbol);
HasDuration = true;
Duration = TimeSpan.FromSeconds(doubleSymbol.Value);
Direction = direction;
IsAlias = true;
}
// Used for parameter
public WalkSymbol(WalkDirection direction, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("walk", leadingTriviaList, tailingTrivia)
{
Direction = direction;
IsAlias = true;
}
public WalkSymbol(ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> leadingTriviaList, TriviaSymbol? tailingTrivia)
: base("walk", parameterList, leadingTriviaList, tailingTrivia)
{
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [2]);
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out WalkSymbol directionAlias);
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 1, out DoubleSymbol doubleSymbol);
Direction = directionAlias.Direction;
HasDuration = true;
Duration = TimeSpan.FromSeconds(doubleSymbol.Value);
IsAlias = false;
}
public string AliasName
{
get
{
return Direction switch
{
WalkDirection.Forward => "w",
WalkDirection.Backward => "s",
WalkDirection.Left => "a",
WalkDirection.Right => "d",
_ => throw new ArgumentOutOfRangeException(),
};
}
}
public bool IsAlias { get; }
public WalkDirection Direction { get; }
public bool HasDuration { get; }
public TimeSpan Duration { get; }
}
@@ -19,9 +19,17 @@ public class AvatarClassifyGen
// 读取基础图像
// List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "*.png", SearchOption.TopDirectoryOnly).ToList();
// 只用一个图像
List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Sethos.png", SearchOption.TopDirectoryOnly).ToList();
// List<string> sideImageFiles2 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Clorinde.png", SearchOption.TopDirectoryOnly).ToList();
// sideImageFiles.AddRange(sideImageFiles2);
List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_HutaoCostumeWinter.png", SearchOption.TopDirectoryOnly).ToList();
List<string> sideImageFiles2 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Iansan.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles2);
List<string> sideImageFiles3 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Citlali.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles3);
List<string> sideImageFiles4 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Lanyan.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles4);
List<string> sideImageFiles5 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_XianglingCostumeWinter.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles5);
List<string> sideImageFiles6 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Mavuika.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles6);
// 生成训练集
GenTo(sideImageFiles, Path.Combine(BaseDir, @"dateset\train"), 200);
@@ -0,0 +1,201 @@
using System.Diagnostics;
using System.IO;
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Dataset;
public class AvatarClassifyTransparentGen
{
// 基础图像文件夹
private const string BaseDir = @"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\分类器\";
// 背景图像文件夹
private static readonly string BackgroundDir = Path.Combine(BaseDir, "background");
private static readonly Random Rd = new Random();
// 在类的开头添加一个新的常量
private const string SideSrcDir = "side_src";
private const string SideSrcTransportDir = "side_src_transport";
public static void GenAll()
{
// 调整透明度(可选,取消注释以启用)
AdjustTransparency(0.5f);
// 读取基础图像
// List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, SideSrcTransportDir), "*.png", SearchOption.TopDirectoryOnly).ToList();
// 只用一个图像
List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, SideSrcTransportDir), "UI_AvatarIcon_Side_HutaoCostumeWinter.png", SearchOption.TopDirectoryOnly).ToList();
List<string> sideImageFiles2 = Directory.GetFiles(Path.Combine(BaseDir, SideSrcTransportDir), "UI_AvatarIcon_Side_Iansan.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles2);
List<string> sideImageFiles3 = Directory.GetFiles(Path.Combine(BaseDir, SideSrcTransportDir), "UI_AvatarIcon_Side_Citlali.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles3);
List<string> sideImageFiles4 = Directory.GetFiles(Path.Combine(BaseDir, SideSrcTransportDir), "UI_AvatarIcon_Side_Lanyan.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles4);
List<string> sideImageFiles5 = Directory.GetFiles(Path.Combine(BaseDir, SideSrcTransportDir), "UI_AvatarIcon_Side_XianglingCostumeWinter.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles5);
List<string> sideImageFiles6 = Directory.GetFiles(Path.Combine(BaseDir, SideSrcTransportDir), "UI_AvatarIcon_Side_Mavuika.png", SearchOption.TopDirectoryOnly).ToList();
sideImageFiles.AddRange(sideImageFiles6);
// 生成训练集
GenTo(sideImageFiles, Path.Combine(BaseDir, @"dateset\train"), 200);
// 生成测试集
GenTo(sideImageFiles, Path.Combine(BaseDir, @"dateset\test"), 40);
// GenTo(new List<string> { sideImageFiles[1] }, Path.Combine(BaseDir, @"dateset\test"), 1);
}
static void GenTo(List<string> sideImageFiles, string dataFolder, int count)
{
// 保留区域 从底边中心为固定点
var reservedSize = new Size(60, 80);
Directory.CreateDirectory(dataFolder);
// 循环生成每个基础图像对应的数据集
foreach (string sideImageFile in sideImageFiles)
{
// 获取基础图像文件名
string sideImageFileName = Path.GetFileNameWithoutExtension(sideImageFile);
sideImageFileName = sideImageFileName.Replace("UI_AvatarIcon_Side_", "");
// 创建基础图像对应的数据集文件夹
string sideDataFolder = Path.Combine(dataFolder, sideImageFileName);
Directory.CreateDirectory(sideDataFolder);
// 读取基础图像
Mat sideImageSrc = Cv2.ImRead(sideImageFile, ImreadModes.Unchanged);
var channels = sideImageSrc.Split();
var alphaChannel = channels[3]; // 透明通道
for (int i = 0; i < 3; i++)
{
Cv2.Multiply(channels[i], alphaChannel, channels[i], 1 / 255.0);
}
var sideImage = new Mat();
Cv2.Merge(channels[..3], sideImage);
// Cv2.ImShow("avatar", sideImage);
// 循环生成图像
for (int i = 0; i < count; i++)
{
// 随机挑选一张背景图像
string backgroundImageFile = Path.Combine(BackgroundDir, Directory.GetFiles(BackgroundDir, "*.png")[Rd.Next(Directory.GetFiles(BackgroundDir, "*.png").Length)]);
// 从背景图像中随机取一块 128x128 的区域
Mat backgroundImage = Cv2.ImRead(backgroundImageFile, ImreadModes.Color);
Rect backgroundRect = new Rect(Rd.Next(backgroundImage.Width - 128), new Random().Next(backgroundImage.Height - 128), 128, 128);
Mat backgroundImageRegion = backgroundImage[backgroundRect];
// 随机平移、缩放保留区域
float scale = (float)(Rd.NextDouble() * (1.6 - 0.7) + 0.7);
int w = (int)(sideImage.Width * scale);
int h = (int)(sideImage.Height * scale);
Debug.WriteLine($"{sideImageFileName} 生成随机缩放{scale}");
// 把保留区域合成到背景图像上
Mat backgroundImageRegionClone = backgroundImageRegion.Clone();
var resizedSideImage = new Mat();
Cv2.Resize(sideImage, resizedSideImage, new Size(128 * scale, 128 * scale));
// Cv2.ImShow("resizedSideImage", resizedSideImage);
var resizedMaskImage = new Mat();
// Cv2.Threshold(alphaChannel, alphaChannel, 200, 255, ThresholdTypes.Otsu);
Cv2.Resize(255 - alphaChannel, resizedMaskImage, new Size(128 * scale, 128 * scale), 0, 0, InterpolationFlags.Cubic);
var resizedAlphaChannel = new Mat();
Cv2.Resize(alphaChannel, resizedAlphaChannel, new Size(128 * scale, 128 * scale), 0, 0, InterpolationFlags.Cubic);
// Cv2.ImShow("resizedMaskImage", resizedMaskImage);
// generatedImage[transformedRect] = resizedSideImage;
Mat result;
if (scale > 1)
{
int xSpace1 = (int)((128 - reservedSize.Width * scale) / 2.0);
int ySpace1 = (int)(128 - reservedSize.Height * scale);
int xSpace2 = (int)((resizedSideImage.Width - 128) / 2.0);
int ySpace2 = resizedSideImage.Height - 128;
int xSpace = Math.Min(xSpace1, xSpace2);
int ySpace = Math.Min(ySpace1, ySpace2);
int offsetX = Rd.Next(-xSpace, xSpace);
int offsetY = Rd.Next(-ySpace, 0);
Debug.WriteLine($"{sideImageFileName} 缩放{scale}大于1 偏移 ({offsetX},{offsetY})");
var roi = new Rect((resizedSideImage.Width - 128) / 2 + offsetX, (resizedSideImage.Height - 128) + offsetY, 128, 128);
// result = new Mat();
// Cv2.BitwiseAnd(backgroundImageRegionClone, backgroundImageRegionClone, result, resizedMaskImage[roi]);
result = Mul(backgroundImageRegionClone, resizedAlphaChannel[roi]);
Cv2.Add(result, resizedSideImage[roi], result);
}
else
{
int xSpace = (128 - w) / 2;
int ySpace = 128 - h;
int offsetX = Rd.Next(-xSpace, xSpace);
int offsetY = Rd.Next(-ySpace, 0);
Debug.WriteLine($"{sideImageFileName} 缩放{scale}小于等于1 偏移 ({offsetX},{offsetY})");
var roi = new Rect((128 - resizedSideImage.Width) / 2 + offsetX, (128 - resizedSideImage.Height) + offsetY, resizedSideImage.Width, resizedSideImage.Height);
var res = new Mat();
// Cv2.BitwiseAnd(backgroundImageRegionClone[roi], backgroundImageRegionClone[roi], res, resizedMaskImage);
res = Mul(backgroundImageRegionClone[roi], resizedAlphaChannel);
Cv2.Add(res, resizedSideImage, res);
backgroundImageRegionClone[roi] = res;
result = backgroundImageRegionClone.Clone();
}
// Cv2.ImShow("avatarR", result);
// 保存生成的图像
Cv2.ImWrite(Path.Combine(sideDataFolder, $"{sideImageFileName}_t_{i}.png"), result);
}
}
static Mat Mul(Mat background, Mat alphaChannel)
{
var channels = background.Split();
for (int i = 0; i < 3; i++)
{
Cv2.Multiply(channels[i], 255 - alphaChannel, channels[i], 1 / 255.0);
}
Mat result = new Mat();
Cv2.Merge(channels[..3], result);
return result;
}
}
// 在类中添加以下新方法
public static void AdjustTransparency(float targetAlpha = 0.5f)
{
string sourcePath = Path.Combine(BaseDir, SideSrcDir);
string destinationPath = Path.Combine(BaseDir, SideSrcTransportDir);
Directory.CreateDirectory(destinationPath);
List<string> sideImageFiles = Directory.GetFiles(sourcePath, "*.png", SearchOption.TopDirectoryOnly).ToList();
foreach (string sideImageFile in sideImageFiles)
{
string fileName = Path.GetFileName(sideImageFile);
string destFile = Path.Combine(destinationPath, fileName);
Mat image = Cv2.ImRead(sideImageFile, ImreadModes.Unchanged);
Mat[] channels = Cv2.Split(image);
if (channels.Length == 4) // 确保图像有透明通道
{
Mat alphaChannel = channels[3];
Cv2.Multiply(alphaChannel, targetAlpha, alphaChannel);
Mat result = new Mat();
Cv2.Merge(channels, result);
Cv2.ImWrite(destFile, result);
}
else
{
Console.WriteLine($"警告:{fileName} 没有透明通道,将直接复制原文件。");
File.Copy(sideImageFile, destFile, true);
}
}
Console.WriteLine($"已完成透明度调整,结果保存在 {destinationPath}");
}
}
+28 -4
View File
@@ -4,7 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Test"
Width="120"
Width="240"
Height="450"
mc:Ignorable="d">
<Canvas>
@@ -31,7 +31,7 @@
Width="100"
Height="23"
Click="DoMatchTest"
Content="特征匹配测试" />
Content="生成特征点" />
<Button Canvas.Left="10"
Canvas.Top="130"
Width="100"
@@ -43,13 +43,21 @@
Width="100"
Height="23"
Click="MapDrawTeleportPoint"
Content="超大地图标点" />
Content="画传送点" />
<Button Canvas.Left="10"
Canvas.Top="190"
Width="100"
Height="23"
Click="GenAvatarData"
Content="生成侧面头像数据集" />
Content="侧面头像数据集" />
<Button Canvas.Left="120"
Canvas.Top="190"
Width="100"
Height="23"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Click="GenAvatarDataT"
Content="透明头像数据集" />
<Button Canvas.Left="10"
Canvas.Top="220"
Width="100"
@@ -62,5 +70,21 @@
Height="23"
Click="MapPathView"
Content="路线地图查看" />
<Button Canvas.Left="120"
Canvas.Top="10"
Width="100"
Height="23"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Click="ZoomOut"
Content="缩小地图到256" />
<Button Canvas.Left="120"
Canvas.Top="40"
Width="100"
Height="23"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Click="CameraTest"
Content="新视角识别测试" />
</Canvas>
</Window>
+44 -8
View File
@@ -1,17 +1,17 @@
using System.Windows;
using System.Diagnostics;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask.Common.Map;
using BetterGenshinImpact.Test.Dataset;
using BetterGenshinImpact.Test.Simple;
using BetterGenshinImpact.Test.Simple.AllMap;
using BetterGenshinImpact.Test.Simple.Track;
using BetterGenshinImpact.Test.View;
using System.Windows;
using BetterGenshinImpact.GameTask.Common.Map;
using OpenCvSharp;
using Window = System.Windows.Window;
namespace BetterGenshinImpact.Test;
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
@@ -32,7 +32,7 @@ public partial class MainWindow : Window
private void DoMapPuzzle(object sender, System.Windows.RoutedEventArgs e)
{
MapPuzzle.Put();
MapPuzzle.PutAll();
}
private void DoOcrTest(object sender, System.Windows.RoutedEventArgs e)
@@ -48,11 +48,16 @@ public partial class MainWindow : Window
private void DoMatchTest(object sender, System.Windows.RoutedEventArgs e)
{
// KeyPointMatchTest.Test();
EntireMapTest.Test();
// EntireMapTest.Test();
// EntireMapTest.Storage();
// BigMapMatchTest.Test();
// FeatureTransfer.Transfer();
// var extractor = new LargeSiftExtractor();
// extractor.ExtractAndSaveSift(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", @"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\");
EntireMapTest.Storage256();
}
private void MapDrawTeleportPoint(object sender, RoutedEventArgs e)
@@ -74,4 +79,35 @@ public partial class MainWindow : Window
{
MapPathTest.Test();
}
}
private void ZoomOut(object sender, RoutedEventArgs e)
{
ScaleTest.ZoomOutTest();
}
private void GenAvatarDataT(object sender, RoutedEventArgs e)
{
AvatarClassifyTransparentGen.GenAll();
}
private void CameraTest(object sender, RoutedEventArgs e)
{
var path = @"E:\HuiTask\更好的原神\地图匹配\比较\小地图\Clip_20240323_185854.png";
var pic1 = new Mat(path);
CameraOrientationFromLimint cameraOrientation = new();
var f = cameraOrientation.PredictRotation(pic1);
Debug.WriteLine("C#版本 方向1:" + f);
// var pic2 = new Mat(path);
// CameraOrientationV2 cameraOrientation3 = new();
// var f3 = cameraOrientation3.PredictRotation(pic2);
// Debug.WriteLine("py直接翻译C#版本 方向1:" + f3);
var grey = new Mat(path, ImreadModes.Grayscale);
var f2 = CameraOrientation.ComputeMiniMap(grey);
Debug.WriteLine("老版本方向2:" + f2);
}
}
@@ -17,7 +17,7 @@ public class BigMapMatchTest
SpeedTimer speedTimer = new();
// var mainMap100BlockMat = new Mat(@"D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\Assets\Map\mainMap100Block.png", ImreadModes.Grayscale);
var map2048 = MapAssets.Instance.MainMap2048BlockMat.Value;
var map2048 = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", ImreadModes.Grayscale);
var mainMap100BlockMat = ResizeHelper.Resize(map2048, 1d / (4 * 2));
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap128Block.png", mainMap100BlockMat);
@@ -6,6 +6,8 @@ using OpenCvSharp;
using OpenCvSharp.Detail;
using System.Diagnostics;
using System.Windows.Forms;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask.Common.Map;
namespace BetterGenshinImpact.Test.Simple.AllMap;
@@ -51,7 +53,13 @@ public class EntireMapTest
public static void Storage()
{
var featureMatcher = new FeatureMatcher(MapAssets.Instance.MainMap2048BlockMat.Value, new FeatureStorage("mainMap2048Block"));
var featureMatcher = new FeatureMatcher(new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", ImreadModes.Grayscale), new FeatureStorage("mainMap2048Block"));
MessageBox.Show("特征点生成完成");
}
public static void Storage256()
{
FeatureMatcher _featureMatcher = new( new Mat(Global.Absolute(@"Assets\Map\mainMap256Block.png"), ImreadModes.Grayscale), new FeatureStorage("mainMap256Block"));
MessageBox.Show("256特征点生成完成");
}
}
@@ -0,0 +1,150 @@
using System.Diagnostics;
using System.IO;
using OpenCvSharp;
using OpenCvSharp.Features2D;
namespace BetterGenshinImpact.Test.Simple.AllMap;
public class LargeSiftExtractor
{
private const int BLOCK_SIZE = 1024;
private const int OVERLAP_SIZE = BLOCK_SIZE * 3;
private readonly Feature2D _sift = SIFT.Create();
public void ExtractAndSaveSift(string imagePath, string outputPath)
{
Debug.WriteLine($"开始提取图像的SIFT特征: {imagePath}");
var img = Cv2.ImRead(imagePath, ImreadModes.Grayscale);
var allKeypoints = new List<KeyPoint>();
var allDescriptors = new List<Mat>();
// 计算需要切分的块数
int rows = (int)Math.Ceiling(img.Height / (double)BLOCK_SIZE);
int cols = (int)Math.Ceiling(img.Width / (double)BLOCK_SIZE);
Debug.WriteLine($"图像被分成 {rows} 行 {cols} 列的块。");
// 遍历每个块
for (int row = 0; row < rows; row++)
{
for (int col = 0; col < cols; col++)
{
Debug.WriteLine($"处理第 {row} 行,第 {col} 列的块");
var (keypoints, descriptors) = ProcessBlock(img, row, col);
// 调整keypoints的坐标
// 修改这里:使用 for 循环而不是 foreach
for (int i = 0; i < keypoints.Length; i++)
{
var kp = keypoints[i];
kp.Pt.X += col * BLOCK_SIZE;
kp.Pt.Y += row * BLOCK_SIZE;
keypoints[i] = kp;
}
allKeypoints.AddRange(keypoints);
allDescriptors.Add(descriptors);
}
}
// 合并所有descriptors
var finalDescriptors = new Mat();
Cv2.VConcat(allDescriptors.ToArray(), finalDescriptors);
// 保存结果
SaveFeatures(allKeypoints, finalDescriptors, outputPath);
// 释放资源
foreach (var desc in allDescriptors)
{
desc.Dispose();
}
Debug.WriteLine("SIFT特征提取和保存完成。");
}
private (KeyPoint[] keypoints, Mat descriptors) ProcessBlock(Mat img, int row, int col)
{
// 计算当前块的范围
int startY = row * BLOCK_SIZE;
int startX = col * BLOCK_SIZE;
// 处理边缘情况
bool isEdgeRow = row == 0 || row == img.Height / BLOCK_SIZE;
bool isEdgeCol = col == 0 || col == img.Width / BLOCK_SIZE;
if (!isEdgeRow && !isEdgeCol)
{
// 非边缘区域,使用重叠区域
int overlapStartY = Math.Max(0, startY - BLOCK_SIZE);
int overlapStartX = Math.Max(0, startX - BLOCK_SIZE);
using var blockRegion = new Mat(img,
new Rect(overlapStartX, overlapStartY,
Math.Min(OVERLAP_SIZE, img.Width - overlapStartX),
Math.Min(OVERLAP_SIZE, img.Height - overlapStartY)));
KeyPoint[] kps;
var desc = new Mat();
_sift.DetectAndCompute(blockRegion, null, out kps, desc);
Debug.WriteLine($"Block at ({row},{col}) - Original keypoints count: {kps.Length}");
// 找出中心区域关键点的索引
var centralKeypointIndices = new List<int>();
var centralKeypoints = new List<KeyPoint>();
for (int i = 0; i < kps.Length; i++)
{
if (kps[i].Pt.X >= BLOCK_SIZE && kps[i].Pt.X < BLOCK_SIZE * 2 &&
kps[i].Pt.Y >= BLOCK_SIZE && kps[i].Pt.Y < BLOCK_SIZE * 2)
{
centralKeypointIndices.Add(i);
var kp = kps[i];
kp.Pt.X -= BLOCK_SIZE;
kp.Pt.Y -= BLOCK_SIZE;
centralKeypoints.Add(kp);
}
}
// 创建新的描述符矩阵,只包含中心区域关键点的描述符
var centralDesc = new Mat(centralKeypointIndices.Count, desc.Cols, desc.Type());
for (int i = 0; i < centralKeypointIndices.Count; i++)
{
var rowIndex = centralKeypointIndices[i];
var row2 = desc.Row(rowIndex);
row2.CopyTo(centralDesc.Row(i));
row2.Dispose();
}
Debug.WriteLine($"中心区域处理了 {centralKeypoints.Count} 个关键点。");
return (centralKeypoints.ToArray(), centralDesc);
}
else
{
// 边缘区域,直接处理
using var blockRegion = new Mat(img,
new Rect(startX, startY,
Math.Min(BLOCK_SIZE, img.Width - startX),
Math.Min(BLOCK_SIZE, img.Height - startY)));
var desc = new Mat();
_sift.DetectAndCompute(blockRegion, null, out var kps, desc);
Debug.WriteLine($"边缘区域处理了 {kps.Length} 个关键点。");
return (kps, desc);
}
}
private void SaveFeatures(List<KeyPoint> keypoints, Mat descriptors, string outputPath)
{
Debug.WriteLine($"保存 {keypoints.Count} 个关键点和描述符到 {outputPath}");
using var fs1 = new FileStorage(Path.Combine(outputPath, "mainMap2048Block_SIFT.kp"), FileStorage.Modes.Write);
fs1.Write("kp", keypoints.ToArray());
fs1.Release();
using var fs2 = new FileStorage(Path.Combine(outputPath, "mainMap2048Block_SIFT.mat"), FileStorage.Modes.Write);
fs2.Write("desc", descriptors);
fs2.Release();
Debug.WriteLine("特征保存成功。");
}
}
@@ -8,7 +8,6 @@ namespace BetterGenshinImpact.Test.Simple.AllMap;
public class MapPuzzle
{
public static readonly int block = 2048;
public static List<string> PicWhiteHashList = new List<string>
{
@@ -26,9 +25,26 @@ public class MapPuzzle
public static MD5 Md5Service = MD5.Create();
public static void Put()
public static void PutAll()
{
string folderPath = @"E:\HuiTask\更好的原神\地图匹配\UI_Map"; // 图片文件夹路径
// 保存2048大图
// var img2048 = Put(2048);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", img2048);
// 保存1024
var img1024 = Put(1024);
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_1024.png", img1024);
// 保存256
// var grayImage = new Mat();
// Cv2.CvtColor(img1024.Resize(new Size(img1024.Width / 4, img1024.Height / 4), 0, 0, InterpolationFlags.Cubic), grayImage, ColorConversionCodes.BGR2GRAY);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_256.png", grayImage);
}
public static Mat Put(int block = 2048)
{
string folderPath = @"E:\HuiTask\更好的原神\地图匹配\UI_Map_5.2"; // 图片文件夹路径
string pattern = @"UI_MapBack_([-+]?\d+)_([-+]?\d+)(.*)";
var images = Directory.GetFiles(folderPath, "*.png", SearchOption.TopDirectoryOnly); // 获取所有图片文件路径
@@ -114,6 +130,7 @@ public class MapPuzzle
// 计算大图的总宽度和高度
var lenCol = maxCol - minCol;
var lenRow = maxRow - minRow;
Debug.WriteLine($"列数X: {lenCol+1}, 行数Y: {lenRow+1}");
int totalWidth = (lenCol + 1) * block;
int totalHeight = (lenRow + 1) * block;
@@ -157,16 +174,43 @@ public class MapPuzzle
Debug.WriteLine("");
}
// 保存大图
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\map_46_2048.png", largeImage);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\combined_image_sd4x.png", largeImage.Resize(new Size(largeImage.Width / 4, largeImage.Height / 4), 0, 0, InterpolationFlags.Cubic));
// 地图图片块
// SaveImagesAs1024X1024(arr, imageLocations, @"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\地图块", minRow, minCol);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\combined_image_small.png", largeImage.Resize(new Size(1400, 1300), 0, 0, InterpolationFlags.Cubic));
// 释放资源
largeImage.Dispose();
foreach (var img in imageLocations.Values)
return largeImage;
}
public static void SaveImagesAs1024X1024(int[,] arr, Dictionary<(int row, int col), ImgInfo> imageLocations, string outputFolder, int minRow, int minCol)
{
if (!Directory.Exists(outputFolder))
{
img.Img.Dispose();
Directory.CreateDirectory(outputFolder);
}
for (int row = 0; row < arr.GetLength(0); row++)
{
for (int col = 0; col < arr.GetLength(1); col++)
{
if (arr[row, col] == 1)
{
var key = (row + minRow, col + minCol);
if (imageLocations.TryGetValue(key, out var imgInfo))
{
var img = imgInfo.Img;
if (img.Width != 1204 || img.Height != 1204)
{
img = imgInfo.Img.Resize(new Size(1024, 1024), 0, 0, InterpolationFlags.Nearest);
}
var outputPath = Path.Combine(outputFolder, $"{row}_{col}.png");
Cv2.ImWrite(outputPath, img);
img.Dispose();
}
}
}
}
}
@@ -1,8 +1,11 @@
using BetterGenshinImpact.Service;
using BetterGenshinImpact.GameTask.AutoTrackPath.Model;
using BetterGenshinImpact.GameTask.Common.Map;
using BetterGenshinImpact.Service;
using OpenCvSharp;
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using BetterGenshinImpact.GameTask.Common.Element.Assets;
namespace BetterGenshinImpact.Test.Simple.AllMap;
@@ -10,24 +13,28 @@ public class MapTeleportPointDraw
{
public static void Draw()
{
var pList = LoadTeleportPoint(@"E:\HuiTask\更好的原神\地图匹配\地图点位\Json_Integration\锚点&神像\");
var map = new Mat(@"E:\HuiTask\更好的原神\地图匹配\genshin_map_带标记.png");
DrawTeleportPoint(map, pList.ToArray());
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\genshin_map_带标记_传送点.png", map);
// var pList = LoadTeleportPoint(@"E:\HuiTask\更好的原神\地图匹配\地图点位\5.0");
// pList.AddRange(MapAssets.Instance.TpPositions);
var map = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap1024BlockColor.png");
DrawTeleportPoint(map, MapLazyAssets.Instance.TpPositions);
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\传送点_1024_0.34.3.png", map);
}
public static void DrawTeleportPoint(Mat map, Point[] points)
public static void DrawTeleportPoint(Mat map, List<GiWorldPosition> points)
{
foreach (var point in points)
{
Cv2.Circle(map, new Point(point.X, point.Y), 10, Scalar.Red, 2);
var p = MapCoordinate.GameToMain1024(point.Position);
Cv2.Circle(map, p, 4, Scalar.Red, 2);
// 写文字
Cv2.PutText(map, $"[{point.X:F2},{point.Y:F2}]", new Point(p.X + 10, p.Y + 5), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
}
}
public static List<Point> LoadTeleportPoint(string folderPath)
public static List<GiWorldPosition> LoadTeleportPoint(string folderPath)
{
string[] files = Directory.GetFiles(folderPath, "*.*", SearchOption.AllDirectories);
List<Point> points = new();
List<GiWorldPosition> points = new();
foreach (var file in files)
{
var gamePoint = JsonSerializer.Deserialize<GamePoint>(File.ReadAllText(file), ConfigService.JsonOptions);
@@ -48,17 +55,12 @@ public class MapTeleportPointDraw
/// </summary>
/// <param name="position">[a,b,c]</param>
/// <returns></returns>
public static Point Transform(decimal[] position)
public static GiWorldPosition Transform(decimal[] position)
{
// 四舍六入五取偶
var a = (int)Math.Round(position[0]); // 上
var c = (int)Math.Round(position[2]); // 左
// 转换1024区块坐标,大地图坐标系正轴是往左上方向的
// 这里写最左上角的区块坐标(m,n)/(上,左),截止4.5版本,最左上角的区块坐标是(5,7)
int m = 5, n = 7;
return new Point((n + 1) * 1024 - c, (m + 1) * 1024 - a);
return new GiWorldPosition
{
Position = position,
};
}
class GamePoint
@@ -0,0 +1,16 @@
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple;
public class ScaleTest
{
public static void ZoomOutTest()
{
var mainMap2048BlockMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap2048Block.png", ImreadModes.Color);
// 缩小 2048/512 = 4
var targetFilePath = @"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap1024BlockColor.png";
// opencv 缩小
var mainMap256BlockMat = mainMap2048BlockMat.Resize(new Size(mainMap2048BlockMat.Width / 2, mainMap2048BlockMat.Height / 2));
mainMap256BlockMat.SaveImage(targetFilePath);
}
}
@@ -13,22 +13,22 @@ internal class MapPathTest
{
public static void Test()
{
var wayJson = File.ReadAllText(Global.Absolute(@"log\way\yl3.json"));
var way = JsonSerializer.Deserialize<GiPath>(wayJson, ConfigService.JsonOptions) ?? throw new Exception("way json deserialize failed");
var points = way.WayPointList.Select(giPathPoint => giPathPoint.MatchRect.GetCenterPoint()).ToList();
var pointsRect = Cv2.BoundingRect(points);
var allMap = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap2048Block.png");
// 按顺序连线,每个点都画圈
for (var i = 0; i < points.Count - 1; i++)
{
Cv2.Line(allMap, points[i], points[i + 1], Scalar.Red, 1);
Cv2.Circle(allMap, points[i], 3, Scalar.Red, -1);
}
var map = allMap[new Rect(pointsRect.X - 100, pointsRect.Y - 100, pointsRect.Width + 200, pointsRect.Height + 200)];
Cv2.ImShow("map", map);
// var wayJson = File.ReadAllText(Global.Absolute(@"log\way\yl3.json"));
// var way = JsonSerializer.Deserialize<GiPath>(wayJson, ConfigService.JsonOptions) ?? throw new Exception("way json deserialize failed");
//
// var points = way.WayPointList.Select(giPathPoint => giPathPoint.MatchRect.GetCenterPoint()).ToList();
//
// var pointsRect = Cv2.BoundingRect(points);
// var allMap = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap2048Block.png");
//
// // 按顺序连线,每个点都画圈
// for (var i = 0; i < points.Count - 1; i++)
// {
// Cv2.Line(allMap, points[i], points[i + 1], Scalar.Red, 1);
// Cv2.Circle(allMap, points[i], 3, Scalar.Red, -1);
// }
//
// var map = allMap[new Rect(pointsRect.X - 100, pointsRect.Y - 100, pointsRect.Width + 200, pointsRect.Height + 200)];
// Cv2.ImShow("map", map);
}
}
@@ -1,21 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>
<ItemGroup>
<None Remove="NativeMethods.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
@@ -1,10 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/CsWin32/main/src/Microsoft.Windows.CsWin32/settings.schema.json",
"allowMarshaling": true,
"useSafeHandles": false,
"emitSingleFile": true,
"public": true,
"comInterop": {
"useIntPtrForComOutPointers": true
}
}
@@ -1,38 +0,0 @@
// D3D11
CreateDirect3D11DeviceFromDXGIDevice
CreateDirect3D11SurfaceFromDXGISurface
// GDI32
BitBlt
CreateCompatibleBitmap
CreateCompatibleDC
DeleteDC
GetDeviceCaps
SelectObject
// User32
GetClientRect
GetDC
GetForegroundWindow
GetSystemMetrics
GetWindowDC
GetWindowRect
GetWindowThreadProcessId
mouse_event
PostMessage
ReleaseDC
EnumWindows
GetWindowText
IsWindowVisible
GetWindowTextLength
// COM & WinRT
D3D11CreateDevice
ID3D11Device3
IDirect3DDxgiInterfaceAccess
// Constants
D3D11_SDK_VERSION
DXGI_ERROR_UNSUPPORTED
WM_LBUTTONDOWN
WM_LBUTTONUP
+20 -40
View File
@@ -5,18 +5,10 @@ VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact", "BetterGenshinImpact\BetterGenshinImpact.csproj", "{75EC89E2-413D-4725-BCEA-AFAC57708F07}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vision.WindowCapture", "Vision.WindowCapture\Vision.WindowCapture.csproj", "{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Win32", "BetterGenshinImpact.Win32\BetterGenshinImpact.Win32.csproj", "{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.GameCapture", "Fischless.GameCapture\Fischless.GameCapture.csproj", "{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vision.WindowCapture.Test", "Vision.WindowCapture.Test\Vision.WindowCapture.Test.csproj", "{D35CB953-C666-4E57-9A9A-3AAE5BF78402}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.HotkeyCapture", "Fischless.HotkeyCapture\Fischless.HotkeyCapture.csproj", "{08152E44-2564-46C5-B5B2-54DD43C01A79}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.KeyboardCapture", "Fischless.KeyboardCapture\Fischless.KeyboardCapture.csproj", "{10A48327-7E58-4B51-B1FC-55506C703C8F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deploy", "Deploy", "{458E1106-43A4-47E6-B11B-D243035D4C76}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicaSetup", "Build\MicaSetup\MicaSetup.csproj", "{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}"
@@ -27,6 +19,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Test",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.WindowsInput", "Fischless.WindowsInput\Fischless.WindowsInput.csproj", "{9D00BC7A-9280-4AC9-8951-4502EDB71B76}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterGenshinImpact.CombatScript", "BetterGenshinImpact.CombatScript\BetterGenshinImpact.CombatScript.csproj", "{57C278F9-F62A-480A-B929-B0E5D8174194}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterGenshinImpact.CombatScript.Test", "BetterGenshinImpact.CombatScript.Test\BetterGenshinImpact.CombatScript.Test.csproj", "{09427DA8-665E-441A-A576-C11FBC6F9E5C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -43,22 +39,6 @@ Global
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.Build.0 = Release|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.ActiveCfg = Release|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.Build.0 = Release|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.ActiveCfg = Debug|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.Build.0 = Debug|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|x64.ActiveCfg = Debug|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|x64.Build.0 = Debug|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.ActiveCfg = Release|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.Build.0 = Release|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|x64.ActiveCfg = Release|x64
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|x64.Build.0 = Release|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.ActiveCfg = Debug|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.Build.0 = Debug|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|x64.ActiveCfg = Debug|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|x64.Build.0 = Debug|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.ActiveCfg = Release|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.Build.0 = Release|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|x64.ActiveCfg = Release|x64
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|x64.Build.0 = Release|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|Any CPU.ActiveCfg = Debug|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|Any CPU.Build.0 = Debug|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|x64.ActiveCfg = Debug|x64
@@ -67,14 +47,6 @@ Global
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|Any CPU.Build.0 = Release|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|x64.ActiveCfg = Release|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|x64.Build.0 = Release|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|Any CPU.ActiveCfg = Debug|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|Any CPU.Build.0 = Debug|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|x64.ActiveCfg = Debug|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|x64.Build.0 = Debug|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|Any CPU.ActiveCfg = Release|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|Any CPU.Build.0 = Release|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|x64.ActiveCfg = Release|x64
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|x64.Build.0 = Release|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|Any CPU.ActiveCfg = Debug|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|Any CPU.Build.0 = Debug|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|x64.ActiveCfg = Debug|x64
@@ -83,14 +55,6 @@ Global
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|Any CPU.Build.0 = Release|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|x64.ActiveCfg = Release|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|x64.Build.0 = Release|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|Any CPU.ActiveCfg = Debug|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|Any CPU.Build.0 = Debug|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|x64.ActiveCfg = Debug|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|x64.Build.0 = Debug|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|Any CPU.ActiveCfg = Release|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|Any CPU.Build.0 = Release|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|x64.ActiveCfg = Release|x64
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|x64.Build.0 = Release|x64
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Debug|x64.ActiveCfg = Debug|x64
@@ -123,6 +87,22 @@ Global
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|Any CPU.Build.0 = Release|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|x64.ActiveCfg = Release|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|x64.Build.0 = Release|x64
{57C278F9-F62A-480A-B929-B0E5D8174194}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57C278F9-F62A-480A-B929-B0E5D8174194}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57C278F9-F62A-480A-B929-B0E5D8174194}.Debug|x64.ActiveCfg = Debug|Any CPU
{57C278F9-F62A-480A-B929-B0E5D8174194}.Debug|x64.Build.0 = Debug|Any CPU
{57C278F9-F62A-480A-B929-B0E5D8174194}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57C278F9-F62A-480A-B929-B0E5D8174194}.Release|Any CPU.Build.0 = Release|Any CPU
{57C278F9-F62A-480A-B929-B0E5D8174194}.Release|x64.ActiveCfg = Release|Any CPU
{57C278F9-F62A-480A-B929-B0E5D8174194}.Release|x64.Build.0 = Release|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Debug|x64.ActiveCfg = Debug|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Debug|x64.Build.0 = Debug|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Release|Any CPU.Build.0 = Release|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Release|x64.ActiveCfg = Release|Any CPU
{09427DA8-665E-441A-A576-C11FBC6F9E5C}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+4 -1
View File
@@ -2,18 +2,21 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:bgivc="clr-namespace:BetterGenshinImpact.View.Converters"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:vio="http://schemas.lepo.co/wpfui/2022/xaml/violeta">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
<vio:ControlsDictionary />
<ResourceDictionary Source="/View/Controls/WpfUi/FaFontIconStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<FontFamily x:Key="TextThemeFontFamily">/Assets/Fonts/MiSans-Regular.ttf#MiSans</FontFamily>
<FontFamily x:Key="DigitalThemeFontFamily">/Assets/Fonts/deluge-led.ttf#Deluge LED</FontFamily>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<bgivc:BooleanToVisibilityRevertConverter x:Key="BooleanToVisibilityRevertConverter" />
<bgivc:BooleanToEnableTextConverter x:Key="BooleanToEnableTextConverter" />
<bgivc:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<bgivc:NotNullConverter x:Key="NotNullConverter" />
</ResourceDictionary>
+48 -4
View File
@@ -1,6 +1,7 @@
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.Helpers;
using BetterGenshinImpact.Helpers.Extensions;
using BetterGenshinImpact.Hutao;
using BetterGenshinImpact.Service;
using BetterGenshinImpact.Service.Interface;
using BetterGenshinImpact.Service.Notification;
@@ -10,6 +11,7 @@ using BetterGenshinImpact.View.Pages;
using BetterGenshinImpact.ViewModel;
using BetterGenshinImpact.ViewModel.Pages;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
@@ -20,7 +22,11 @@ using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
using BetterGenshinImpact.View.Pages.View;
using BetterGenshinImpact.ViewModel.Pages.OneDragon;
using BetterGenshinImpact.ViewModel.Pages.View;
using Wpf.Ui;
using Wpf.Ui.Violeta.Controls;
namespace BetterGenshinImpact;
@@ -35,6 +41,10 @@ public partial class App : Application
.CheckIntegration()
.UseElevated()
.UseSingleInstance("BetterGI")
.ConfigureLogging(builder =>
{
builder.ClearProviders();
})
.ConfigureServices(
(context, services) =>
{
@@ -65,9 +75,9 @@ public partial class App : Application
// App Host
services.AddHostedService<ApplicationHostService>();
// Page resolver service
services.AddSingleton<IPageService, PageService>();
services.AddSingleton<IUpdateService, UpdateService>();
// Service containing navigation, same as INavigationWindow... but without window
services.AddSingleton<INavigationService, NavigationService>();
@@ -85,15 +95,33 @@ public partial class App : Application
services.AddView<CommonSettingsPage, CommonSettingsPageViewModel>();
services.AddView<TaskSettingsPage, TaskSettingsPageViewModel>();
services.AddView<HotKeyPage, HotKeyPageViewModel>();
services.AddView<NotificationSettingsPage, NotificationSettingsPageViewModel>();
// services.AddView<NotificationSettingsPage, NotificationSettingsPageViewModel>();
services.AddView<KeyMouseRecordPage, KeyMouseRecordPageViewModel>();
// services.AddView<DispatcherPage, DispatcherPageViewModel>();
services.AddView<JsListPage, JsListViewModel>();
services.AddView<MapPathingPage, MapPathingViewModel>();
services.AddView<OneDragonFlowPage, OneDragonFlowViewModel>();
services.AddSingleton<PathingConfigViewModel>();
// services.AddView<PathingConfigView, PathingConfigViewModel>();
services.AddView<KeyBindingsSettingsPage, KeyBindingsSettingsPageViewModel>();
// 一条龙 ViewModels
// services.AddSingleton<CraftViewModel>();
// services.AddSingleton<DailyCommissionViewModel>();
// services.AddSingleton<DailyRewardViewModel>();
// services.AddSingleton<DomainViewModel>();
// services.AddSingleton<ForgingViewModel>();
// services.AddSingleton<LeyLineBlossomViewModel>();
// services.AddSingleton<MailViewModel>();
// services.AddSingleton<SereniteaPotViewModel>();
// services.AddSingleton<TcgViewModel>();
// My Services
services.AddSingleton<TaskTriggerDispatcher>();
services.AddSingleton<NotificationService>();
services.AddHostedService(sp => sp.GetRequiredService<NotificationService>());
services.AddSingleton<NotifierManager>();
services.AddSingleton<IScriptService, ScriptService>();
services.AddSingleton<HutaoNamedPipe>();
// Configuration
//services.Configure<AppConfig>(context.Configuration.GetSection(nameof(AppConfig)));
@@ -238,7 +266,23 @@ public partial class App : Application
e = e.InnerException;
}
MessageBox.Show("程序异常:" + e.Source + "\r\n--" + Environment.NewLine + e.StackTrace + "\r\n---" + Environment.NewLine + e.Message);
try
{
ExceptionReport.Show(e);
}
catch
{
// Fallback.
System.Windows.Forms.MessageBox.Show(
$"""
程序异常:{e.Source}
--
{e.StackTrace}
--
{e.Message}
"""
);
}
// log
GetLogger<App>().LogDebug(e, "UnHandle Exception");
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

@@ -1182,6 +1182,7 @@
"其老爷",
"关宏",
"关垂",
"杏仁长老",
"仲夏庭园",
"无妄引咎密宫",
"华池岩岫",
@@ -1341,6 +1342,21 @@
"残毁的剑柄",
"裂断的剑柄",
"未熄的剑柄",
"意志破碎的残片",
"意志明晰的寄偶",
"意志巡游的符像",
"聚燃的石块",
"聚燃的命种",
"聚燃的游像眼",
"秘源轴",
"秘源机鞘",
"秘源真芯",
"稚嫩的尖齿",
"老练的坚齿",
"横行霸者的利齿",
"卫从的木哨",
"战士的铁哨",
"龙冠武士的金哨",
"小灯草",
"慕风蘑菇",
"蒲公英籽",
@@ -1384,6 +1400,15 @@
"子探测单元",
"湖光铃兰",
"初露之源",
"颗粒果",
"烛伞蘑菇",
"烬芯花",
"澄晶实",
"苦种",
"肉龙掌",
"灼灼彩菊",
"浪沫羽鳃",
"青蜜莓",
"红莲蛾",
"蝴蝶",
"黑背鲈鱼",
@@ -1471,6 +1496,15 @@
"「公平」的教导",
"「正义」的教导",
"「秩序」的教导",
"「角逐」的哲学",
"「焚燔」的哲学",
"「纷争」的哲学",
"「角逐」的指引",
"「焚燔」的指引",
"「纷争」的指引",
"「角逐」的教导",
"「焚燔」的教导",
"「纷争」的教导",
"「金鱼草」的种子",
"「鸣草」的种子",
"「清心」的种子",
@@ -1551,6 +1585,9 @@
"魔晶块",
"奇异的「牙齿」",
"汲取了生命力的龙牙",
"牛奶",
"糖",
"固晶甲虫",
"新鲜的鸟蛋",
"新鲜的绯樱绣球",
"新鲜的海草",
@@ -1561,6 +1598,9 @@
"新鲜的绝云椒椒",
"新鲜的树莓",
"新鲜的香辛果",
"「永远高挂的落日」",
"「岸上游泳的鱼儿」",
"「夜晚显现的明月」",
"纯洁松果",
"碎星铁矿",
"烹饪",
@@ -1849,6 +1889,69 @@
"更改旋律",
"准备演出",
"继续演出",
"感谢信",
"开始演奏",
"募刻巧像",
"摆放巧像",
"绘想游迹",
"召唤激流",
"放入",
"旋转管道",
"让魔水流动吧!",
"就是现在",
"敲一敲…",
"我带你飞一次?",
"我来帮忙!",
"戳一戳",
"出发吧!",
"有点奇怪…",
"拉你一把",
"发生什么了?",
"交给我吧",
"已经安全了!",
"我需要那颗星星",
"用力拉",
"一起用力拉",
"你已经做得很好了",
"搭乘「空中列车」",
"这是什么比赛?",
"与纠结的小人结队",
"与贪吃的小人结队",
"与莽撞的小人结队",
"开始挑战",
"放置蘑菇",
"放置苹果",
"放置风车菊",
"放置鸟蛋",
"放置树莓",
"放置禽肉",
"放置蘑菇",
"放置甜甜花",
"放置绝云椒椒",
"走左边",
"走右边",
"走前面",
"算我一个!",
"找到你啦!",
"等待海上列车…",
"推一下",
"我来猜猜",
"是元能构装体?",
"是水深渊法师?",
"是穿蓝衣服的小兔子?",
"是超大松鼠?",
"是短鬓虎?",
"是穿绿衣服的狐狸?",
"我来试试",
"关于巨龙…",
"你还好吗?",
"魔线飞行",
"老旧的日记",
"发黄的信件",
"准备留影",
"用力拔",
"更加用力拔",
"污损的快件",
"无锋剑",
"银剑",
"训练大剑",
@@ -4545,6 +4648,817 @@
"布蕾斯特",
"苏定",
"玄理",
"奥比奇",
"波波拉诺",
"温柔的守卫",
"藏宝爱好者",
"卡佩",
"艾德加",
"席尔万",
"卢西恩",
"进入席尔万房间",
"进入卢西恩房间",
"进入艾德加房间",
"议论纷纷的群众",
"议论纷纷的群众",
"议论纷纷的群众",
"议论纷纷的群众",
"议论纷纷的群众",
"议论纷纷的群众",
"进入席尔万房间",
"艾德加",
"卡佩",
"奥比奇",
"波波拉诺",
"探长",
"埃斯诺尔",
"帕纽尔",
"罗泽尔",
"优雅的雕像",
"用力推!!!",
"用力拽!!!",
"用力抬!!!",
"温和的雕像",
"平静的雕像",
"福罗贝尔",
"奥雷卢",
"埃斯唐普",
"西梅",
"萨博兰",
"苏法什",
"陈旧的手稿",
"疲惫的手稿",
"兴奋的纸蛙",
"沉稳的纸蛙",
"好心的纸蛙",
"忧郁的纸蛙",
"123木头人",
"123木头人2",
"门后的声音",
"注脚",
"巨人卫兵",
"路人",
"星轨王城守卫",
"店长",
"粮油店长",
"巨人卫兵",
"巨人卫兵",
"巨人卫兵",
"巨人卫兵",
"星轨王城守卫",
"肖维涅",
"我来试试",
"我来试试",
"我来试试",
"我来试试",
"我来试试",
"我来试试",
"巨人卫兵",
"巨人卫兵",
"埃斯诺尔",
"失望的纸蛙",
"不满的纸蛙",
"发生什么了?",
"字迹歪歪扭扭的信",
"杏仁",
"溪泉",
"柑橘",
"翻看书页",
"布勒凡",
"布勒施",
"欧立威",
"毕塞尔特",
"搭乘「空中列车」",
"杜林",
"小杜林",
"拜希麦·五世",
"爆竹",
"板栗",
"白果",
"瑟杜尔",
"威尔",
"积木卫兵",
"蒙塔纳",
"魔女M",
"魔女B",
"冲在前面的士兵",
"冲在前面的士兵",
"门内的人",
"门内的人",
"门内的人",
"飞鼠",
"士兵",
"士兵",
"小飞鼠",
"飞鼠妈妈",
"老旧的日记",
"发黄的信件",
"进入「邪龙」的巢穴",
"德维特",
"许迪",
"克朗谢",
"埃洛夫",
"杏仁",
"溪泉",
"柑橘",
"等待海上列车…",
"前往提瓦特",
"前往星轨王城",
"前往破碎之海",
"前往提瓦特",
"「一篇未完成的手稿」",
"杏仁",
"溪泉",
"《提瓦特世界史·第一部分》",
"《枫丹香水广告集》",
"《白猫神探》",
"《薰衣草之花》",
"「伊利萨」",
"「半熟蛋」",
"「合成台」",
"「咕噜噜」",
"「大椰子」",
"「小波」",
"「此地的伟大精神」",
"「毛发如夜的野兽」",
"「灵道刻印门」",
"「炫彩呆子」",
"「狂图捕手」",
"「绿松石」",
"「翡翠」",
"「西弗安雅」",
"「金盏花」",
"「队长」",
"「黑曜石碑的影像」",
"丁戈内克",
"万奎洛",
"万杰鲁",
"不耐烦的贼匪",
"不耐烦的部族成员",
"专注的「花羽会」战士",
"为伙伴们烹饪料理",
"乌丘",
"乌兰塔",
"乌图伦库",
"乌尔",
"乌米",
"乌苏坎",
"乌茨勒",
"互动点",
"亚格贝乌",
"亚瓦尔",
"亚蕾琪",
"代杜古",
"伊克娜",
"伊兹娜",
"伊卡力",
"伊卡尤",
"伊图提娅",
"伊妮",
"伊扎帕",
"伊法",
"伊波莱",
"伊泽",
"伊瓦伊",
"伊约芭",
"伊茨昆",
"伊莫莎",
"伊莱帕",
"伊蒂莉",
"伊蕾尔",
"伊蜜",
"伊西多尔",
"伊西姆",
"伊赫卡",
"众人写成的记录",
"低语",
"佩蕾·努伊",
"依扎娜",
"依稀可以辨认的布告",
"克伊奈",
"克拉莉希娅",
"克瓦斯尼科夫",
"克维库",
"兰卡亚",
"兰维达",
"兰萨提",
"兰齐塔",
"兴奋的「回声之子」战士",
"冰冷的身躯",
"冷静的「回声之子」战士",
"凯塔",
"凯安",
"出魂试炼之所的留言",
"切妮",
"列扎诺夫",
"利别科",
"利洛",
"加勒弗大汪",
"加塔力",
"加杰雷",
"加纳尔",
"努乌",
"努斯妲",
"勇敢的匿叶龙",
"勇猛的嵴锋龙",
"勒拉",
"匿叶龙",
"南娜",
"卡乌帕",
"卡乌胡",
"卡乌鲁",
"卡伦雅",
"卡克斯",
"卡克斯的行装",
"卡兹加",
"卡力弗",
"卡卡妈妈",
"卡嘉",
"卡图马",
"卡安",
"卡帕可",
"卡拉穆鲁",
"卡纳鲁亚",
"卡胡那",
"卡胡鲁",
"卡马克",
"卡马加",
"卡齐娜",
"受困的匿叶龙",
"受困的嵴锋龙",
"古塞尼科夫",
"古寻梦祭司的记录·其之一",
"古寻梦祭司的记录·其之三",
"古寻梦祭司的记录·其之二",
"古寻梦祭司的记录·其之四",
"古瑟雷德",
"古老的布告",
"古老的日记",
"古老的碑刻",
"古雷马",
"叶莱菲",
"吉恩布",
"向下看",
"呆呆的小嵴锋龙",
"呆呆的绵驮兽",
"呼噜克",
"哈卡乌",
"哈蒂丝",
"哈隆加",
"唤灵师的手记·其一",
"唤灵师的手记·其二",
"商队成员",
"嗜岩·兽境幼兽",
"嘉乌兰妮",
"因卡纳克",
"因娜",
"团雀01",
"团雀02",
"团雀03",
"困倦的绒翼龙",
"图尼娜",
"图帕克",
"图蒂坦",
"图蕾娅",
"图达玛",
"圣王的手记·其一",
"圣王的手记·其七",
"圣王的手记·其三",
"圣王的手记·其九",
"圣王的手记·其二",
"圣王的手记·其五",
"圣王的手记·其八",
"圣王的手记·其六",
"圣王的手记·其四",
"坎内克",
"埃文苏",
"基尼奇",
"基斯庇",
"基班古",
"基维拉",
"基耶霍",
"塔力帕",
"塔卢加",
"塔尔科",
"塔恩加",
"塔洛娜",
"塔穆因",
"塔莫蕾",
"塔诺",
"塞奇托",
"塞巴尔",
"夏安卡",
"夏拉帕",
"夏温",
"夏芙米娅",
"夏萝·努伊",
"多巴",
"夜猫子",
"夜神",
"夜魂之灵",
"大家伙?",
"大胆的调查员",
"夸恩因",
"夸恩因的日记",
"夸梅",
"奇卡",
"奇怪的匿叶龙",
"奇普",
"奇梅",
"奇玛",
"奇科娅",
"奇马利",
"奈赫西",
"奎兹",
"奎泰克",
"奎皮亚",
"奥伯龙",
"奥坎比",
"奥奇坎",
"奥奇坎的残躯",
"奥娅",
"奥尔科",
"奥希娜",
"奥杜力",
"奥科兰",
"奥罗卢柯",
"奥西",
"奥贡",
"好奇的调查员",
"妮乌",
"妮佩卡",
"妮赫佳",
"威严的低语",
"娅特兰",
"娜恩希",
"娜玛卡",
"子澄",
"字迹模糊的笔记",
"孟尼力克",
"安切塔",
"安萨鲁",
"安蒂妮",
"家长般的大嵴锋龙",
"容韦勒",
"对话群演",
"小孩的笔记",
"小家伙?",
"小小蜜虫",
"尤季娜",
"尤庇娅",
"尤考姆",
"尼南",
"尼尼",
"尼赞贝",
"山王",
"嵴锋龙",
"嵴锋龙DJ",
"嵴锋龙斗舞女1",
"嵴锋龙斗舞女2",
"嵴锋龙斗舞男1",
"嵴锋龙斗舞男2",
"巡山客的手记",
"工匠的笔记·其一",
"工匠的笔记·其二",
"巴亚吉达",
"巴克",
"巴加约",
"巴哈蒂",
"巴拉诺夫",
"巴茨",
"布基纳",
"布尔莎",
"布纳马",
"布鲁",
"希乌休",
"希亚赫",
"希伊亚",
"希巴拉克",
"希库埃鲁",
"希皮利",
"希诺宁",
"帕兰",
"帕加尔",
"帕卡·努伊",
"帕尼娅",
"帕恰",
"帕朗",
"帕莉西娅",
"帕贾丹",
"年轻的行商",
"年长的行商",
"幻写灵",
"幼光",
"幼小的匿叶龙",
"幼嵴锋龙",
"幼年的暝视龙",
"庇兰",
"库伊米",
"库基亚",
"库娅",
"库希马纳",
"库延",
"库拉霍",
"库斯可",
"库特比",
"库珀·努伊",
"库约尼",
"库纳克",
"库西",
"库阿勒",
"库马约",
"庞塞",
"废弃-奇玛",
"废弃-希乌休",
"废弃-曼扎那",
"废弃-森塔加",
"废弃-阿乌伊娅",
"废弃-马察特利",
"延古",
"延塔莎",
"延索",
"待物3带背包",
"待物3带背包 深肤色",
"德乌特",
"德乌特(灵)",
"忧愁的绒翼龙",
"怪物2带背包",
"怪物2带背包 深肤色",
"怪物带背包",
"怪物带背包 深肤色",
"怯生生的小匿叶龙",
"恩加韦",
"恩古迪",
"恩孔加",
"恩托提亚",
"恩琳",
"恰斯卡",
"悠然的「花羽会」战士",
"愤怒的贩龙者",
"懒懒的鳍游龙",
"戈利科夫",
"战场情报",
"扎安娅",
"托奥",
"托尔特克",
"托托",
"托扬娜",
"托泰克",
"托赞",
"托赫兰妮",
"拉坎阿",
"拉密萨纳",
"拉斯塔恩",
"拉曼",
"拉比娜",
"拉马奈",
"挑战起点",
"振尘",
"提佐科",
"提凯伊",
"提帕诺",
"提莉乌娅",
"搭建帐篷",
"摩亚瓦",
"放置「古名」",
"斯塔杜欣",
"斯普赫",
"无名工匠的笔记",
"无名旅人的笔记·其一",
"无名旅人的笔记·其三",
"无名旅人的笔记·其二",
"无名旅人的笔记·其五",
"无名旅人的笔记·其四",
"无名祭司的笔记",
"昆纳乌",
"晕倒的匿叶龙",
"晕倒的鳍游龙",
"普玛",
"普玛莉",
"暝视龙",
"暴躁的部族战士",
"更换衣服",
"曼尤雅",
"曼扎那",
"曼科",
"曼萨",
"最佳飞行成绩记录",
"朗戈",
"木箱",
"未完成的乐稿",
"朱南",
"机灵的小嵴锋龙",
"来自过去的声音",
"松伽塔",
"某人留下的铭记·其一",
"某人留下的铭记·其三",
"某人留下的铭记·其二",
"某人留下的铭记·其五",
"某人留下的铭记·其四",
"某人遗落的风镜",
"柯奇妲",
"柯娅",
"柯林伍德",
"柯梯米",
"树上的小嵴锋龙",
"栖木普",
"格罗贝尔",
"格茜妮",
"格里斯潘",
"桑哈杰",
"桑科约克",
"梅兹莉",
"梅内娅",
"梅莎",
"梅西娜",
"森塔加",
"森珀娅",
"樋口铁矢",
"欣赏景色",
"欧洛伦",
"欧莎薇",
"残破的石碑",
"比于什",
"比奇津",
"比赛公告板",
"比赛选手",
"毛球",
"水豚",
"汉佩克",
"汉扎",
"沃蕾",
"波卡",
"波吉吉",
"波奇奇",
"波尼尼",
"波蒂莉",
"波蒂薇",
"泽伊拉",
"洛娅",
"活泼的绵驮兽",
"活跃的小嵴锋龙",
"海兹尔",
"海岳",
"涅兰",
"涅提",
"游学者的笔记",
"潘帕",
"灵体真女儿",
"爱可",
"爱梅拉",
"爱维莉",
"爱菲拉",
"爱雅",
"特佐佐",
"特佩潘",
"特帕切",
"特帕尔",
"特拉佐莉",
"特拉佐莉(表演用克隆人)",
"特拉帕尔",
"特拉忒",
"特拉波",
"特拉科",
"特沃德罗斯",
"特波兹",
"特立尼达",
"特纳华",
"特蒂赫莉",
"特诺切",
"特阿墨",
"特阿尤",
"特马乔",
"狄雷",
"献上供物",
"玛亚薇",
"玛伊蕾",
"玛兹嘉",
"玛拉妮",
"玛薇卡",
"玻娜",
"琪丝佩",
"琪希可",
"瓦伊妲",
"瓦伊纳",
"瓦兰卡",
"瓦凯·努伊",
"瓦卡尔",
"瓦图妲",
"瓦尔米",
"瓦托娅",
"瓦斯卡尔",
"瓦曼",
"瓦蕾",
"瓦达娜",
"界碑上的刻文",
"疑惑的调查员",
"疲惫的暝视龙",
"白浜",
"皮尔钦",
"皮希加",
"皮萨克",
"看向仪式台",
"研究中心紧急机械操作手册",
"磨损的记录",
"秋纽奥",
"科优尔",
"科奥劳",
"科奴拉芙",
"科帕",
"科斯特利茨基",
"科潘",
"科科庞",
"科米娜",
"科约帕",
"科莫奎",
"秘源哨机",
"穆伊萨",
"穆基",
"穆尔科",
"穆托塔",
"穆纳伊",
"穆蒲",
"竖立在旁的木牌",
"等待…",
"米卢·努伊",
"米奎克",
"米特尔",
"米齐卡",
"索尔涅夫",
"索莉马娜",
"约洛特莉",
"练习钻地的小嵴锋龙",
"细心的匿叶龙",
"绒翼龙",
"绒翼龙幼龙",
"维兰德",
"维图索夫",
"维护记录·其一",
"维护记录·其三",
"维护记录·其二",
"维查玛",
"维莎",
"羊驼",
"群演1",
"老鼠",
"耶里门",
"胆小的绵驮兽",
"胡妮",
"胡里约",
"自称「山下」之物",
"艾库瓦",
"苏娅",
"苏玛克",
"若娜瓦",
"茜特菈莉",
"荆和",
"莉乌娅",
"莉洛娅",
"莉琉",
"莉瓦",
"莉莉尤",
"莎乌莎",
"莎娜",
"莎维娅",
"莎迪蕾",
"莫乌",
"菲欣妮",
"菲耶蒂娜",
"萨加图拉",
"萨卡乌",
"萨科巴",
"萨约尔",
"萨费伊",
"葵可",
"葵莉娅",
"蒂亚戈",
"蒂图",
"蒂尔妲",
"蒂索克",
"蓬普",
"薇尔恰",
"虚弱的声音",
"虚弱的大灵显化身",
"虚弱的绒翼龙",
"虚弱的膨膨兽",
"被困的匿叶龙",
"被困的嵴锋龙",
"被困的幼暝视龙",
"被救出的匿叶龙",
"被救的鳍游龙",
"装饰花车",
"西坎",
"西布",
"西帕克",
"西蒂娜",
"西薇",
"观察护身符",
"观察武器",
"观察罐子",
"观察腰带",
"观察钓具",
"警示者的记录",
"记录用秘源哨机",
"谁人的手记",
"调查用投喂点",
"谜画涂鸦中的意志",
"谨慎的调查员",
"贝坎",
"贝雷哈努",
"贤龙",
"贪吃的绵驮兽",
"赫伯德",
"赫瓦特莉",
"辛佳",
"辛奇",
"达伊妲",
"达尔戈",
"达布亚",
"达祖玛",
"进行比赛",
"迷惑的调查员",
"迷灰中的石碑·其一",
"迷灰中的石碑·其三",
"迷灰中的石碑·其二",
"通皮斯",
"醒目的标语",
"钦特利",
"闪亮亮的贝壳",
"阿乌伊娅",
"阿乌琪",
"阿乔",
"阿伽娅",
"阿凯蒂",
"阿卡坦加",
"阿卡马",
"阿图科",
"阿坎蒂",
"阿基约",
"阿奇亚库",
"阿妮拉",
"阿姆鲁",
"阿孔",
"阿尔妲",
"阿尔帕",
"阿尤",
"阿布帕隆",
"阿希莉",
"阿斯基娅",
"阿斯麦隆",
"阿格莫",
"阿梅妲",
"阿特琪",
"阿科米蒂",
"阿米娜",
"阿纳",
"阿蕾梅",
"阿达玛",
"阿邦迪",
"阿隆",
"阿霍伊图",
"阿马佐利",
"阿鲁吉",
"陀罗诘利",
"陀达罗",
"难过的嵴锋龙",
"雅库普",
"雅蕾希",
"雅诺斯基",
"雇主",
"雷格巴",
"霍图鲁",
"霍娅",
"霍莱",
"韦尼埃米诺夫",
"顾客",
"马伊塔",
"马兹拉",
"马凯莫",
"马努阿",
"马塔伽",
"马塔伽!记得!!",
"马塔拉",
"马察特利",
"马尼菲科",
"马扎坦",
"马提库伊",
"马洛考",
"马特兰",
"马穆勒",
"马蒂亚斯",
"马西娜·努伊",
"马陶霍",
"驻扎日记",
"验收与维修记录",
"鳍游龙",
"鳍游龙夏威夷吉他",
"鳍游龙尤克里里",
"鳍游龙木吉他",
"鳍游龙箱鼓",
"麦斯欧德",
"黛希特莉",
"龙铭刻",
"(翻找箱子…)",
"亡国的美奈姬·卷五",
"少女薇拉的忧郁·卷一",
"少女薇拉的忧郁·卷二",
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,21 @@
# 启动参数说明
启动参数本质是 Unity 独立平台播放器命令行参数 ,测试下来有用的参数大概如下:
- `-window-mode exclusive` 参数
- **独占全屏**,即选择游戏进程以独占全屏模式运行
- **该功能与游戏内浏览器功能不兼容,你应仅在能独立描述独占全屏的技术原理和效果的情况下开启本项**
- `-screen-fullscreen` 参数
- **全屏**,即选择启动游戏后的游戏界面是否设置为全屏
- `-popupwindow` 参数
- **无边框**,即选择启动游戏后的游戏界面是否设置为无边框窗口
- `-platform_type CLOUD_THIRD_PARTY_MOBILE` 参数
- **触摸屏模式**,即启用原神内置的触摸屏操作模式(键鼠输入将被忽略)
- 分辨率
- 该功能可以快速设置下方的覆盖屏幕宽度和高度选项,有一些常见的预设项可供选择
- `-screen-width` 参数
- **宽度**,即选择启动游戏后的游戏界面的宽度,例如 `1920`
- `-screen-height` 参数
- **高度**,即选择启动游戏后的游戏界面的高度,例如 `1080`
- `-monitor` 参数
- **显示器**,允许多显示器用户选择指定的显示器来运行游戏
Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

@@ -0,0 +1,148 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>12.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
<AssemblyName>BetterGI</AssemblyName>
<AssemblyVersion>0.36.2</AssemblyVersion>
<Platforms>x64</Platforms>
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\Images\*.jpg" />
<None Remove="Assets\Images\*" />
<None Remove="Assets\Images\*.png" />
<None Remove="Assets\Images\*.ico" />
<None Remove="Assets\Fonts\*.ttf" />
<None Remove="Assets\Highlighting\*.xshd" />
<None Remove="Assets\Strings\*.html" />
<None Remove="Assets\Strings\*.md" />
<None Remove="Assets\Audios\*.mp3" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\Images\*.jpg" />
<Resource Include="Assets\Images\Anniversary\*" />
<Resource Include="Assets\Images\*.png" />
<Resource Include="Assets\Images\*.ico" />
<Resource Include="Assets\Fonts\*.ttf" />
<Resource Include="Assets\Highlighting\*.xshd" />
<Resource Include="Assets\Strings\*.html" />
<Resource Include="Assets\Strings\*.md" />
<Resource Include="Assets\Audios\*.mp3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.18.1" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.18.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.8.0.20230708" />
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.8.0.20230708" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.8.0.20230708" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.122" />
<PackageReference Include="Microsoft.ClearScript.V8" Version="7.4.5" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.4.5" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="PresentMonFps" Version="2.0.5" />
<PackageReference Include="Sdcb.PaddleInference" Version="2.5.0.1" />
<PackageReference Include="Sdcb.PaddleInference.runtime.win64.openblas" Version="2.5.1" />
<PackageReference Include="Sdcb.PaddleOCR" Version="2.7.0" />
<PackageReference Include="Sdcb.PaddleOCR.Models.Online" Version="2.7.0.1" />
<PackageReference Include="Sdl.MultiSelectComboBox" Version="1.0.103" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.RichTextBoxEx.Wpf" Version="1.1.0.1" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
<PackageReference Include="Vanara.PInvoke.NtDll" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.SHCore" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
<PackageReference Include="WPF-UI" Version="3.0.5" />
<PackageReference Include="WPF-UI.Tray" Version="3.0.5" />
<PackageReference Include="WPF-UI.Violeta" Version="3.0.5.23" />
<PackageReference Include="YoloV8" Version="4.1.7" />
<PackageReference Include="gong-wpf-dragdrop" Version="3.2.1" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug'">
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fischless.GameCapture\Fischless.GameCapture.csproj" />
<ProjectReference Include="..\Fischless.HotkeyCapture\Fischless.HotkeyCapture.csproj" />
<ProjectReference Include="..\Fischless.WindowsInput\Fischless.WindowsInput.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Assets\Map\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\Model\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoFight\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoFight\Assets\combat_avatar.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoFishing\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoGeniusInvokation\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoGeniusInvokation\Assets\tcg_character_card.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoPick\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoSkip\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoSkip\Assets\hangout.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoTrackPath\Assets\tp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\Common\Element\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoWood\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\GameLoading\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\QuickTeleport\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\QuickSereniteaPot\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="User\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="GameTask\Common\Element\Assets\新文件夹\" />
<Folder Include="GameTask\OneDragon\" />
<Folder Include="User\AutoPathing\" />
</ItemGroup>
</Project>
+29 -37
View File
@@ -5,30 +5,38 @@
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>12.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
<AssemblyName>BetterGI</AssemblyName>
<AssemblyVersion>0.39.4</AssemblyVersion>
<Platforms>x64</Platforms>
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\*.jpg" />
<None Remove="Assets\*.png" />
<None Remove="Assets\*.ico" />
<None Remove="Assets\Images\*.jpg" />
<None Remove="Assets\Images\*" />
<None Remove="Assets\Images\*.png" />
<None Remove="Assets\Images\*.ico" />
<None Remove="Assets\Fonts\*.ttf" />
<None Remove="Assets\Highlighting\*.xshd" />
<None Remove="Assets\Strings\*.html" />
<None Remove="Assets\Strings\*.md" />
<None Remove="Assets\Audios\*.mp3" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\*.jpg" />
<Resource Include="Assets\*.png" />
<Resource Include="Assets\*.ico" />
<Resource Include="Assets\Images\*.jpg" />
<Resource Include="Assets\Images\Anniversary\*" />
<Resource Include="Assets\Images\*.png" />
<Resource Include="Assets\Images\*.ico" />
<Resource Include="Assets\Fonts\*.ttf" />
<Resource Include="Assets\Highlighting\*.xshd" />
<Resource Include="Assets\Strings\*.html" />
<Resource Include="Assets\Strings\*.md" />
<Resource Include="Assets\Audios\*.mp3" />
</ItemGroup>
<ItemGroup>
@@ -41,31 +49,34 @@
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.18.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.8.0.20230708" />
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.8.0.20230708" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.8.0.20230708" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.122" />
<PackageReference Include="Microsoft.ClearScript.V8" Version="7.4.5" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.4.5" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="PresentMonFps" Version="2.0.1" />
<PackageReference Include="PresentMonFps" Version="2.0.5" />
<PackageReference Include="Sdcb.PaddleInference" Version="2.5.0.1" />
<PackageReference Include="Sdcb.PaddleInference.runtime.win64.openblas" Version="2.5.1" />
<PackageReference Include="Sdcb.PaddleOCR" Version="2.7.0" />
<PackageReference Include="Sdcb.PaddleOCR.Models.Online" Version="2.7.0.1" />
<PackageReference Include="Sdl.MultiSelectComboBox" Version="1.0.103" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.RichTextBoxEx.Wpf" Version="1.1.0.1" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
<PackageReference Include="Vanara.PInvoke.NtDll" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.SHCore" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
<PackageReference Include="WPF-UI" Version="3.0.5" />
<PackageReference Include="WPF-UI.Tray" Version="3.0.5" />
<PackageReference Include="WPF-UI.Violeta" Version="3.0.5.26" />
<PackageReference Include="YoloV8" Version="4.1.7" />
<PackageReference Include="gong-wpf-dragdrop" Version="3.2.1" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug'">
</ItemGroup>
<ItemGroup>
@@ -74,27 +85,6 @@
<ProjectReference Include="..\Fischless.WindowsInput\Fischless.WindowsInput.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="GameTask\TaskContext.cs">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Compile>
<Compile Update="View\MaskWindow.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\Pages\HotkeyPage.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\Pages\TriggerSettingsPage.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\PickerWindow.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\Windows\MapViewer.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Assets\Map\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -132,9 +122,15 @@
<None Update="GameTask\Common\Element\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\Common\Element\Assets\Json\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoWood\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoMusicGame\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\GameLoading\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -147,15 +143,11 @@
<None Update="User\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Script\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="GameTask\Common\Element\Assets\MapPoint\" />
<Folder Include="Script\AutoCrystalfly\" />
<Folder Include="View\Controls\WpfUi\" />
<Folder Include="GameTask\OneDragon\" />
<Folder Include="User\AutoPathing\" />
</ItemGroup>
</Project>
+45 -2
View File
@@ -7,13 +7,16 @@ using BetterGenshinImpact.GameTask.AutoGeniusInvokation;
using BetterGenshinImpact.GameTask.AutoPick;
using BetterGenshinImpact.GameTask.AutoSkip;
using BetterGenshinImpact.GameTask.AutoWood;
using BetterGenshinImpact.GameTask.AutoMusicGame;
using BetterGenshinImpact.GameTask.QuickTeleport;
using BetterGenshinImpact.Service.Notification;
using CommunityToolkit.Mvvm.ComponentModel;
using Fischless.GameCapture;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace BetterGenshinImpact.Core.Config;
@@ -55,12 +58,27 @@ public partial class AllConfig : ObservableObject
[ObservableProperty]
private bool _wgcUseBitmapCache = true;
/// <summary>
/// 自动修复Win11下BitBlt截图方式不可用的问题
/// </summary>
[ObservableProperty]
private bool _autoFixWin11BitBlt = true;
/// <summary>
/// 推理使用的设备
/// </summary>
[ObservableProperty]
private string _inferenceDevice = "CPU";
[ObservableProperty]
private List<ValueTuple<string, int, string, string>> _nextScheduledTask = [];
/// <summary>
/// 一条龙选中使用的配置
/// </summary>
[ObservableProperty]
private string _selectedOneDragonFlowConfigName = string.Empty;
/// <summary>
/// 遮罩窗口配置
/// </summary>
@@ -115,6 +133,11 @@ public partial class AllConfig : ObservableObject
/// 自动战斗配置
/// </summary>
public AutoFightConfig AutoFightConfig { get; set; } = new();
/// <summary>
/// 自动乐曲配置 - 千音雅集
/// </summary>
public AutoMusicGameConfig AutoMusicGameConfig { get; set; } = new();
/// <summary>
/// 自动秘境配置
@@ -122,12 +145,22 @@ public partial class AllConfig : ObservableObject
public AutoDomainConfig AutoDomainConfig { get; set; } = new();
/// <summary>
/// 脚本类配置
/// 宏配置
/// </summary>
public MacroConfig MacroConfig { get; set; } = new();
public RecordConfig RecordConfig { get; set; } = new();
/// <summary>
/// 脚本配置
/// </summary>
public ScriptConfig ScriptConfig { get; set; } = new();
/// <summary>
/// 路径追踪配置
/// </summary>
public PathingConditionConfig PathingConditionConfig { get; set; } = PathingConditionConfig.Default;
/// <summary>
/// 快捷键配置
/// </summary>
@@ -138,6 +171,11 @@ public partial class AllConfig : ObservableObject
/// </summary>
public NotificationConfig NotificationConfig { get; set; } = new();
/// <summary>
/// 原神按键绑定配置
/// </summary>
public KeyBindingsConfig KeyBindingsConfig { get; set; } = new();
[JsonIgnore]
public Action? OnAnyChangedAction { get; set; }
@@ -149,6 +187,7 @@ public partial class AllConfig : ObservableObject
GenshinStartConfig.PropertyChanged += OnAnyPropertyChanged;
NotificationConfig.PropertyChanged += OnAnyPropertyChanged;
NotificationConfig.PropertyChanged += OnNotificationPropertyChanged;
KeyBindingsConfig.PropertyChanged += OnAnyPropertyChanged;
AutoPickConfig.PropertyChanged += OnAnyPropertyChanged;
AutoSkipConfig.PropertyChanged += OnAnyPropertyChanged;
@@ -160,6 +199,10 @@ public partial class AllConfig : ObservableObject
AutoWoodConfig.PropertyChanged += OnAnyPropertyChanged;
AutoFightConfig.PropertyChanged += OnAnyPropertyChanged;
AutoDomainConfig.PropertyChanged += OnAnyPropertyChanged;
AutoMusicGameConfig.PropertyChanged += OnAnyPropertyChanged;
ScriptConfig.PropertyChanged += OnAnyPropertyChanged;
PathingConditionConfig.PropertyChanged += OnAnyPropertyChanged;
}
public void OnAnyPropertyChanged(object? sender, EventArgs args)
@@ -172,4 +215,4 @@ public partial class AllConfig : ObservableObject
{
NotificationService.Instance().RefreshNotifiers();
}
}
}
@@ -1,5 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using Wpf.Ui.Controls;
namespace BetterGenshinImpact.Core.Config;
@@ -26,4 +27,16 @@ public partial class CommonConfig : ObservableObject
/// </summary>
[ObservableProperty]
private bool _exitToTray;
/// <summary>
/// 主题
/// </summary>
[ObservableProperty]
private WindowBackdropType _currentBackdropType = WindowBackdropType.Mica;
/// <summary>
/// 是否是第一次运行
/// </summary>
[ObservableProperty]
private bool _isFirstRun = true;
}
@@ -9,11 +9,11 @@ namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class GenshinStartConfig : ObservableObject
{
/// <summary>
/// 自动点击月卡
/// </summary>
[ObservableProperty]
private bool _autoClickBlessingOfTheWelkinMoonEnabled;
// /// <summary>
// /// 自动点击月卡
// /// </summary>
// [ObservableProperty]
// private bool _autoClickBlessingOfTheWelkinMoonEnabled;
/// <summary>
/// 自动进入游戏(开门)
+15 -7
View File
@@ -1,14 +1,27 @@
using System;
using System.IO;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace BetterGenshinImpact.Core.Config;
public class Global
{
public static string Version { get; } = "0.32.5";
public static string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version!.ToString(3);
public static string StartUpPath { get; set; } = AppContext.BaseDirectory;
public static readonly JsonSerializerOptions ManifestJsonOptions = new()
{
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
WriteIndented = true,
AllowTrailingCommas = true,
ReadCommentHandling = JsonCommentHandling.Skip,
};
public static string Absolute(string relativePath)
{
return Path.Combine(StartUpPath, relativePath);
@@ -16,12 +29,7 @@ public class Global
public static string ScriptPath()
{
return Absolute("Script");
}
public static string ScriptPath(string folderName)
{
return Path.Combine(Absolute("Script"), folderName);
return Absolute("User\\JsScript");
}
public static string? ReadAllTextIfExist(string relativePath)
@@ -170,6 +170,34 @@ public partial class HotKeyConfig : ObservableObject
[ObservableProperty]
private string _test2HotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 路径记录开始
[ObservableProperty]
private string _recBigMapPosHotkey = "";
[ObservableProperty]
private string _recBigMapPosHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 路径记录开始
[ObservableProperty]
private string _pathRecorderHotkey = "";
[ObservableProperty]
private string _pathRecorderHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 添加路径记录点
[ObservableProperty]
private string _addWaypointHotkey = "";
[ObservableProperty]
private string _addWaypointHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 路径执行
[ObservableProperty]
private string _executePathHotkey = "";
[ObservableProperty]
private string _executePathHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 日志与状态窗口展示
[ObservableProperty]
private string _logBoxDisplayHotkey = "";
@@ -183,7 +211,12 @@ public partial class HotKeyConfig : ObservableObject
[ObservableProperty]
private string _keyMouseMacroRecordHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 暂停
[ObservableProperty]
private string _suspendHotkey = "";
[ObservableProperty]
private string _suspendHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 停止任意独立任务
[ObservableProperty]
private string _cancelTaskHotkey = "";
@@ -0,0 +1,964 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Windows.Forms;
using System.Windows.Input;
using Windows.Networking.PushNotifications;
using static Vanara.PInvoke.User32;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 原神按键绑定配置
/// </summary>
[Serializable]
public partial class KeyBindingsConfig:ObservableObject
{
#region Actions(操作)
/// <summary>
/// 向前移动
/// </summary>
[ObservableProperty]
private KeyId _moveForward = KeyId.W;
/// <summary>
/// 向后移动
/// </summary>
[ObservableProperty]
private KeyId _moveBackward = KeyId.S;
/// <summary>
/// 向左移动
/// </summary>
[ObservableProperty]
private KeyId _moveLeft = KeyId.A;
/// <summary>
/// 向右移动
/// </summary>
[ObservableProperty]
private KeyId _moveRight = KeyId.D;
/// <summary>
/// 切换走/跑;特定操作模式下向下移动
/// </summary>
[ObservableProperty]
private KeyId _switchToWalkOrRun = KeyId.LeftCtrl;
/// <summary>
/// 普通攻击
/// </summary>
[ObservableProperty]
private KeyId _normalAttack = KeyId.MouseLeftButton;
/// <summary>
/// 元素战技
/// </summary>
[ObservableProperty]
private KeyId _elementalSkill = KeyId.E;
/// <summary>
/// 元素爆发
/// </summary>
[ObservableProperty]
private KeyId _elementalBurst = KeyId.Q;
/// <summary>
/// 冲刺(键盘)
/// </summary>
[ObservableProperty]
private KeyId _sprintKeyboard = KeyId.LeftShift;
/// <summary>
/// 冲刺(鼠标)
/// </summary>
[ObservableProperty]
private KeyId _sprintMouse = KeyId.MouseRightButton;
/// <summary>
/// 切换瞄准模式
/// </summary>
[ObservableProperty]
private KeyId _switchAimingMode = KeyId.R;
/// <summary>
/// 跳跃;特定操作模式下向上移动
/// </summary>
[ObservableProperty]
private KeyId _jump = KeyId.Space;
/// <summary>
/// 落下
/// </summary>
[ObservableProperty]
private KeyId _drop = KeyId.X;
/// <summary>
/// 拾取/交互(自动拾取由AutoPick模块管理)
/// </summary>
[ObservableProperty]
private KeyId _pickUpOrInteract = KeyId.F;
/// <summary>
/// 快捷使用小道具
/// </summary>
[ObservableProperty]
private KeyId _quickUseGadget = KeyId.Z;
/// <summary>
/// 特定玩法内交互操作
/// </summary>
[ObservableProperty]
private KeyId _interactionInSomeMode = KeyId.T;
/// <summary>
/// 开启任务追踪
/// </summary>
[ObservableProperty]
private KeyId _questNavigation = KeyId.V;
/// <summary>
/// 中断挑战
/// </summary>
[ObservableProperty]
private KeyId _abandonChallenge = KeyId.P;
/// <summary>
/// 切换小队角色1
/// </summary>
[ObservableProperty]
private KeyId _switchMember1 = KeyId.D1;
/// <summary>
/// 切换小队角色2
/// </summary>
[ObservableProperty]
private KeyId _switchMember2 = KeyId.D2;
/// <summary>
/// 切换小队角色3
/// </summary>
[ObservableProperty]
private KeyId _switchMember3 = KeyId.D3;
/// <summary>
/// 切换小队角色4
/// </summary>
[ObservableProperty]
private KeyId _switchMember4 = KeyId.D4;
/// <summary>
/// 切换小队角色5
/// </summary>
[ObservableProperty]
private KeyId _switchMember5 = KeyId.D5;
/// <summary>
/// 呼出快捷轮盘
/// </summary>
[ObservableProperty]
private KeyId _shortcutWheel = KeyId.Tab;
#endregion
#region Menus(菜单)
/// <summary>
/// 打开背包
/// </summary>
[ObservableProperty]
private KeyId _openInventory = KeyId.B;
/// <summary>
/// 打开角色界面
/// </summary>
[ObservableProperty]
private KeyId _openCharacterScreen = KeyId.C;
/// <summary>
/// 打开地图
/// </summary>
[ObservableProperty]
private KeyId _openMap = KeyId.M;
/// <summary>
/// 打开派蒙界面
/// </summary>
[ObservableProperty]
private KeyId _openPaimonMenu = KeyId.Escape;
/// <summary>
/// 打开冒险之证界面
/// </summary>
[ObservableProperty]
private KeyId _openAdventurerHandbook = KeyId.F1;
/// <summary>
/// 打开多人游戏界面
/// </summary>
[ObservableProperty]
private KeyId _openCoOpScreen = KeyId.F2;
/// <summary>
/// 打开祈愿界面
/// </summary>
[ObservableProperty]
private KeyId _openWishScreen = KeyId.F3;
/// <summary>
/// 打开纪行界面
/// </summary>
[ObservableProperty]
private KeyId _openBattlePassScreen = KeyId.F4;
/// <summary>
/// 打开活动面板
/// </summary>
[ObservableProperty]
private KeyId _openTheEventsMenu = KeyId.F5;
/// <summary>
/// 打开玩法系统界面(尘歌壶内猫尾酒馆内)
/// </summary>
[ObservableProperty]
private KeyId _openTheSettingsMenu = KeyId.F6;
/// <summary>
/// 打开摆设界面(尘歌壶内)
/// </summary>
[ObservableProperty]
private KeyId _openTheFurnishingScreen = KeyId.F7;
/// <summary>
/// 打开星之归还(条件符合期间生效)
/// </summary>
[ObservableProperty]
private KeyId _openStellarReunion = KeyId.F8;
/// <summary>
/// 开关任务菜单
/// </summary>
[ObservableProperty]
private KeyId _openQuestMenu = KeyId.J;
/// <summary>
/// 打开通知详情
/// </summary>
[ObservableProperty]
private KeyId _openNotificationDetails = KeyId.Y;
/// <summary>
/// 打开聊天界面
/// </summary>
[ObservableProperty]
private KeyId _openChatScreen = KeyId.Enter;
/// <summary>
/// 打开特殊环境说明
/// </summary>
[ObservableProperty]
private KeyId _openSpecialEnvironmentInformation = KeyId.U;
/// <summary>
/// 查看教程详情
/// </summary>
[ObservableProperty]
private KeyId _checkTutorialDetails = KeyId.G;
/// <summary>
/// 长按打开元素视野
/// </summary>
[ObservableProperty]
private KeyId _elementalSight = KeyId.MouseMiddleButton;
/// <summary>
/// 呼出鼠标
/// </summary>
[ObservableProperty]
private KeyId _showCursor = KeyId.LeftAlt;
/// <summary>
/// 打开队伍配置界面
/// </summary>
[ObservableProperty]
private KeyId _openPartySetupScreen = KeyId.L;
/// <summary>
/// 打开好友界面
/// </summary>
[ObservableProperty]
private KeyId _openFriendsScreen = KeyId.O;
/// <summary>
/// 隐藏主界面
/// </summary>
[ObservableProperty]
private KeyId _hideUI = KeyId.Slash;
#endregion
}
public static class KeyIdConverter
{
/// <summary>
/// 将KeyId转换为字符串(可在后续支持多语言),按键名称的显示尽量与原神UI一致
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string ToName(this KeyId value)
{
return ToChineseName(value);
}
private static string ToChineseName(KeyId value)
{
return value switch
{
// 需要单独翻译的按键
KeyId.None => "<未指定>",
KeyId.Unknown => "<未知>",
KeyId.MouseLeftButton => "鼠标左键",
KeyId.MouseRightButton => "鼠标右键",
KeyId.MouseMiddleButton => "鼠标中键",
KeyId.MouseSideButton1 => "鼠标侧键1",
KeyId.MouseSideButton2 => "鼠标侧键2",
KeyId.Apps => "菜单键",
// 无需单独翻译的部分
_ => EnglishKeyNameToChinese(value),
};
}
private static string EnglishKeyNameToChinese(KeyId value)
{
var engName = ToEnglishName(value);
if (engName.StartsWith("Left ") || engName.StartsWith("Right "))
{
return engName.Replace("Left ", "左").Replace("Right ", "右");
}
return engName;
}
private static string ToEnglishName(KeyId value)
{
return value switch
{
// 需要转换的部分
KeyId.None => "<None>",
KeyId.Unknown => "<Unknown>",
KeyId.MouseLeftButton => "Mouse LButton",
KeyId.MouseRightButton => "Mouse RButton",
KeyId.MouseMiddleButton => "Mouse MButton",
KeyId.MouseSideButton1 => "Mouse XButton1",
KeyId.MouseSideButton2 => "Mouse XButton2",
KeyId.Escape => "Esc",
KeyId.PageUp => "Page Up",
KeyId.PageDown => "Page Down",
KeyId.CapsLock => "Caps Lock",
KeyId.ScrollLock => "Scroll Lock",
KeyId.LeftShift => "Left Shift",
KeyId.RightShift => "Right Shift",
KeyId.LeftCtrl => "Left Crtl",
KeyId.RightCtrl => "Right Ctrl",
KeyId.LeftAlt => "Left Alt",
KeyId.RightAlt => "Right Alt",
KeyId.LeftWin => "Left Win",
KeyId.RightWin => "Right Win",
KeyId.Apps => "Menu",
KeyId.Left => "←",
KeyId.Up => "↑",
KeyId.Right => "→",
KeyId.Down => "↓",
KeyId.D0 => "0",
KeyId.D1 => "1",
KeyId.D2 => "2",
KeyId.D3 => "3",
KeyId.D4 => "4",
KeyId.D5 => "5",
KeyId.D6 => "6",
KeyId.D7 => "7",
KeyId.D8 => "8",
KeyId.D9 => "9",
KeyId.Apostrophe => "'",
KeyId.Comma => ",",
KeyId.Minus => "-",
KeyId.Equal => "=",
KeyId.Period => ".",
KeyId.Slash => "/",
KeyId.Backslash => @"\",
KeyId.Semicolon => ";",
KeyId.LeftSquareBracket => "[",
KeyId.RightSquareBracket => "]",
KeyId.Tilde => "`",
KeyId.NumLock => "Num Lock",
KeyId.NumPad0 => "Num 0",
KeyId.NumPad1 => "Num 1",
KeyId.NumPad2 => "Num 2",
KeyId.NumPad3 => "Num 3",
KeyId.NumPad4 => "Num 4",
KeyId.NumPad5 => "Num 5",
KeyId.NumPad6 => "Num 6",
KeyId.NumPad7 => "Num 7",
KeyId.NumPad8 => "Num 8",
KeyId.NumPad9 => "Num 9",
KeyId.Decimal => "Num .",
KeyId.Divide => "Num /",
KeyId.Multiply => "Num *",
KeyId.Subtract => "Num -",
KeyId.Add => "Num +",
KeyId.NumEnter => "Num Enter",
// 默认使用枚举名
_ => value.ToString(),
};
}
/// <summary>
/// 将KeyId转换为VK
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static VK ToVK(this KeyId value)
{
return value switch
{
// 这两个值在VK中没有,抛异常
KeyId.None => throw new ArgumentOutOfRangeException(nameof(value), "未指定按键,无法转换为VK。"),
KeyId.Unknown => throw new ArgumentOutOfRangeException(nameof(value), "未知按键,无法转换为VK。"),
// 剩下的值相同,直接转
_ => (VK)value,
};
}
/// <summary>
/// 将KeyId转换为System.Windows.Input.Key
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static Key ToInputKey(this KeyId value)
{
// 部分按键名称相同,使用名称转换
try
{
return Enum.Parse<Key>(value.ToString());
}
catch
{
// 其他键使用查表法转换
return value switch
{
KeyId.LeftWin => Key.LWin,
KeyId.RightWin => Key.RWin,
KeyId.Apostrophe => Key.Oem7,
KeyId.Comma => Key.OemComma,
KeyId.Minus => Key.OemMinus,
KeyId.Equal => Key.OemPlus,
KeyId.Period => Key.OemPeriod,
KeyId.Slash => Key.Oem2,
KeyId.Semicolon => Key.Oem1,
KeyId.LeftSquareBracket => Key.Oem4,
KeyId.Backslash => Key.Oem5,
KeyId.RightSquareBracket => Key.Oem6,
KeyId.Tilde => Key.Oem3,
KeyId.Enter => Key.Enter,
KeyId.ScrollLock => Key.Scroll,
KeyId.PageUp => Key.Prior,
KeyId.PageDown => Key.Next,
KeyId.Backspace => Key.Back,
KeyId.CapsLock => Key.Capital,
// None、Unknown和鼠标按键抛异常
_ => throw new ArgumentOutOfRangeException(nameof(value)),
};
}
}
/// <summary>
/// 将KeyId转换为MouseButton
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public static MouseButton ToMouseButton(this KeyId value)
{
return value switch
{
KeyId.MouseLeftButton => MouseButton.Left,
KeyId.MouseRightButton => MouseButton.Right,
KeyId.MouseMiddleButton => MouseButton.Middle,
KeyId.MouseSideButton1 => MouseButton.XButton1,
KeyId.MouseSideButton2 => MouseButton.XButton2,
_ => throw new ArgumentOutOfRangeException(nameof(value), "键盘按键请使用ToInputKey方法"),
};
}
/// <summary>
/// [实验] 将KeyId转换为WinForm中的Keys(用于兼容按键连发功能)
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static Keys ToWinFormKeys(this KeyId value)
{
try
{
return Enum.Parse<Keys>(value.ToInputKey().ToString());
}
catch
{
return default;
}
}
/// <summary>
/// 将VK转换为KeyId
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static KeyId FromVK(VK value)
{
// 尝试通过VK的值获取KeyId的枚举名。若成功,表示对应的VK在KeyId支持的范围内,直接转换;否则返回Unknown
return string.IsNullOrEmpty(Enum.GetName(typeof(KeyId), value)) ? KeyId.Unknown : (KeyId)value;
}
/// <summary>
/// 将System.Windows.Input.Key转换为KeyId
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static KeyId FromInputKey(Key value)
{
// 部分按键名称相同,使用名称转换
try
{
return Enum.Parse<KeyId>(value.ToString());
}
catch
{
// 其他键使用查表法转换
return value switch
{
Key.LWin => KeyId.LeftWin,
Key.RWin => KeyId.RightWin,
Key.Oem7 => KeyId.Apostrophe,
Key.OemComma => KeyId.Comma,
Key.OemMinus => KeyId.Minus,
Key.OemPlus => KeyId.Equal,
Key.OemPeriod => KeyId.Period,
Key.Oem2 => KeyId.Slash,
Key.Oem1 => KeyId.Semicolon,
Key.Oem4 => KeyId.LeftSquareBracket,
Key.Oem5 => KeyId.Backslash,
Key.Oem6 => KeyId.RightSquareBracket,
Key.Oem3 => KeyId.Tilde,
Key.Enter => KeyId.Enter,
Key.Scroll => KeyId.ScrollLock,
Key.Prior => KeyId.PageUp,
Key.Next => KeyId.PageDown,
Key.Back => KeyId.Backspace,
Key.Capital => KeyId.CapsLock,
// 支持列表外的值返回Unknown
_ => KeyId.Unknown,
};
}
}
/// <summary>
/// 将MouseButton转换为KeyId
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static KeyId FromMouseButton(MouseButton value)
{
return value switch
{
MouseButton.Left => KeyId.MouseLeftButton,
MouseButton.Right => KeyId.MouseRightButton,
MouseButton.Middle => KeyId.MouseMiddleButton,
MouseButton.XButton1 => KeyId.MouseSideButton1,
MouseButton.XButton2 => KeyId.MouseSideButton2,
_ => KeyId.Unknown,
};
}
}
/// <summary>
/// 用于与VK/Windows.Input.Key解耦,值与VK对应,但是仅包含美式键盘(104键,不包括媒体控制等)和鼠标中的按键
/// </summary>
public enum KeyId
{
/// <summary>无</summary>
None = 0x00,
/// <summary>未知按键</summary>
Unknown = 0xFF,
#region 鼠标按键
/// <summary>鼠标左键</summary>
MouseLeftButton = 0x01,
/// <summary>鼠标右键</summary>
MouseRightButton = 0x02,
/// <summary>鼠标中键(滚轮)</summary>
MouseMiddleButton = 0x04,
/// <summary>鼠标侧键1(后退)</summary>
MouseSideButton1 = 0x05,
/// <summary>鼠标侧键2(前进)</summary>
MouseSideButton2 = 0x06,
#endregion
#region F键区
/// <summary>F1</summary>
F1 = 0x70,
/// <summary>F2</summary>
F2 = 0x71,
/// <summary>F3</summary>
F3 = 0x72,
/// <summary>F4</summary>
F4 = 0x73,
/// <summary>F5</summary>
F5 = 0x74,
/// <summary>F6</summary>
F6 = 0x75,
/// <summary>F7</summary>
F7 = 0x76,
/// <summary>F8</summary>
F8 = 0x77,
/// <summary>F9</summary>
F9 = 0x78,
/// <summary>F10</summary>
F10 = 0x79,
/// <summary>F11</summary>
F11 = 0x7A,
/// <summary>F12</summary>
F12 = 0x7B,
#endregion
#region 控制&功能键
/// <summary>Esc</summary>
Escape = 0x1B,
/// <summary>PrintScreen</summary>
PrintScreen = 0x2C,
/// <summary>ScrollLock</summary>
ScrollLock = 0x91,
/// <summary>Pause</summary>
Pause = 0x13,
/// <summary>Insert</summary>
Insert = 0x2D,
/// <summary>Delete</summary>
Delete = 0x2E,
/// <summary>Home</summary>
Home = 0x24,
/// <summary>End</summary>
End = 0x23,
/// <summary>Page Up</summary>
PageUp = 0x21,
/// <summary>Page Down</summary>
PageDown = 0x22,
/// <summary>Backspace退格</summary>
Backspace = 0x08,
/// <summary>Tab</summary>
Tab = 0x09,
/// <summary>Caps Lock大写锁定</summary>
CapsLock = 0x14,
/// <summary>Enter回车</summary>
Enter = 0x0D,
///// <summary>Shift</summary>
//Shift = 0x10,
/// <summary>左Shift</summary>
LeftShift = 0xA0,
/// <summary>右Shift</summary>
RightShift = 0xA1,
///// <summary>Ctrl</summary>
//Ctrl = 0x11,
/// <summary>左Ctrl</summary>
LeftCtrl = 0xA2,
/// <summary>右Ctrl</summary>
RightCtrl = 0xA3,
///// <summary>Alt</summary>
//Alt = 0x12,
/// <summary>左Alt</summary>
LeftAlt = 0xA4,
/// <summary>右Alt</summary>
RightAlt = 0xA5,
/// <summary>左Win键 (Microsoft Natural Keyboard)</summary>
LeftWin = 0x5B,
/// <summary>右Win键 (Microsoft Natural Keyboard)</summary>
RightWin = 0x5C,
/// <summary>菜单键 (Microsoft Natural Keyboard)</summary>
Apps = 0x5D,
/// <summary>Space空格键</summary>
Space = 0x20,
#endregion
#region 方向键
/// <summary>方向键 ←</summary>
Left = 0x25,
/// <summary>方向键 ↑</summary>
Up = 0x26,
/// <summary>方向键 →</summary>
Right = 0x27,
/// <summary>方向键 ↓</summary>
Down = 0x28,
#endregion
#region 字母区 - 字母
/// <summary>A</summary>
A = 0x41,
/// <summary>B</summary>
B = 0x42,
/// <summary>C</summary>
C = 0x43,
/// <summary>D</summary>
D = 0x44,
/// <summary>E</summary>
E = 0x45,
/// <summary>F</summary>
F = 0x46,
/// <summary>G</summary>
G = 0x47,
/// <summary>H</summary>
H = 0x48,
/// <summary>I</summary>
I = 0x49,
/// <summary>J</summary>
J = 0x4A,
/// <summary>K</summary>
K = 0x4B,
/// <summary>L</summary>
L = 0x4C,
/// <summary>M</summary>
M = 0x4D,
/// <summary>N</summary>
N = 0x4E,
/// <summary>O</summary>
O = 0x4F,
/// <summary>P</summary>
P = 0x50,
/// <summary>Q</summary>
Q = 0x51,
/// <summary>R</summary>
R = 0x52,
/// <summary>S</summary>
S = 0x53,
/// <summary>T</summary>
T = 0x54,
/// <summary>U</summary>
U = 0x55,
/// <summary>V</summary>
V = 0x56,
/// <summary>W</summary>
W = 0x57,
/// <summary>X</summary>
X = 0x58,
/// <summary>Y</summary>
Y = 0x59,
/// <summary>Z</summary>
Z = 0x5A,
#endregion
#region 字母区 - 数字
/// <summary>0</summary>
D0 = 0x30,
/// <summary>1</summary>
D1 = 0x31,
/// <summary>2</summary>
D2 = 0x32,
/// <summary>3</summary>
D3 = 0x33,
/// <summary>4</summary>
D4 = 0x34,
/// <summary>5</summary>
D5 = 0x35,
/// <summary>6</summary>
D6 = 0x36,
/// <summary>7</summary>
D7 = 0x37,
/// <summary>8</summary>
D8 = 0x38,
/// <summary>9</summary>
D9 = 0x39,
#endregion
#region 字母区 - 符号
/// <summary>引号 '</summary>
Apostrophe = 0xDE,
/// <summary>逗号 ,</summary>
Comma = 0xBC,
/// <summary>连接符 -</summary>
Minus = 0xBD,
/// <summary>等于号 =</summary>
Equal = 0xBB,
/// <summary>句号 .</summary>
Period = 0xBE,
/// <summary>斜杠 /</summary>
Slash = 0xBF,
/// <summary>反斜杠 \</summary>
Backslash = 0xE2,
/// <summary>分号 ;</summary>
Semicolon = 0xBA,
/// <summary>左方括号 [</summary>
LeftSquareBracket = 0xDB,
/// <summary>右方括号 ]</summary>
RightSquareBracket = 0xDD,
/// <summary>波浪号 `</summary>
Tilde = 0xC0,
#endregion
#region 小键盘区
/// <summary>Num Lock</summary>
NumLock = 0x90,
/// <summary>Num 0</summary>
NumPad0 = 0x60,
/// <summary>Num 1</summary>
NumPad1 = 0x61,
/// <summary>Num 2</summary>
NumPad2 = 0x62,
/// <summary>Num 3</summary>
NumPad3 = 0x63,
/// <summary>Num 4</summary>
NumPad4 = 0x64,
/// <summary>Num 5</summary>
NumPad5 = 0x65,
/// <summary>Num 6</summary>
NumPad6 = 0x66,
/// <summary>Num 7</summary>
NumPad7 = 0x67,
/// <summary>Num 8</summary>
NumPad8 = 0x68,
/// <summary>Num 9</summary>
NumPad9 = 0x69,
/// <summary>Num .</summary>
Decimal = 0x6E,
/// <summary>Num /</summary>
Divide = 0x6F,
/// <summary>Num *</summary>
Multiply = 0x6A,
/// <summary>Num -</summary>
Subtract = 0x6D,
/// <summary>Num +</summary>
Add = 0x6B,
/// <summary>Num Enter</summary>
NumEnter = 0x0E,
#endregion
}
@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class OneDragonFlowConfig : ObservableObject
{
// 配置名
[ObservableProperty]
private string _name = string.Empty;
/// <summary>
/// 所有任务的开关状态
/// </summary>
public Dictionary<string, bool> TaskEnabledList { get; set; } = new();
// 合成树脂的国家
[ObservableProperty]
private string _craftingBenchCountry = "枫丹";
// 冒险者协会的国家
[ObservableProperty]
private string _adventurersGuildCountry = "枫丹";
// 自动战斗配置的队伍名称
[ObservableProperty]
private string _partyName = string.Empty;
// 自动战斗配置的策略名称
[ObservableProperty]
private string _domainName = string.Empty;
[ObservableProperty]
private bool _weeklyDomainEnabled = false;
// 领取每日奖励的好感队伍名称
[ObservableProperty]
private string _dailyRewardPartyName = string.Empty;
#region 每周秘境配置
[ObservableProperty]
private string _mondayThursdayPartyName = string.Empty;
[ObservableProperty]
private string _mondayThursdayDomainName = string.Empty;
[ObservableProperty]
private string _tuesdayFridayPartyName = string.Empty;
[ObservableProperty]
private string _tuesdayFridayDomainName = string.Empty;
[ObservableProperty]
private string _wednesdaySaturdayPartyName = string.Empty;
[ObservableProperty]
private string _wednesdaySaturdayDomainName = string.Empty;
[ObservableProperty]
private string _sundayPartyName = string.Empty;
[ObservableProperty]
private string _sundayDomainName = string.Empty;
// 通过当天是哪一天来返回配置
public (string partyName, string domainName) GetDomainConfig()
{
if (WeeklyDomainEnabled)
{
var dayOfWeek = DateTime.Now.DayOfWeek;
return dayOfWeek switch
{
DayOfWeek.Monday => (MondayThursdayPartyName, MondayThursdayDomainName),
DayOfWeek.Tuesday => (TuesdayFridayPartyName, TuesdayFridayDomainName),
DayOfWeek.Wednesday => (WednesdaySaturdayPartyName, WednesdaySaturdayDomainName),
DayOfWeek.Thursday => (MondayThursdayPartyName, MondayThursdayDomainName),
DayOfWeek.Friday => (TuesdayFridayPartyName, TuesdayFridayDomainName),
DayOfWeek.Saturday => (WednesdaySaturdayPartyName, WednesdaySaturdayDomainName),
DayOfWeek.Sunday => (SundayPartyName, SundayDomainName),
_ => (PartyName, DomainName)
};
}
else
{
return (PartyName, DomainName);
}
}
#endregion
}
@@ -0,0 +1,185 @@
using BetterGenshinImpact.GameTask.AutoFight.Model;
using BetterGenshinImpact.Model;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class PathingConditionConfig : ObservableObject
{
// 路径追踪条件配置
[ObservableProperty]
private ObservableCollection<Condition> _partyConditions = [];
[ObservableProperty]
private ObservableCollection<Condition> _avatarConditions = [];
// 只在传送传送点时复活
[ObservableProperty]
private bool _onlyInTeleportRecover = false;
// 使用小道具的间隔时间(ms)
[ObservableProperty]
private int _useGadgetIntervalMs = 0;
public static PathingConditionConfig Default => new()
{
AvatarConditions =
[
new Condition
{
Subject = "队伍中角色",
Object = ["绮良良", "莱依拉", "茜特菈莉", "芭芭拉", "七七"],
Result = "循环短E"
},
new Condition
{
Subject = "队伍中角色",
Object = ["钟离"],
Result = "循环长E"
}
]
};
/// <summary>
/// 找出当前应该切换的队伍名称
/// </summary>
/// <param name="materialName">采集物名称</param>
/// <param name="specialActions">特殊动作</param>
/// <returns></returns>
public string? FilterPartyName(string? materialName, List<string?> specialActions)
{
if (specialActions is { Count: > 0 })
{
// 特殊动作匹配队伍名
foreach (var action in specialActions)
{
if (string.IsNullOrEmpty(action))
{
continue;
}
if (!ConditionDefinitions.ActionCnDic.TryGetValue(action, out var actionCn))
{
continue; // 不校验
}
var condition = PartyConditions.FirstOrDefault(c => c.Subject == "动作" && c.Object.Contains(actionCn));
if (condition is { Result: not null })
{
return condition.Result;
}
}
}
// 采集物匹配队伍名
Condition? materialCondition = null;
if (!string.IsNullOrEmpty(materialName))
{
materialCondition = PartyConditions.FirstOrDefault(c => c.Subject == "采集物" && c.Object.Contains(materialName));
}
if (materialCondition is { Result: not null })
{
return materialCondition.Result;
}
else
{
materialCondition = PartyConditions.FirstOrDefault(c => c.Subject == "采集物" && c.Object.Contains("全部"));
if (materialCondition is { Result: not null })
{
return materialCondition.Result;
}
}
return null;
}
/// <summary>
/// 通过条件配置生成队伍配置
/// </summary>
/// <returns></returns>
public PathingPartyConfig BuildPartyConfigByCondition(CombatScenes combatScenes)
{
PathingPartyConfig partyConfig = PathingPartyConfig.BuildDefault();
// 使用最优先匹配上的条件
foreach (var avatarCondition in AvatarConditions)
{
if (avatarCondition.Result == "循环短E" || avatarCondition.Result == "循环长E")
{
foreach (var avatar in combatScenes.Avatars)
{
if (avatarCondition is { Object: not null } && avatarCondition.Object.Contains(avatar.Name))
{
partyConfig.GuardianAvatarIndex = avatar.Index.ToString();
if (avatarCondition.Result == "循环长E")
{
partyConfig.GuardianElementalSkillLongPress = true;
partyConfig.GuardianElementalSkillSecondInterval = avatar.SkillHoldCd.ToString(CultureInfo.CurrentCulture);
}
else
{
partyConfig.GuardianElementalSkillLongPress = false;
partyConfig.GuardianElementalSkillSecondInterval = avatar.SkillCd.ToString(CultureInfo.CurrentCulture);
}
break;
}
}
if (!string.IsNullOrEmpty(partyConfig.GuardianAvatarIndex))
{
break;
}
}
}
foreach (var avatarCondition in AvatarConditions)
{
if (avatarCondition.Result == "作为主要行走角色")
{
foreach (var avatar in combatScenes.Avatars)
{
if (avatarCondition is { Object: not null } && avatarCondition.Object.Contains(avatar.Name))
{
partyConfig.MainAvatarIndex = avatar.Index.ToString();
break;
}
}
if (!string.IsNullOrEmpty(partyConfig.MainAvatarIndex))
{
break;
}
}
}
// 默认元素力采集角色
// var elementalCollectAvatars = ElementalCollectAvatarConfigs.Lists;
// foreach (var avatar in combatScenes.Avatars)
// {
// var elementalCollectAvatar = elementalCollectAvatars.FirstOrDefault(x => x.Name == avatar.Name);
// if (elementalCollectAvatar != null)
// {
// if (elementalCollectAvatar.ElementalType == ElementalType.Hydro)
// {
// partyConfig.HydroCollectAvatarIndex = avatar.Index.ToString();
// }
// else if (elementalCollectAvatar.ElementalType == ElementalType.Electro)
// {
// partyConfig.ElectroCollectAvatarIndex = avatar.Index.ToString();
// }
// else if (elementalCollectAvatar.ElementalType == ElementalType.Anemo)
// {
// partyConfig.AnemoCollectAvatarIndex = avatar.Index.ToString();
// }
// }
// }
return partyConfig;
}
}
@@ -0,0 +1,101 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.GameTask.AutoFight;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class PathingPartyConfig : ObservableObject
{
// 配置是否启用,不启用会使用路径追踪内的条件配置
[ObservableProperty]
private bool _enabled = false;
// 切换到队伍的名称
[ObservableProperty]
private string _partyName = string.Empty;
// 主要行走追踪的角色编号
[ObservableProperty]
private string _mainAvatarIndex = string.Empty;
// [盾角]使用元素战技的角色编号
[ObservableProperty]
private string _guardianAvatarIndex = string.Empty;
// [盾角]使用元素战技的时间间隔(s)
[ObservableProperty]
private string _guardianElementalSkillSecondInterval = string.Empty;
// [盾角]使用元素战技的方式 长按/短按
[ObservableProperty]
private bool _guardianElementalSkillLongPress = false;
// // normal_attack 配置几号位
// [ObservableProperty]
// private string _normalAttackAvatarIndex = string.Empty;
//
// // elemental_skill 配置几号位
// [ObservableProperty]
// private string _elementalSkillAvatarIndex = string.Empty;
// // hydro_collect 配置几号位
// [ObservableProperty]
// private string _hydroCollectAvatarIndex = string.Empty;
//
// // electro_collect 配置几号位
// [ObservableProperty]
// private string _electroCollectAvatarIndex = string.Empty;
//
// // anemo_collect 配置几号位
// [ObservableProperty]
// private string _anemoCollectAvatarIndex = string.Empty;
[JsonIgnore]
public List<string> AvatarIndexList { get; } = ["", "1", "2", "3", "4"];
// 只在传送传送点时复活
[ObservableProperty]
private bool _onlyInTeleportRecover = false;
//允许在jsScript脚本中使用此路径追踪配置
[ObservableProperty]
private bool _jsScriptUseEnabled = false;
//允许在此调度器中(一般在JS脚本中)调用自动战斗任务时,采用此追踪配置里的战斗策略
[ObservableProperty]
private bool _soloTaskUseFightEnabled = false;
// 使用小道具的间隔时间
[ObservableProperty]
private int _useGadgetIntervalMs = 0;
// 启用进入剧情自动脱离
[ObservableProperty]
private bool _autoSkipEnabled = true;
// 自动冲刺启用
[ObservableProperty]
private bool _autoRunEnabled = true;
//启用自动战斗配置
[ObservableProperty]
private bool _autoFightEnabled = false;
[ObservableProperty]
private AutoFightConfig _autoFightConfig = new();
public static PathingPartyConfig BuildDefault()
{
// 即便是不启用的情况下也设置默认值,减少后续使用的判断
var pathingConditionConfig = TaskContext.Instance().Config.PathingConditionConfig;
return new PathingPartyConfig
{
OnlyInTeleportRecover = pathingConditionConfig.OnlyInTeleportRecover,
UseGadgetIntervalMs = pathingConditionConfig.UseGadgetIntervalMs
};
}
}
@@ -0,0 +1,28 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 脚本配置
/// </summary>
[Serializable]
public partial class ScriptConfig : ObservableObject
{
// 自动更新脚本仓库周期(天)
[ObservableProperty]
private int _autoUpdateScriptRepoPeriod = 1;
// 上次更新脚本仓库时间
[ObservableProperty]
private DateTime _lastUpdateScriptRepoTime = DateTime.MinValue;
// 脚本仓库按钮红点是否展示
[ObservableProperty]
private bool _scriptRepoHintDotVisible = false;
// 已订阅的脚本路径列表
[ObservableProperty]
private List<string> _subscribedScriptPaths = [];
}
@@ -3,6 +3,7 @@ using SharpDX.DirectInput;
using System;
using System.Threading;
using System.Threading.Tasks;
using Vanara.PInvoke;
namespace BetterGenshinImpact.Core.Monitor;
@@ -11,6 +12,8 @@ public class DirectInputMonitor : IDisposable
private bool _isRunning = true;
private readonly Mouse _mouse;
public static int Interval = 5;
public DirectInputMonitor()
{
@@ -34,8 +37,8 @@ public class DirectInputMonitor : IDisposable
_mouse.Acquire();
MouseState state = _mouse.GetCurrentState();
// Debug.WriteLine($"{state.X} {state.Y} {state.Buttons[0]} {state.Buttons[1]}");
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveBy(state);
Thread.Sleep(5); // 10ms, equivalent to CLOCKS_PER_SEC/100
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveBy(state, Kernel32.GetTickCount());
Thread.Sleep(Interval); // 10ms, equivalent to CLOCKS_PER_SEC/100
}
});
}
@@ -1,4 +1,5 @@
using BetterGenshinImpact.Core.Recorder;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Core.Recorder;
using BetterGenshinImpact.Core.Simulator;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.Model;
@@ -18,6 +19,10 @@ public class MouseKeyMonitor
/// </summary>
private readonly Timer _fTimer = new();
private Keys _pickUpKey = Keys.F;
private User32.VK _pickUpKeyCode = User32.VK.VK_F;
//private readonly Random _random = new();
/// <summary>
@@ -25,6 +30,10 @@ public class MouseKeyMonitor
/// </summary>
private readonly Timer _spaceTimer = new();
private Keys _releaseControlKey = Keys.Space;
private User32.VK _releaseControlKeyCode = User32.VK.VK_SPACE;
private DateTime _firstFKeyDownTime = DateTime.MaxValue;
/// <summary>
@@ -46,27 +55,33 @@ public class MouseKeyMonitor
_globalHook.MouseDownExt += GlobalHookMouseDownExt;
_globalHook.MouseUpExt += GlobalHookMouseUpExt;
_globalHook.MouseMoveExt += GlobalHookMouseMoveExt;
_globalHook.MouseWheelExt += GlobalHookMouseWheelExt;
//_globalHook.KeyPress += GlobalHookKeyPress;
_pickUpKey = TaskContext.Instance().Config.KeyBindingsConfig.PickUpOrInteract.ToWinFormKeys();
_pickUpKeyCode = TaskContext.Instance().Config.KeyBindingsConfig.PickUpOrInteract.ToVK();
_releaseControlKey = TaskContext.Instance().Config.KeyBindingsConfig.Jump.ToWinFormKeys();
_releaseControlKeyCode = TaskContext.Instance().Config.KeyBindingsConfig.Jump.ToVK();
_firstSpaceKeyDownTime = DateTime.MaxValue;
var si = TaskContext.Instance().Config.MacroConfig.SpaceFireInterval;
_spaceTimer.Interval = si;
_spaceTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(User32.VK.VK_SPACE); };
_spaceTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(_releaseControlKeyCode); };
var fi = TaskContext.Instance().Config.MacroConfig.FFireInterval;
_fTimer.Interval = fi;
_fTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(User32.VK.VK_F); };
_fTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(_pickUpKeyCode); };
}
private void GlobalHookKeyDown(object? sender, KeyEventArgs e)
{
// Debug.WriteLine("KeyDown: \t{0}", e.KeyCode);
GlobalKeyMouseRecord.Instance.GlobalHookKeyDown(e);
GlobalKeyMouseRecord.Instance.GlobalHookKeyDown(e, Kernel32.GetTickCount());
// 热键按下事件
HotKeyDown(sender, e);
if (e.KeyCode == Keys.Space)
if (e.KeyCode == _releaseControlKey)
{
if (_firstSpaceKeyDownTime == DateTime.MaxValue)
{
@@ -80,7 +95,7 @@ public class MouseKeyMonitor
_spaceTimer.Start();
}
}
else if (e.KeyCode == Keys.F)
else if (e.KeyCode == _pickUpKey)
{
if (_firstFKeyDownTime == DateTime.MaxValue)
{
@@ -99,12 +114,12 @@ public class MouseKeyMonitor
private void GlobalHookKeyUp(object? sender, KeyEventArgs e)
{
// Debug.WriteLine("KeyUp: \t{0}", e.KeyCode);
GlobalKeyMouseRecord.Instance.GlobalHookKeyUp(e);
GlobalKeyMouseRecord.Instance.GlobalHookKeyUp(e, Kernel32.GetTickCount());
// 热键松开事件
HotKeyUp(sender, e);
if (e.KeyCode == Keys.Space)
if (e.KeyCode == _releaseControlKey)
{
if (_firstSpaceKeyDownTime != DateTime.MaxValue)
{
@@ -114,7 +129,7 @@ public class MouseKeyMonitor
_spaceTimer.Stop();
}
}
else if (e.KeyCode == Keys.F)
else if (e.KeyCode == _pickUpKey)
{
if (_firstFKeyDownTime != DateTime.MaxValue)
{
@@ -166,6 +181,12 @@ public class MouseKeyMonitor
// Debug.WriteLine("MouseMove: {0}; \t Location: {1};\t System Timestamp: {2}", e.Button, e.Location, e.Timestamp);
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveTo(e);
}
private void GlobalHookMouseWheelExt(object? sender, MouseEventExtArgs e)
{
// Debug.WriteLine("MouseMove: {0}; \t Location: {1};\t Delta: {2};\t System Timestamp: {3}", e.Button, e.Location, e.Delta, e.Timestamp);
GlobalKeyMouseRecord.Instance.GlobalHookMouseWheel(e);
}
public void Unsubscribe()
{
@@ -176,6 +197,7 @@ public class MouseKeyMonitor
_globalHook.MouseDownExt -= GlobalHookMouseDownExt;
_globalHook.MouseUpExt -= GlobalHookMouseUpExt;
_globalHook.MouseMoveExt -= GlobalHookMouseMoveExt;
_globalHook.MouseWheelExt -= GlobalHookMouseWheelExt;
//_globalHook.KeyPress -= GlobalHookKeyPress;
_globalHook.Dispose();
}
@@ -23,7 +23,7 @@ public class PaddleOcrService : IOcrService
public PaddleOcrService()
{
var path = Global.Absolute("Assets\\Model\\PaddleOcr");
var path = Global.Absolute(@"Assets\Model\PaddleOcr");
var localDetModel = DetectionModel.FromDirectory(Path.Combine(path, "ch_PP-OCRv4_det"), ModelVersion.V4);
var localClsModel = ClassificationModel.FromDirectory(Path.Combine(path, "ch_ppocr_mobile_v2.0_cls"));
var localRecModel = RecognizationModel.FromDirectory(Path.Combine(path, "ch_PP-OCRv4_rec"), Path.Combine(path, "ppocr_keys_v1.txt"), ModelVersion.V4);
@@ -0,0 +1,66 @@
using System;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask.Model.Area;
using Compunet.YoloV8;
using OpenCvSharp;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using System.Text.Json;
using BetterGenshinImpact.View.Drawable;
namespace BetterGenshinImpact.Core.Recognition.ONNX;
public class BgiYoloV8Predictor(string modelRelativePath) : IDisposable
{
private readonly YoloV8Predictor _predictor = YoloV8Builder.CreateDefaultBuilder()
.UseOnnxModel(Global.Absolute(modelRelativePath))
.WithSessionOptions(BgiSessionOption.Instance.Options)
.Build();
public YoloV8Predictor Predictor => _predictor;
/// <summary>
/// 检测
/// </summary>
/// <param name="region">图像</param>
/// <returns>类别-矩形框</returns>
public Dictionary<string, List<Rect>> Detect(ImageRegion region)
{
using var memoryStream = new MemoryStream();
region.SrcBitmap.Save(memoryStream, ImageFormat.Bmp);
memoryStream.Seek(0, SeekOrigin.Begin);
var result = _predictor.Detect(memoryStream);
var dict = new Dictionary<string, List<Rect>>();
foreach (var box in result.Boxes)
{
if (!dict.ContainsKey(box.Class.Name))
{
dict[box.Class.Name] = [new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height)];
}
else
{
dict[box.Class.Name].Add(new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height));
}
}
Debug.WriteLine("YOLOv8识别结果:" + JsonSerializer.Serialize(dict));
var list = new List<RectDrawable>();
foreach (var box in result.Boxes)
{
var rect = new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height);
list.Add(region.ToRectDrawable(rect, modelRelativePath));
}
VisionContext.Instance().DrawContent.PutOrRemoveRectList(modelRelativePath, list);
return dict;
}
public void Dispose()
{
_predictor.Dispose();
}
}
@@ -0,0 +1,18 @@
using System.Collections.Generic;
namespace BetterGenshinImpact.Core.Recognition.ONNX;
public class BgiYoloV8PredictorFactory
{
static Dictionary<string, BgiYoloV8Predictor> _predictors = new();
public static BgiYoloV8Predictor GetPredictor(string modelRelativePath)
{
if (!_predictors.ContainsKey(modelRelativePath))
{
_predictors[modelRelativePath] = new BgiYoloV8Predictor(modelRelativePath);
}
return _predictors[modelRelativePath];
}
}
@@ -23,12 +23,12 @@ public class PickTextInference : ITextInference
public PickTextInference()
{
var modelPath = Global.Absolute("Assets\\Model\\Yap\\model_training.onnx");
var modelPath = Global.Absolute(@"Assets\Model\Yap\model_training.onnx");
if (!File.Exists(modelPath)) throw new FileNotFoundException("Yap模型文件不存在", modelPath);
_session = new InferenceSession(modelPath, BgiSessionOption.Instance.Options);
var wordJsonPath = Global.Absolute("Assets\\Model\\Yap\\index_2_word.json");
var wordJsonPath = Global.Absolute(@"Assets\Model\Yap\index_2_word.json");
if (!File.Exists(wordJsonPath)) throw new FileNotFoundException("Yap字典文件不存在", wordJsonPath);
var json = File.ReadAllText(wordJsonPath);
@@ -15,12 +15,12 @@ public class Predictor
public Predictor()
{
var options = new SessionOptions();
var modelPath = Global.Absolute("Assets\\Model\\Fish\\bgi_fish.onnx");
var modelPath = Global.Absolute(@"Assets\Model\Fish\bgi_fish.onnx");
if (!File.Exists(modelPath)) throw new FileNotFoundException("自动钓鱼模型文件不存在", modelPath);
_session = new InferenceSession(modelPath, options);
var wordJsonPath = Global.Absolute("Assets\\Model\\Fish\\label.json");
var wordJsonPath = Global.Absolute(@"Assets\Model\Fish\label.json");
if (!File.Exists(wordJsonPath)) throw new FileNotFoundException("自动钓鱼模型分类文件不存在", wordJsonPath);
var json = File.ReadAllText(wordJsonPath);
@@ -0,0 +1,31 @@
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
/// <summary>
/// FlannMatch
/// 优点:
/// 1. 速度快:FlannMatch 使用的是近似最近邻搜索算法,适合处理大规模数据集,速度比暴力匹配器快得多。
/// 2. 可扩展性好:适用于高维特征空间,能够处理大量特征点。
/// 缺点:
/// 1. 精度较低:由于是近似搜索,匹配的精度可能不如暴力匹配器高。
/// 2. 复杂性高:需要对参数进行调优,以获得最佳性能。
/// BfMatch
/// 优点:
/// 1. 精度高:BfMatch 进行的是精确匹配,能够找到最优的匹配对。
/// 2. 简单易用:不需要复杂的参数调优,适合初学者和简单应用。
/// 缺点:
/// 1. 速度慢:对于大规模数据集,暴力匹配器的速度较慢,因为它需要计算所有特征点之间的距离。
/// 2. 不适合高维数据:在高维特征空间中,计算量会显著增加,性能下降明显。
/// 选择建议
/// • 大规模数据集:如果你需要处理大量特征点,且对速度要求较高,FlannMatch 是一个更好的选择。
/// • 高精度要求:如果你的应用对匹配精度要求很高,且数据规模较小,BfMatch 会更合适。
/// </summary>
public enum DescriptorMatcherType
{
// 快速近似最近邻搜索库
BruteForce,
// 暴力匹配器
FlannBased
// 更多类型命名见 DescriptorMatcher.Create
}
@@ -13,9 +13,14 @@ namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public class FeatureMatcher
{
private readonly double _threshold; // SURF 100
private readonly double _threshold = 100; // SURF 100
private readonly Feature2D _feature2D;
private readonly FlannBasedMatcher flnMatcher = new();
private readonly Dictionary<DescriptorMatcherType, DescriptorMatcher> _matcherFactory = new()
{
{ DescriptorMatcherType.BruteForce, DescriptorMatcher.Create(DescriptorMatcherType.BruteForce.ToString()) },
{ DescriptorMatcherType.FlannBased, DescriptorMatcher.Create(DescriptorMatcherType.FlannBased.ToString()) }
};
private readonly Size _trainMatSize; // 大图大小
@@ -34,11 +39,9 @@ public class FeatureMatcher
/// <param name="trainMat"></param>
/// <param name="featureStorage"></param>
/// <param name="type"></param>
/// <param name="threshold"></param>
/// <exception cref="Exception"></exception>
public FeatureMatcher(Mat trainMat, FeatureStorage? featureStorage = null, Feature2DType type = Feature2DType.SIFT, double threshold = 100)
public FeatureMatcher(Mat trainMat, FeatureStorage? featureStorage = null, Feature2DType type = Feature2DType.SIFT)
{
_threshold = threshold;
_trainMatSize = trainMat.Size();
if (Feature2DType.SURF == type)
{
@@ -86,11 +89,9 @@ public class FeatureMatcher
/// <param name="trainMatSize"></param>
/// <param name="featureStorage"></param>
/// <param name="type"></param>
/// <param name="threshold"></param>
/// <exception cref="Exception"></exception>
public FeatureMatcher(Size trainMatSize, FeatureStorage featureStorage, Feature2DType type = Feature2DType.SIFT, double threshold = 100)
public FeatureMatcher(Size trainMatSize, FeatureStorage featureStorage, Feature2DType type = Feature2DType.SIFT)
{
_threshold = threshold;
_trainMatSize = trainMatSize;
if (Feature2DType.SURF == type)
{
@@ -114,6 +115,13 @@ public class FeatureMatcher
Debug.WriteLine($"切割特征点耗时: {sw.ElapsedMilliseconds}ms");
}
public DescriptorMatcher GetMatcher(DescriptorMatcherType type)
{
return _matcherFactory[type];
}
#region 普通匹配
/// <summary>
/// 普通匹配(全图特征)
/// </summary>
@@ -128,10 +136,10 @@ public class FeatureMatcher
/// <summary>
/// 合并邻近的特征点后匹配(临近特征)
/// </summary>
/// <param name="queryMat">查询的图</param>
/// <param name="queryMat">查询图像的 Mat 对象。</param>
/// <param name="prevX">上次匹配到的坐标x</param>
/// <param name="prevY">上次匹配到的坐标y</param>
/// <param name="queryMatMask">查询Mask</param>
/// <param name="queryMatMask">查询图像的 Mask,用于限定检测特征的区域。</param>
/// <returns></returns>
public Point2f Match(Mat queryMat, float prevX, float prevY, Mat? queryMatMask = null)
{
@@ -142,19 +150,20 @@ public class FeatureMatcher
Debug.WriteLine($"---------切换到新的特征块({cellRow},{cellCol}),合并特征点--------");
_lastMergedBlock = KeyPointFeatureBlockHelper.MergeNeighboringFeatures(_blocks, _trainDescriptors, cellRow, cellCol);
}
return Match(_lastMergedBlock.KeyPointArray, _lastMergedBlock.Descriptor!, queryMat, queryMatMask);
}
/// <summary>
/// 普通匹配
/// 用于从训练图像和查询图像中找到匹配的特征点,计算透视变换并确定查询图像的中心点在训练图像中的位置。
/// </summary>
/// <param name="trainKeyPoints"></param>
/// <param name="trainRet"></param>
/// <param name="queryMat"></param>
/// <param name="queryMatMask"></param>
/// <param name="trainKeyPoints">训练图像中的关键点集合。</param>
/// <param name="trainDescriptors">训练图像的特征描述子。</param>
/// <param name="queryMat">查询图像的 Mat 对象。</param>
/// <param name="queryMatMask">查询图像的 Mask,用于限定检测特征的区域。</param>
/// <param name="matcherType">描述符匹配器的类型,默认为 DescriptorMatcherType.FlannBased</param>
/// <returns></returns>
public Point2f Match(KeyPoint[] trainKeyPoints, Mat trainRet, Mat queryMat, Mat? queryMatMask = null)
public Point2f Match(KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
SpeedTimer speedTimer = new();
@@ -164,7 +173,7 @@ public class FeatureMatcher
#pragma warning restore CS8604 // 引用类型参数可能为 null。
speedTimer.Record("模板生成KeyPoint");
var matches = flnMatcher.Match(queryDescriptors, trainRet);
var matches = GetMatcher(matcherType).Match(queryDescriptors, trainDescriptors);
//Finding the Minimum and Maximum Distance
double minDistance = 1000; //Backward approximation
double maxDistance = 0;
@@ -237,11 +246,13 @@ public class FeatureMatcher
/// 普通匹配
/// </summary>
/// <param name="trainKeyPoints"></param>
/// <param name="trainRet"></param>
/// <param name="trainDescriptors"></param>
/// <param name="queryMat"></param>
/// <param name="queryMatMask"></param>
/// <param name="matcherType"></param>
/// <returns></returns>
public Point2f[] MatchCorners(KeyPoint[] trainKeyPoints, Mat trainRet, Mat queryMat, Mat? queryMatMask = null)
public Point2f[] MatchCorners(KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
SpeedTimer speedTimer = new();
@@ -251,7 +262,7 @@ public class FeatureMatcher
#pragma warning restore CS8604 // 引用类型参数可能为 null。
speedTimer.Record("模板生成KeyPoint");
var matches = flnMatcher.Match(queryDescriptors, trainRet);
var matches = GetMatcher(matcherType).Match(queryDescriptors, trainDescriptors);
//Finding the Minimum and Maximum Distance
double minDistance = 1000; //Backward approximation
double maxDistance = 0;
@@ -328,91 +339,46 @@ public class FeatureMatcher
return Cv2.BoundingRect(corners);
}
// /// <summary>
// /// knn的方式匹配
// /// </summary>
// /// <param name="matSrc"></param>
// /// <returns></returns>
// [Obsolete]
// public Point2f[]? KnnMatch(Mat matSrc)
// {
// SpeedTimer speedTimer = new();
//
// using var matSrcRet = new Mat();
// KeyPoint[] keyPointsSrc;
// using (var surf = SURF.Create(_threshold, 4, 3, false, true))
// {
// surf.DetectAndCompute(matSrc, null, out keyPointsSrc, matSrcRet);
// speedTimer.Record("模板生成KeyPoint");
// }
//
// var knnMatches = flnMatcher.KnnMatch(matSrcRet, _trainDescriptors, 2);
// const float minRatio = 0.75f;
//
// var pointsSrc = new List<Point2f>();
// var pointsDst = new List<Point2f>();
// //Screening better matching points
// // var goodMatches = new List<DMatch>();
// for (int i = 0; i < knnMatches.Length; i++)
// {
// var best = knnMatches[i][0];
// var better = knnMatches[i][1];
// var r = best.Distance / better.Distance;
// if (r > minRatio)
// {
// pointsSrc.Add(keyPointsSrc[best.QueryIdx].Pt);
// pointsDst.Add(_trainKeyPoints[best.TrainIdx].Pt);
// }
// }
//
// if (pointsSrc.Count < 7)
// {
// Debug.WriteLine("匹配点过少");
// return null;
// }
//
// speedTimer.Record("FlannMatch.KnnMatch");
//
// // var outMat = new Mat();
//
// // algorithm RANSAC Filter the matched results
// var pSrc = pointsSrc.ToPoint2d();
// var pDst = pointsDst.ToPoint2d();
// var outMask = new Mat();
// // If the original matching result is null, Skip the filtering step
// if (pSrc.Count > 0 && pDst.Count > 0)
// {
// var hMat = Cv2.FindHomography(pSrc, pDst, HomographyMethods.Ransac, mask: outMask);
// speedTimer.Record("FindHomography");
//
// var objCorners = new Point2f[4];
// objCorners[0] = new Point2f(0, 0);
// objCorners[1] = new Point2f(0, matSrc.Rows);
// objCorners[2] = new Point2f(matSrc.Cols, matSrc.Rows);
// objCorners[3] = new Point2f(matSrc.Cols, 0);
//
// var sceneCorners = Cv2.PerspectiveTransform(objCorners, hMat);
// speedTimer.Record("PerspectiveTransform");
// speedTimer.DebugPrint();
// return sceneCorners;
// }
//
// speedTimer.DebugPrint();
// return null;
// }
#endregion 普通匹配
#region Knn匹配
public Point2f KnnMatch(Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
return KnnMatch(_trainKeyPoints, _trainDescriptors, queryMat, queryMatMask, matcherType);
}
public Point2f KnnMatch(Mat queryMat, float prevX, float prevY, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
var (cellRow, cellCol) = KeyPointFeatureBlockHelper.GetCellIndex(_trainMatSize, _splitRow, _splitCol, prevX, prevY);
Debug.WriteLine($"当前坐标({prevX},{prevY})在特征块({cellRow},{cellCol})中");
if (_lastMergedBlock == null || _lastMergedBlock.MergedCenterCellRow != cellRow || _lastMergedBlock.MergedCenterCellCol != cellCol)
{
Debug.WriteLine($"---------切换到新的特征块({cellRow},{cellCol}),合并特征点--------");
_lastMergedBlock = KeyPointFeatureBlockHelper.MergeNeighboringFeatures(_blocks, _trainDescriptors, cellRow, cellCol);
}
return KnnMatch(_lastMergedBlock.KeyPointArray, _lastMergedBlock.Descriptor!, queryMat, queryMatMask, matcherType);
}
/// <summary>
/// https://github.com/tignioj/minimap/blob/main/matchmap/sifttest/sifttest5.py
/// Copilot 生成
/// </summary>
/// <returns></returns>
private Point2f? KnnMatch(KeyPoint[] trainKeyPoints, Mat trainRet, Mat queryMat, Mat? queryMatMask = null)
private Point2f KnnMatch(KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
SpeedTimer speedTimer = new();
using var queryDescriptors = new Mat();
#pragma warning disable CS8604 // 引用类型参数可能为 null。
_feature2D.DetectAndCompute(queryMat, queryMatMask, out var queryKeyPoints, queryDescriptors);
#pragma warning restore CS8604 // 引用类型参数可能为 null。
var matches = flnMatcher.KnnMatch(queryDescriptors, _trainDescriptors, k: 2);
speedTimer.Record("模板生成KeyPoint");
var matches = GetMatcher(matcherType).KnnMatch(queryDescriptors, trainDescriptors, k: 2);
speedTimer.Record("FlannMatch");
// 应用比例测试来过滤匹配点
List<DMatch> goodMatches = [];
@@ -426,29 +392,101 @@ public class FeatureMatcher
if (goodMatches.Count < 7)
{
return null;
return new Point2f();
}
// 获取匹配点的坐标
var srcPts = goodMatches.Select(m => queryKeyPoints[m.QueryIdx].Pt).ToArray();
var dstPts = goodMatches.Select(m => _trainKeyPoints[m.TrainIdx].Pt).ToArray();
var dstPts = goodMatches.Select(m => trainKeyPoints[m.TrainIdx].Pt).ToArray();
speedTimer.Record("GetGoodMatchPoints");
// 使用RANSAC找到变换矩阵
var mask = new Mat();
var M = Cv2.FindHomography(srcPts.ToList().ToPoint2d(), dstPts.ToList().ToPoint2d(), HomographyMethods.Ransac, 3.0, mask);
if (M.Empty())
var hMat = Cv2.FindHomography(srcPts.ToList().ToPoint2d(), dstPts.ToList().ToPoint2d(), HomographyMethods.Ransac, 3.0, mask);
if (hMat.Empty())
{
return null;
return new Point2f();
}
speedTimer.Record("FindHomography");
// 计算小地图的中心点
var h = queryMat.Rows;
var w = queryMat.Cols;
var centerPoint = new Point2f(w / 2f, h / 2f);
Point2f[] centerPoints = [centerPoint];
Point2f[] transformedCenter = Cv2.PerspectiveTransform(centerPoints, M);
Point2f[] transformedCenter = Cv2.PerspectiveTransform(centerPoints, hMat);
speedTimer.Record("PerspectiveTransform");
speedTimer.DebugPrint();
// 返回小地图在大地图中的中心坐标
return transformedCenter[0];
}
public Point2f[] KnnMatchCorners(KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
SpeedTimer speedTimer = new();
using var queryDescriptors = new Mat();
#pragma warning disable CS8604 // 引用类型参数可能为 null。
_feature2D.DetectAndCompute(queryMat, queryMatMask, out var queryKeyPoints, queryDescriptors);
#pragma warning restore CS8604 // 引用类型参数可能为 null。
speedTimer.Record("模板生成KeyPoint");
var matches = GetMatcher(matcherType).KnnMatch(queryDescriptors, trainDescriptors, k: 2);
speedTimer.Record("FlannMatch");
// 应用比例测试来过滤匹配点
List<DMatch> goodMatches = [];
foreach (var match in matches)
{
if (match.Length == 2 && match[0].Distance < 0.75 * match[1].Distance)
{
goodMatches.Add(match[0]);
}
}
if (goodMatches.Count < 7)
{
return [];
}
// 获取匹配点的坐标
var srcPts = goodMatches.Select(m => queryKeyPoints[m.QueryIdx].Pt).ToArray();
var dstPts = goodMatches.Select(m => trainKeyPoints[m.TrainIdx].Pt).ToArray();
speedTimer.Record("GetGoodMatchPoints");
// 使用RANSAC找到变换矩阵
var mask = new Mat();
var hMat = Cv2.FindHomography(srcPts.ToList().ToPoint2d(), dstPts.ToList().ToPoint2d(), HomographyMethods.Ransac, 3.0, mask);
if (hMat.Empty())
{
return [];
}
speedTimer.Record("FindHomography");
// 返回四个角点
var objCorners = new Point2f[4];
objCorners[0] = new Point2f(0, 0);
objCorners[1] = new Point2f(0, queryMat.Rows);
objCorners[2] = new Point2f(queryMat.Cols, queryMat.Rows);
objCorners[3] = new Point2f(queryMat.Cols, 0);
var sceneCorners = Cv2.PerspectiveTransform(objCorners, hMat);
speedTimer.Record("PerspectiveTransform");
speedTimer.DebugPrint();
return sceneCorners;
}
public Rect KnnMatchRect(Mat queryMat, Mat? queryMatMask = null)
{
var corners = KnnMatchCorners(_trainKeyPoints, _trainDescriptors, queryMat, queryMatMask);
if (corners.Length == 0)
{
return Rect.Empty;
}
return Cv2.BoundingRect(corners);
}
#endregion Knn匹配
}
@@ -7,8 +7,7 @@ namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public class FeatureStorage(string name)
{
private readonly string rootPath = Global.Absolute(@"User\Map\");
private readonly string rootPath = Global.Absolute(@"Assets\Map\");
public void SetType(Feature2DType type)
{
TypeName = type.ToString();
@@ -16,24 +15,6 @@ public class FeatureStorage(string name)
public string TypeName { get; set; } = "UNKNOWN";
// public KeyPoint[]? LoadKeyPointArray1()
// {
// CreateFolder();
// string kpPath = Path.Combine(rootPath, $"{name}_{TypeName}.kp");
// if (File.Exists(kpPath))
// {
// return ObjectUtils.Deserialize(File.ReadAllBytes(kpPath)) as KeyPoint[];
// }
// return null;
// }
//
// public void SaveKeyPointArray1(KeyPoint[] kpArray)
// {
// CreateFolder();
// string kpPath = Path.Combine(rootPath, $"{name}_{TypeName}.kp");
// File.WriteAllBytes(kpPath, ObjectUtils.Serialize(kpArray));
// }
public KeyPoint[]? LoadKeyPointArray()
{
CreateFolder();
@@ -65,32 +46,6 @@ public class FeatureStorage(string name)
}
}
// public Mat? LoadDescMat1()
// {
// CreateFolder();
// // 格式: Surf_336767x128.mat
// var files = Directory.GetFiles(rootPath, $"{name}_{TypeName}_*.mat", SearchOption.AllDirectories);
// if (files.Length == 0)
// {
// return null;
// }
// else if (files.Length > 1)
// {
// Debug.WriteLine($"[FeatureSerializer] Found multiple files: {string.Join(", ", files)}");
// }
// var rowColPair = Path.GetFileNameWithoutExtension(files[0])
// .Replace($"{name}_{TypeName}_", "")
// .Split('x');
// if (rowColPair.Length != 2)
// {
// Debug.WriteLine($"[FeatureSerializer] Invalid file name: {files[0]}");
// return null;
// }
// GCHandle pinnedArray = GCHandle.Alloc(ObjectUtils.Deserialize(File.ReadAllBytes(files[0])), GCHandleType.Pinned);
// IntPtr pointer = pinnedArray.AddrOfPinnedObject();
// return new Mat(Convert.ToInt32(rowColPair[0]), Convert.ToInt32(rowColPair[1]), MatType.CV_32FC1, pointer);
// }
public Mat? LoadDescMat()
{
CreateFolder();
@@ -109,22 +64,6 @@ public class FeatureStorage(string name)
return mat;
}
// public void SaveDescMat1(Mat descMat)
// {
// CreateFolder();
// // 删除旧文件
// var files = Directory.GetFiles(rootPath, $"{name}_{TypeName}_*.mat", SearchOption.AllDirectories);
// foreach (var file in files)
// {
// File.Delete(file);
// }
//
// var descPath = Path.Combine(rootPath, $"{name}_{TypeName}_{descMat.Rows}x{descMat.Cols}.mat");
// var bytes = new byte[descMat.Step(0) * descMat.Rows]; // matSrcRet.Total() * matSrcRet.ElemSize()
// Marshal.Copy(descMat.Data, bytes, 0, bytes.Length);
// File.WriteAllBytes(descPath, ObjectUtils.Serialize(bytes));
// }
public void SaveDescMat(Mat descMat)
{
CreateFolder();
@@ -135,7 +74,6 @@ public class FeatureStorage(string name)
{
File.Delete(file);
}
var descPath = Path.Combine(rootPath, fileName);
FileStorage fs = new(descPath, FileStorage.Modes.Write);
fs.Write("desc", descMat);
@@ -144,5 +144,28 @@ public class RecognitionObject
/// </summary>
public List<string> RegexMatchText { get; set; } = [];
public static RecognitionObject Ocr(double x, double y, double w, double h)
{
return new RecognitionObject
{
RecognitionType = RecognitionTypes.Ocr,
RegionOfInterest = new Rect((int)Math.Round(x), (int)Math.Round(y), (int)Math.Round(w), (int)Math.Round(h))
};
}
public static RecognitionObject Ocr(Rect rect)
{
return new RecognitionObject
{
RecognitionType = RecognitionTypes.Ocr,
RegionOfInterest = rect
};
}
public static RecognitionObject OcrThis = new()
{
RecognitionType = RecognitionTypes.Ocr
};
#endregion OCR文字识别
}
@@ -8,8 +8,10 @@ using Microsoft.Extensions.Logging;
using SharpDX.DirectInput;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows.Forms;
using Wpf.Ui.Violeta.Controls;
namespace BetterGenshinImpact.Core.Recorder;
@@ -39,13 +41,13 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
{
if (!TaskContext.Instance().IsInitialized)
{
MessageBox.Show("请先在启动页,启动截图器再使用本功能");
Toast.Warning("请先在启动页,启动截图器再使用本功能");
return;
}
if (Status != KeyMouseRecorderStatus.Stop)
{
MessageBox.Show("已经在录制状态,请不要重复启动录制功能");
Toast.Warning("已经在录制状态,请不要重复启动录制功能");
return;
}
@@ -113,7 +115,7 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
ra.Dispose();
}
public void GlobalHookKeyDown(KeyEventArgs e)
public void GlobalHookKeyDown(KeyEventArgs e, uint time)
{
// 排除热键
if (e.KeyCode.ToString() == TaskContext.Instance().Config.HotKeyConfig.KeyMouseMacroRecordHotkey)
@@ -137,10 +139,10 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
_keyDownState.Add(e.KeyCode, true);
}
// Debug.WriteLine($"KeyDown: {e.KeyCode}");
_recorder?.KeyDown(e);
_recorder?.KeyDown(e, time);
}
public void GlobalHookKeyUp(KeyEventArgs e)
public void GlobalHookKeyUp(KeyEventArgs e, uint time)
{
if (e.KeyCode.ToString() == TaskContext.Instance().Config.HotKeyConfig.Test1Hotkey)
{
@@ -151,7 +153,7 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
{
// Debug.WriteLine($"KeyUp: {e.KeyCode}");
_keyDownState[e.KeyCode] = false;
_recorder?.KeyUp(e);
_recorder?.KeyUp(e, time);
}
}
@@ -176,15 +178,21 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
// Debug.WriteLine($"MouseMove: {e.X}, {e.Y}");
_recorder?.MouseMoveTo(e);
}
public void GlobalHookMouseWheel(MouseEventExtArgs e)
{
// Debug.WriteLine($"MouseWheel: {e.Delta}");
_recorder?.MouseWheel(e);
}
public void GlobalHookMouseMoveBy(MouseState state)
public void GlobalHookMouseMoveBy(MouseState state, uint time)
{
if (state is { X: 0, Y: 0 } || !_isInMainUi)
{
return;
}
// Debug.WriteLine($"MouseMoveBy: {state.X}, {state.Y}");
_recorder?.MouseMoveBy(state);
_recorder?.MouseMoveBy(state, time);
}
}
Loaded 100 of 484 files, more files were not shown because too many files have changed in this diff. Show more