Compare commits

..
1517 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
qhy040404 c490d29aa1 code cleanup 2024-08-14 18:01:02 +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
qhy040404 78ec9d31e8 check integration #468 2024-08-14 16:03:43 +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
辉鸭蛋 b62e87f36f Merge pull request #524 from babalae/feat-random-opt
随便改改
2024-08-14 11:34:22 +08:00
DismissedLight 48115be84e 随便改改 2024-08-14 11:13:40 +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
辉鸭蛋 bc6ef4fa49 add comment 2024-08-14 00:15:25 +08:00
辉鸭蛋 eef5ff32cb add CameraOrientation.ComputeMiniMap(mat) 2024-08-14 00:14:04 +08:00
辉鸭蛋 c9f3f11c8a make the ScriptControlPage visible 2024-08-13 23:29:51 +08:00
辉鸭蛋 4b4ef25ede 0.32.5 2024-08-13 23:09:14 +08:00
辉鸭蛋 644cdea7ee fix the accuracy issue of feature matching 2024-08-13 23:05:53 +08:00
辉鸭蛋 83911bb13d add new knn match 2024-08-13 21:37:00 +08:00
辉鸭蛋 bc3f356d46 add new knn match 2024-08-13 01:52:48 +08:00
辉鸭蛋 f016f6001c Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-13 01:07:59 +08:00
辉鸭蛋 e1097199c4 map feature clear up 2024-08-13 01:07:53 +08:00
辉鸭蛋 36639a0786 auto crystalfly more position 2024-08-12 23:49:35 +08:00
辉鸭蛋 be6c5646da Update README.md 2024-08-12 22:16:43 +08:00
ema 4626863f30 fix #446 2024-08-12 00:23:43 +08:00
辉鸭蛋 b07f2ec839 more crystalfly position 2024-08-11 23:21:55 +08:00
辉鸭蛋 b44ddd5625 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-11 20:15:23 +08:00
辉鸭蛋 ed9a47a3a1 fix dispather thread safe 2024-08-11 20:14:32 +08:00
ema 3c27c90828 update: GetParent before SetParent 2024-08-11 19:42:49 +08:00
辉鸭蛋 8fa071722e js : dispatcher.addTimer 2024-08-11 17:58:22 +08:00
辉鸭蛋 2c2e9c0303 supplement the mode of the runner 2024-08-11 10:41:01 +08:00
辉鸭蛋 a7153a47f6 auto crystalfly init 2024-08-11 02:32:00 +08:00
辉鸭蛋 26aa811e97 add script group runner 2024-08-11 00:09:25 +08:00
辉鸭蛋 00f822c49d switch to ground when big map in underground 2024-08-10 23:14:08 +08:00
辉鸭蛋 02b3d80056 record camera orientation config 2024-08-10 22:04:17 +08:00
辉鸭蛋 0edf6c13ef script group ui3 2024-08-10 21:18:48 +08:00
辉鸭蛋 ad288c60cc script group ui 2 2024-08-10 19:16:35 +08:00
辉鸭蛋 308d398036 script group ui 2024-08-10 13:37:29 +08:00
辉鸭蛋 dc09a0ac7b Merge pull request #514 from lwh9346/main
修复了相机视角记录频率不正确的问题
2024-08-10 08:51:57 +08:00
lwh9346 0a4e8e6403 Merge branch 'babalae:main' into main 2024-08-10 00:39:23 +08:00
lwh9346 b881ba313e bug fix 2024-08-10 00:37:52 +08:00
辉鸭蛋 7422454c56 Merge pull request #512 from lwh9346/main
通过在录制脚本时记录相机视角改善回放精度
2024-08-09 19:57:53 +08:00
ema 00ab7042c5 chrome://flags/#enable-force-dark 2024-08-09 17:04:25 +08:00
lwh9346 d69a7c428e capture camera orientation while recording mouse movement to improve replay accuracy 2024-08-09 15:58:40 +08:00
辉鸭蛋 c1072d0574 script: support running macros 2024-08-07 01:07:58 +08:00
辉鸭蛋 bd64181b7c Merge pull request #511 from lwh9346/main
改进键鼠脚本录制与回放精度
2024-08-06 23:57:16 +08:00
lwh9346 6bd9079b3b improve macro player 2024-08-06 23:43:48 +08:00
ema 44921dd3e0 create ISSUE_TEMPLATE\feature.md 2024-08-05 12:02:31 +08:00
辉鸭蛋 d5ac4c523e add crud helper 2024-08-04 23:47:54 +08:00
ema fe418e7bc4 update server b login pos #495 2024-08-04 15:21:51 +08:00
ema a1c5c25623 change server b identity 2024-08-04 15:15:34 +08:00
辉鸭蛋 4610c9e7ca add script engine 2024-08-03 19:41:48 +08:00
辉鸭蛋 abac18bc7e reduce the recognition rate requirements for Qin and costume characters 2024-08-02 22:38:47 +08:00
辉鸭蛋 352b45f07d use FileStorage save KeyPoints 2024-08-01 22:36:06 +08:00
辉鸭蛋 65f2aad4c2 add tp click & fix mask window display 2024-07-31 23:44:25 +08:00
辉鸭蛋 4e5629bc16 fix stop recorder hotkey #501 2024-07-30 00:26:52 +08:00
辉鸭蛋 917df88099 add cancel task hotkey #501 2024-07-30 00:12:18 +08:00
辉鸭蛋 96a56ac4b8 fix stop when recorder starting #501 2024-07-29 23:59:22 +08:00
辉鸭蛋 f9cada6ef9 revert mask window old style #503 2024-07-29 23:38:30 +08:00
辉鸭蛋 babe62ddfd 0.32 2024-07-28 14:05:39 +08:00
辉鸭蛋 3b8429d3c4 auto tcg: add Kaveh 2024-07-28 13:53:49 +08:00
辉鸭蛋 9980576083 edit ui 2024-07-28 12:34:25 +08:00
辉鸭蛋 3d2168874e fix some bug 2024-07-28 11:29:50 +08:00
辉鸭蛋 0f5247c844 keymouse script adaptation for multi-resolution 2024-07-28 11:07:00 +08:00
辉鸭蛋 2314a5eb0e fix #497 2024-07-28 10:37:25 +08:00
辉鸭蛋 14e0af74c0 Merge pull request #499 from babalae/feat-task-refactor
Feat task refactor
2024-07-27 20:25:07 +08:00
辉鸭蛋 9a7e4b5a01 move log info 2024-07-24 22:12:13 +08:00
辉鸭蛋 f9bc5ff426 fix build script 2024-07-23 21:35:40 +08:00
辉鸭蛋 e092f6df29 fix build script 2024-07-23 21:34:58 +08:00
辉鸭蛋 059e21775f unified capture image method 2024-07-21 20:38:06 +08:00
辉鸭蛋 076a7596a0 refactor some code 2024-07-21 19:21:01 +08:00
辉鸭蛋 5e3d50c74a edit auto pick settings 2024-07-21 15:34:29 +08:00
辉鸭蛋 4243972eeb script async test 2024-07-21 12:42:39 +08:00
辉鸭蛋 c3922107b5 init script 2024-07-21 10:13:41 +08:00
辉鸭蛋 3741c92c75 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-07-20 21:57:52 +08:00
辉鸭蛋 9a76e5ad22 add common task runner 2024-07-20 21:57:39 +08:00
ema 619865f6d9 fix filename #492 2024-07-20 19:32:35 +08:00
辉鸭蛋 937d4fb214 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-07-20 12:03:37 +08:00
ema 57444dfe95 adjust fps font size 2024-07-20 01:08:37 +08:00
辉鸭蛋 416b0ab0d9 4.8 avatar 2024-07-19 22:19:00 +08:00
辉鸭蛋 57391a3ad4 fix mask ui display 2024-07-19 21:43:16 +08:00
辉鸭蛋 114974f5c3 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-07-18 22:36:08 +08:00
辉鸭蛋 95d2155390 edit text 2024-07-18 22:36:05 +08:00
辉鸭蛋 6402da1841 Neuvillette _runaroundInterval = 10 2024-07-18 22:14:30 +08:00
ema 5bfc11c797 use digital font to show fps 2024-07-17 23:36:50 +08:00
辉鸭蛋 349469250f auto skip: use new new icon 2024-07-17 23:13:14 +08:00
辉鸭蛋 3173e5aeba update Yap model to 4.8 & add more black pick text 2024-07-17 22:39:47 +08:00
辉鸭蛋 6e968f62de fix: direction ui display font size 2024-07-17 22:33:06 +08:00
辉鸭蛋 b628ecc2a9 auto skip: use new playing icon 2024-07-17 22:23:10 +08:00
辉鸭蛋 31d1f579a7 Merge pull request #485 from haokaiyang/main
auto tcg: update character card config to v4.8
2024-07-17 12:41:22 +08:00
haokaiyang 56c46b1e46 auto tcg: update character card config to v4.8 2024-07-17 11:43:44 +08:00
辉鸭蛋 d56b5efaa0 background click blessing of the welkin moon 2024-07-15 23:20:04 +08:00
辉鸭蛋 b1534a612c new BaseTaskThread 2024-07-15 22:15:26 +08:00
辉鸭蛋 9878786dd7 init script page 2024-07-14 20:18:29 +08:00
辉鸭蛋 f7cce1bbbd stage new page 2024-07-13 21:57:41 +08:00
辉鸭蛋 bc6e9bc078 update key mouse marco ui 2024-07-13 17:03:05 +08:00
NextKale af86c1147c Merge branch 'main' of github.com:atiasn/better-genshin-impact 2024-07-13 15:37:15 +08:00
辉鸭蛋 35354ede17 multiple instances of mask windows #481 2024-07-13 10:17:07 +08:00
ema ed20c8bb1d fix #481 2024-07-13 02:42:58 +08:00
辉鸭蛋 98d7ebd217 add FPS displaying #476 2024-07-12 22:47:51 +08:00
辉鸭蛋 3c2d9ca851 smoother mask window #441 2024-07-12 22:21:23 +08:00
辉鸭蛋 c88644f7a6 macro ui 2024-07-07 21:57:33 +08:00
辉鸭蛋 5e607d98f1 Merge pull request #472 from babalae/dotnet8
update to .net8
2024-07-01 10:23:47 +08:00
辉鸭蛋 ba57eebc99 fix ui 2024-07-01 00:56:35 +08:00
辉鸭蛋 347e42bab9 update dependency library version 2024-07-01 00:51:28 +08:00
辉鸭蛋 7d498f2c35 update to .net8 2024-07-01 00:22:36 +08:00
辉鸭蛋 6c1314cc4d add listview for KeyMouseRecordPage 2024-07-01 00:13:18 +08:00
辉鸭蛋 2cd71ff4a1 improve the speed of matching bigmap 2024-06-30 17:12:50 +08:00
辉鸭蛋 cde2046202 fix markdown-body css 2024-06-27 00:39:14 +08:00
ema 1691c73770 update: vendored markdown html 2024-06-27 00:11:23 +08:00
ema 1cf134ab30 show release markdown 2024-06-27 00:08:37 +08:00
辉鸭蛋 083fdd435f integrated recording and playback 2024-06-27 00:00:49 +08:00
辉鸭蛋 84465d866f test direct input 2024-06-26 00:04:52 +08:00
辉鸭蛋 40c42e550b add calibration 2024-06-25 01:50:55 +08:00
辉鸭蛋 8153367903 fix macro play 2024-06-25 00:07:06 +08:00
辉鸭蛋 0d74e9701e add dinput test 2024-06-24 02:20:43 +08:00
辉鸭蛋 7ce829a3af code optimization 2024-06-24 01:20:38 +08:00
辉鸭蛋 da30d0b7a1 add key mouse recorder 2024-06-24 01:12:42 +08:00
辉鸭蛋 85a2e4a642 add record UI 2024-06-23 23:22:11 +08:00
辉鸭蛋 8469f6c37e test map track 2024-06-23 22:17:32 +08:00
辉鸭蛋 d77bb68066 auto domain: switch roles in advance #463 2024-06-23 15:58:48 +08:00
辉鸭蛋 36e0456061 auto skip: add more switch #464 2024-06-23 08:59:36 +08:00
辉鸭蛋 58bf183763 auto skip: random chat option click 2024-06-23 00:57:26 +08:00
辉鸭蛋 3e554d3bd8 auto skip: close popup page use post message 2024-06-23 00:07:03 +08:00
辉鸭蛋 7aeed2978c test to determine if the game is in input state 2024-06-22 23:48:51 +08:00
NextKale 1c5fe7ec64 wood 2024-06-19 08:57:35 +08:00
辉鸭蛋 1097cc3eb8 auto track: more controller 2024-06-16 23:28:29 +08:00
辉鸭蛋 1f0bf59ca7 opt track 2024-06-16 16:42:08 +08:00
辉鸭蛋 a0e241baee close auto wood ocr default #444 2024-06-16 08:43:21 +08:00
辉鸭蛋 a7eafb6f77 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-06-10 13:52:38 +08:00
辉鸭蛋 577abec2d2 simple auto tracking 2024-06-10 13:52:12 +08:00
辉鸭蛋 1ce02a9630 Update README.md 2024-06-08 20:53:10 +08:00
辉鸭蛋 a8d07823f2 DirectML need Windows 10 version 1903 or later 2024-06-08 18:46:07 +08:00
辉鸭蛋 94d4c32cf5 resource updates 2024-06-08 18:25:54 +08:00
ema 187c728ffe fix setup icon size not tradition 2024-06-08 18:07:11 +08:00
辉鸭蛋 6327fbc690 0.31.1 2024-06-08 17:55:48 +08:00
辉鸭蛋 75389d64f2 game loading in background 2024-06-08 17:53:23 +08:00
辉鸭蛋 581f66f16a Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-06-08 16:06:04 +08:00
辉鸭蛋 a2efc18431 setup.exe icon resource replacement 2024-06-08 16:05:58 +08:00
辉鸭蛋 c025d94c69 Update README.md 2024-06-08 10:09:08 +08:00
辉鸭蛋 e5b9639dec 0.31.0 2024-06-08 09:49:17 +08:00
辉鸭蛋 414e4dd026 add build script for appveyor 2024-06-08 02:09:14 +08:00
辉鸭蛋 809f974cbb auto hangout: auto press skip #335 2024-06-08 00:59:28 +08:00
辉鸭蛋 8cb7e2565f simplify .csproj config 2024-06-08 00:34:17 +08:00
辉鸭蛋 8aec2b18d9 auto hangout: add choose option sleep delay #440 2024-06-08 00:20:27 +08:00
辉鸭蛋 ffe5452f91 auto wood: fix repeated add 2024-06-07 23:41:36 +08:00
辉鸭蛋 4eb9a6ae10 update 4.7 avatar model 2024-06-06 01:52:35 +08:00
辉鸭蛋 47e2473041 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-06-06 01:24:06 +08:00
辉鸭蛋 3f5b984b55 update 4.7 avatar json 2024-06-06 00:56:09 +08:00
辉鸭蛋 fc5d37670c auto map test 2024-06-06 00:44:52 +08:00
辉鸭蛋 a9f9e69f77 Merge pull request #436 from haokaiyang/main
auto tcg: update character card config to v4.7
2024-06-05 13:39:06 +08:00
haokaiyang b0f3cb9abb auto tcg: update character card config to v4.7 2024-06-05 13:28:59 +08:00
辉鸭蛋 fe426e4e24 Merge pull request #433 from Vinkle-hzt/main
fix pick bug
2024-06-03 14:02:27 +08:00
Vinkle-hzt 8f3adc62c1 fix pick bug 2024-06-03 13:58:35 +08:00
辉鸭蛋 a141bf459c auto skip: backgroud fix 2024-06-02 17:07:01 +08:00
辉鸭蛋 d016e59eb4 add map country switch 2024-06-02 01:57:38 +08:00
辉鸭蛋 19f2956633 add map tp 2024-06-02 01:09:57 +08:00
辉鸭蛋 6b7e51a78e edit UI title 2024-06-01 18:21:08 +08:00
辉鸭蛋 283cdfbd1d fix merge hangout.json 2024-06-01 18:20:46 +08:00
辉鸭蛋 cfe963dcae auto skip: backgroud click 2024-06-01 18:09:34 +08:00
辉鸭蛋 b75420cd0b Merge pull request #427 from wy3057/main
托马邀约
2024-06-01 18:08:43 +08:00
禹仔二号 d7e3fb01d8 Update hangout.json
托马邀约
2024-06-01 16:23:39 +08:00
辉鸭蛋 5c26287e51 #425 2024-06-01 12:55:41 +08:00
辉鸭蛋 7730b9b1de do not add click delay when claiming rewards #425 2024-06-01 10:07:48 +08:00
辉鸭蛋 36cde37fea switch to combobox config 2024-05-31 22:26:44 +08:00
辉鸭蛋 f6ad165d60 Merge pull request #424 from Vinkle-hzt/main
支持拾取键更改为E键
2024-05-31 21:42:23 +08:00
Vinkle-hzt 563812dfe2 support E to pick 2024-05-30 14:38:21 +08:00
辉鸭蛋 4a30881a4e add hotkey for #366 2024-05-28 23:29:19 +08:00
辉鸭蛋 e470d684ae auto skip: optimize chat option choose #422 2024-05-28 23:01:08 +08:00
辉鸭蛋 f3c17f7443 opt orange option OCR #409 2024-05-28 22:42:05 +08:00
辉鸭蛋 0baf176daa fix AutoGetDailyRewardsEnabled & AutoReExploreEnabled not working #417 2024-05-28 22:31:33 +08:00
辉鸭蛋 ce8b8687f4 keyboard monitor hotkey support space #416 2024-05-28 22:23:04 +08:00
辉鸭蛋 2749af78a5 Merge pull request #421 from babalae/feat-directml
支持使用DirectML进行GPU推理
2024-05-28 19:14:05 +08:00
辉鸭蛋 03a336967e add classify yolov8 2024-05-28 19:11:43 +08:00
辉鸭蛋 94c8c6a842 modify device name 2024-05-28 19:08:28 +08:00
辉鸭蛋 889955389b use DML 2024-05-28 11:42:54 +08:00
辉鸭蛋 08fbd6e2a2 +main 2024-05-28 10:28:16 +08:00
辉鸭蛋 e1f3b01eb1 add icon in mask window 2024-05-28 01:20:59 +08:00
辉鸭蛋 0973ca0887 use new icon 2024-05-28 01:08:42 +08:00
ema be4039a77a Update TriggerSettingsPage.xaml 2024-05-27 23:33:28 +08:00
ema 684fac7d29 fix style about CardExpander 2024-05-27 23:04:55 +08:00
辉鸭蛋 5c6a96957e add new icon font 2024-05-27 22:28:32 +08:00
ema 56477f3490 use font in mask window 2024-05-26 21:23:22 +08:00
辉鸭蛋 95757a5ed6 test PostMessage 2024-05-26 19:14:44 +08:00
ema c4eae50716 fix: hide mask window from Alt+Tab 2024-05-26 19:10:10 +08:00
ema 6da76f4ef7 Update README.md 2024-05-26 18:09:40 +08:00
辉鸭蛋 443f79bde3 Update README.md 2024-05-26 09:29:33 +08:00
辉鸭蛋 57e24c8e33 update readme 2024-05-25 20:10:02 +08:00
辉鸭蛋 edff49c9cb fix #394 2024-05-25 11:15:36 +08:00
辉鸭蛋 594b517936 0.30.2 2024-05-25 11:00:56 +08:00
辉鸭蛋 5f35d483c2 remove system version judgment #394 2024-05-25 11:00:30 +08:00
辉鸭蛋 b8e5c179fc fix the performance of mask windows at different resolutions - 0.30.1 2024-05-24 12:13:51 +08:00
辉鸭蛋 c5d9930a3d 0.30.0 2024-05-23 17:51:36 +08:00
辉鸭蛋 a84c94c5ce add auto cook #266 2024-05-23 00:27:13 +08:00
辉鸭蛋 a801bb2c4f modify home page text 2024-05-22 23:32:12 +08:00
辉鸭蛋 cb106db75f use 2048 block map 2024-05-22 15:38:13 +08:00
辉鸭蛋 772ab1b7e6 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-05-21 00:18:53 +08:00
辉鸭蛋 92be667328 big map tp 2024-05-21 00:18:44 +08:00
ema cb75cf8338 update: OSVERSIONINFOEX 2024-05-20 21:20:46 +08:00
辉鸭蛋 4bf5001a2c WindowsGraphicsCapture only support Windows 10 version 1903 or later #394 2024-05-20 11:56:04 +08:00
辉鸭蛋 6ffe7a670c prevent computer screen shutdown during auto wood #387 2024-05-19 21:28:49 +08:00
辉鸭蛋 54b669de90 press two esc to close tips #235 2024-05-19 21:18:04 +08:00
辉鸭蛋 65acb852f3 add enable switch for #398 2024-05-19 20:59:54 +08:00
辉鸭蛋 c014284b84 add auto fight strategy 2024-05-19 20:21:23 +08:00
辉鸭蛋 cf16969ea0 Merge pull request #398 from atiasn/wood-count 2024-05-18 23:03:38 +08:00
辉鸭蛋 89e505f4a5 fix capture mod for one key marco #396 2024-05-18 22:28:54 +08:00
辉鸭蛋 c686c4a4a6 fix automatic fishing bait selection error for multiple bait fishing points #396 2024-05-18 22:16:09 +08:00
辉鸭蛋 3cc313c204 fix incorrect auto tcg file names 2024-05-18 22:03:18 +08:00
atiasn 9e3d16c819 check wood 2024-05-17 21:57:53 +08:00
atiasn 8513c9ed4f return ocr 2024-05-16 19:40:27 +08:00
Atiasn bb3941d9f5 get best ocr 2024-05-16 18:12:59 +08:00
atiasn 66d1791218 Merge branch 'main' into wood-count 2024-05-16 01:00:04 +08:00
atiasn 27e6de0fbf delete indexOf 2024-05-16 00:59:17 +08:00
ema cb9dc4ca2e UI/UX: use MiSans-Regular as TextThemeFontFamily 2024-05-15 20:26:55 +08:00
NextKale cc16a60896 delete 2024-05-15 00:36:33 +08:00
atiasn 3792a5f0bf sleep 2024-05-15 00:19:07 +08:00
atiasn fec0e8ec39 wood counts 2024-05-15 00:06:09 +08:00
Atiasn bd4223ddaa wood class 2024-05-14 18:15:20 +08:00
Atiasn 3a35d537b6 woods 2024-05-14 17:06:21 +08:00
atiasn 87a39c95eb 只对首次进行OCR识别 2024-05-14 01:46:27 +08:00
Atiasn fb1eeed107 wood count 2024-05-13 16:40:04 +08:00
atiasn cfe9fc6389 伐木计数 2024-05-13 00:49:29 +08:00
ema 9378a134bd remove: package H.InputSimulator #154 2024-05-12 05:16:27 +08:00
辉鸭蛋 c27b5176e7 16:10 high dpi #373 2024-05-12 00:28:37 +08:00
辉鸭蛋 85e0c827ca fix task not work in 16:10 #373 2024-05-11 23:41:07 +08:00
辉鸭蛋 790c30183b edit ui 2024-05-10 21:07:30 +08:00
辉鸭蛋 6f67bea46c auto music: fix low resolution not work 2024-05-10 20:11:29 +08:00
辉鸭蛋 f8ad1bd8e3 0.29.3 2024-05-09 23:39:09 +08:00
辉鸭蛋 8fe59842c6 update music game 2024-05-09 21:56:56 +08:00
辉鸭蛋 ee154da3c3 music game: Gdi32.GetPixel 2024-05-09 02:46:33 +08:00
辉鸭蛋 9886e7eeff test new method 2024-05-08 02:52:52 +08:00
辉鸭蛋 5797c716dc auto music game 2024-05-08 01:59:30 +08:00
辉鸭蛋 dabdfa51f4 fix boundary overflow after switching game resolution 2024-05-05 22:51:11 +08:00
辉鸭蛋 9ab884512a test params 2024-05-05 20:41:30 +08:00
辉鸭蛋 24590d125e Merge pull request #385 from wy3057/main 2024-05-05 19:55:11 +08:00
辉鸭蛋 118307c562 Merge branch 'main' into main 2024-05-05 19:53:23 +08:00
禹仔二号 7096b9ed9e Update hangout.json 2024-05-05 19:46:32 +08:00
辉鸭蛋 85932c1040 auto hangout: fix 鹿野院平藏 2024-05-05 19:44:16 +08:00
禹仔二号 d90376461c Update hangout.json 2024-05-05 19:40:41 +08:00
辉鸭蛋 c544c18b07 test map tp 2024-05-05 19:12:01 +08:00
辉鸭蛋 a7fcce36b6 Merge pull request #384 from wy3057/main 2024-05-05 19:08:30 +08:00
禹仔二号 e7ef9dcd2f Update hangout.json
根据群友及issue修改了部分邀约文本,其他有可能存在问题
珐露珊结局1:过去的故事
五郎结局1:下,下次一定~
凝光结局1:趁着光景正好
重云结局5:告别    issue#377
重云结局6:小小的遗憾
鹿野院平藏结局1:不蒸发的回忆 issue#375
2024-05-05 18:55:01 +08:00
辉鸭蛋 80b6e36d9a test way point recorder 2024-05-04 23:31:26 +08:00
辉鸭蛋 e6c7abb074 add macro 2024-05-04 23:31:02 +08:00
辉鸭蛋 bcec9cfc6b add new auto pick ocr engine 2024-05-04 19:31:47 +08:00
辉鸭蛋 bea434a3bb Revert "update Yap model to 4.6"
This reverts commit 0e6e94c1e9.
2024-05-04 18:53:37 +08:00
辉鸭蛋 e250498c57 quick tp : eliminate interference from place names on the map 2024-05-04 15:55:00 +08:00
辉鸭蛋 0e6e94c1e9 update Yap model to 4.6 2024-05-04 14:43:52 +08:00
辉鸭蛋 87345e6225 Merge pull request #379 from babalae/feat/resolution 2024-05-04 14:21:30 +08:00
辉鸭蛋 992d1a2e9e edit text 2024-05-04 13:55:52 +08:00
辉鸭蛋 87cb044947 fix bug & edit tip 2024-05-04 13:30:03 +08:00
辉鸭蛋 667043594c refactor: remove ClickOffset 2024-05-04 12:33:27 +08:00
辉鸭蛋 1f6d4a3346 refactor: QuickBuyTask 2024-05-04 11:57:58 +08:00
辉鸭蛋 b1e33a6339 refactor: QuickSereniteaPotTask 2024-05-04 11:49:22 +08:00
辉鸭蛋 7953a76b3d refactor: auto domain 2024-05-03 22:22:42 +08:00
辉鸭蛋 f1c82f83b0 add middle button click. Test passed #154 2024-05-03 22:22:06 +08:00
辉鸭蛋 98b744f33f auto tcg opt 2024-05-03 21:24:17 +08:00
辉鸭蛋 9e01dbd88c #354 2024-05-03 21:21:48 +08:00
辉鸭蛋 be99fb3605 refactor: auto fish 2024-05-03 20:10:43 +08:00
辉鸭蛋 6bf73adce2 fix ra bug 2024-05-03 19:43:22 +08:00
辉鸭蛋 6b98424603 refactor: auto wood & fix game loading trigger 2024-05-03 13:33:56 +08:00
辉鸭蛋 d3f934b1fa Merge branch 'main' into feat/resolution 2024-05-03 12:02:15 +08:00
辉鸭蛋 31db69b20b fix: the official name 阿蕾奇诺 not supported 2024-05-03 12:01:45 +08:00
辉鸭蛋 8acf23e9ce refactor: quick tp & add: ra.ocr 2024-05-03 12:00:34 +08:00
辉鸭蛋 191786962a Merge branch 'main' into feat/resolution 2024-05-03 00:37:03 +08:00
辉鸭蛋 cf8ab82043 0.28.0 2024-05-03 00:17:02 +08:00
辉鸭蛋 a553dc2402 edit text 2024-05-03 00:16:34 +08:00
辉鸭蛋 8bf6a39177 hide test functions 2024-05-02 22:47:26 +08:00
辉鸭蛋 06f77a2d5f delete useless variables 2024-05-02 22:40:49 +08:00
辉鸭蛋 7dadf9b9f9 auto restart when switching capture mode 2024-05-02 22:39:26 +08:00
辉鸭蛋 25ed398524 refactor: submit goods 2024-05-02 21:47:39 +08:00
辉鸭蛋 912d86ac33 refactor: auto hangout 2024-05-02 21:05:10 +08:00
辉鸭蛋 4fa718c6e0 refactor: auto skip 2024-05-02 19:06:10 +08:00
辉鸭蛋 c2d3e132e8 refactor: RectArea -> Region compilation passed 2024-05-02 14:45:07 +08:00
辉鸭蛋 f0bfdde4b8 初始化新的坐标系工具类 2024-05-02 12:16:36 +08:00
辉鸭蛋 10d09afb98 add pick blacklist item 2024-05-01 12:58:09 +08:00
辉鸭蛋 6761b7d72f add 4.6 avatar 2024-05-01 12:37:05 +08:00
辉鸭蛋 239ab3384c 4.6 map puzzle 2024-04-30 22:33:56 +08:00
辉鸭蛋 e8a781f040 edit click param 2024-04-29 22:57:27 +08:00
辉鸭蛋 b60784b8df execute macro even if not successfully recognized 2024-04-28 00:14:43 +08:00
辉鸭蛋 18c1e9f978 automatically restart the dispatcher when the game window size changes 2024-04-28 00:01:04 +08:00
辉鸭蛋 45b5653b13 fix hangout bug 2024-04-27 16:45:56 +08:00
辉鸭蛋 c561da1892 narrowing down the recognition range of auto skip #354 2024-04-27 16:17:50 +08:00
辉鸭蛋 4e7da7156e reduce the frequency of black screen clicks 2024-04-27 16:06:22 +08:00
辉鸭蛋 e7e238e099 add hangout branches 2024-04-27 15:46:45 +08:00
辉鸭蛋 59b5656719 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-04-27 11:50:56 +08:00
辉鸭蛋 fe03913020 add 4.5、4.6 avatar 2024-04-27 11:48:48 +08:00
辉鸭蛋 a45b34378c Merge pull request #363 from haokaiyang/main 2024-04-24 11:46:44 +08:00
郝凯阳 c27150d4d3 Merge branch 'babalae:main' into main 2024-04-24 10:55:40 +08:00
haokaiyang e0ea024631 auto tcg: update character card config to v4.6 2024-04-24 10:52:46 +08:00
辉鸭蛋 7dda27c59b benchmark for #358 2024-04-23 00:45:17 +08:00
辉鸭蛋 8513d31f13 Merge pull request #358 from babalae/span-copy 2024-04-22 23:34:52 +08:00
辉鸭蛋 6dc81e181c fix AutoHangoutEventEnabled switch log display #360 2024-04-22 22:17:50 +08:00
DismissedLight df01527d98 Update KeyPointFeatureBlockHelper.cs 2024-04-22 10:43:13 +08:00
Lightczx fcdf1c4873 Update KeyPointFeatureBlockHelper.cs 2024-04-22 10:41:17 +08:00
辉鸭蛋 116a4c8790 init way record 2024-04-21 23:03:40 +08:00
辉鸭蛋 f64e2f37c9 add feature matcher 2024-04-21 17:18:03 +08:00
辉鸭蛋 25e640bff1 block based feature matching 2024-04-21 13:49:25 +08:00
辉鸭蛋 d917720c9e delete boundary overflow judgment 2024-04-20 17:13:09 +08:00
辉鸭蛋 7756c3af9c reload macro when edited 2024-04-20 15:49:00 +08:00
辉鸭蛋 643a5b0262 fix json editor save 2024-04-20 14:56:56 +08:00
辉鸭蛋 4354ca5900 0.27.0 2024-04-20 12:34:06 +08:00
辉鸭蛋 27ff3e649b quick click genshin online yes or no button #170 2024-04-20 12:24:15 +08:00
辉鸭蛋 e151229eff auto skip: add no click option #350 2024-04-20 11:43:27 +08:00
辉鸭蛋 f10694a476 code style 2024-04-20 00:25:15 +08:00
辉鸭蛋 a458b86fab one key fight 2024-04-20 00:14:27 +08:00
Lightczx 820cd8949d refactor singleton 2024-04-19 17:05:22 +08:00
辉鸭蛋 a983ed45ce Merge pull request #351 from babalae/feat/optimization 2024-04-19 16:31:03 +08:00
辉鸭蛋 f2908509a4 edit tips 2024-04-17 22:49:54 +08:00
辉鸭蛋 dc389f95b9 edit UI 2024-04-17 22:46:13 +08:00
辉鸭蛋 19c441b8c6 finish one click fight macro 2024-04-16 01:02:42 +08:00
辉鸭蛋 a0f94babe8 init one key fight task 2024-04-14 21:54:43 +08:00
辉鸭蛋 f1ac26155a auto select strategy based on team avatars 2024-04-14 01:31:59 +08:00
辉鸭蛋 df2926fe95 auto skip: add hold keyword #350
thanks @snouker
2024-04-13 19:26:01 +08:00
辉鸭蛋 cbca6cfcfe don't interrupt when recognition fails 2024-04-13 19:03:33 +08:00
辉鸭蛋 aa0fedf808 new avatar rec in auto fight 2024-04-13 18:46:18 +08:00
辉鸭蛋 f8f4332abd surf opt 2024-04-13 16:35:54 +08:00
辉鸭蛋 ad606dd29c finsh gen avatar datasets 2024-04-13 16:31:44 +08:00
辉鸭蛋 55aa735c3b avatar classify dataset 2024-04-13 14:26:27 +08:00
Lightczx 4819849902 code style 2024-04-12 10:38:50 +08:00
辉鸭蛋 b8f812c551 auto track opt 2024-04-08 23:23:37 +08:00
辉鸭蛋 1060b819ff draw map teleport point 2024-04-07 22:05:36 +08:00
辉鸭蛋 c3ea13715a add black cancel btn #170 2024-04-06 18:43:12 +08:00
辉鸭蛋 d070f45a0a more match template support 2024-04-06 18:42:23 +08:00
辉鸭蛋 d0405d0800 quick click genshin confirm or cancel button #170 2024-04-06 13:11:24 +08:00
辉鸭蛋 36dcbebdfa add GPU title flag 2024-04-06 12:00:14 +08:00
辉鸭蛋 ed63a68ee5 add switch inference device UI 2024-04-06 11:57:19 +08:00
辉鸭蛋 f14d4a4d10 Merge branch 'main' into feat-gpu 2024-04-06 11:25:04 +08:00
辉鸭蛋 edbc860a3d fix Release error 2024-04-06 11:24:41 +08:00
辉鸭蛋 d69242f7c2 edit onnx version 2024-04-06 11:23:14 +08:00
辉鸭蛋 034d695bf8 all use gpu 2024-04-06 02:43:43 +08:00
辉鸭蛋 4b41fdcecc test gpu 2024-04-06 00:26:55 +08:00
辉鸭蛋 0453355b8a optimize multiple item submissions 2024-04-05 22:16:37 +08:00
辉鸭蛋 e408750d09 auto track mission 2024-04-05 19:54:37 +08:00
辉鸭蛋 8affeff26f optimization 2024-04-04 22:35:36 +08:00
辉鸭蛋 3b6d5f936f resolve conflicts 2024-04-04 20:40:15 +08:00
辉鸭蛋 9c5bc866f8 resolve conflicts 2024-04-04 20:40:04 +08:00
辉鸭蛋 e744aba880 add more recognition capabilities for RectArea 2024-04-04 20:35:42 +08:00
辉鸭蛋 962d00e90d Merge pull request #343 from babalae/feat-asset-singleton 2024-04-04 14:48:26 +08:00
辉鸭蛋 94a049e066 fix compilation error 2024-04-04 14:48:01 +08:00
辉鸭蛋 bdc99e9e06 all assets to singleton 2024-04-04 14:38:04 +08:00
辉鸭蛋 f41cbcdab4 pick assets 2024-04-04 14:10:15 +08:00
辉鸭蛋 7300d32756 simplify View&ViewModel Registration 2024-04-04 13:27:51 +08:00
辉鸭蛋 531ca76cfd Merge pull request #334 from babalae/feat/view-registraion 2024-04-04 13:25:00 +08:00
辉鸭蛋 3df5904d2c Merge branch 'main' into feat/view-registraion 2024-04-04 13:24:48 +08:00
辉鸭蛋 85b253036c Merge pull request #333 from Mr-Quin/notification 2024-04-04 13:18:42 +08:00
辉鸭蛋 2b455ad2fc add universal singleton 2024-04-04 12:15:52 +08:00
辉鸭蛋 5187001b31 unified template matching threshold 2024-04-03 22:47:30 +08:00
辉鸭蛋 314d5b6e9e Merge branch 'pr/342' 2024-04-02 22:25:56 +08:00
辉鸭蛋 f87500245d Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-04-02 22:25:10 +08:00
辉鸭蛋 45f2b9b459 Merge pull request #342 from Mr-Quin/quick-serenitea-pot 2024-04-02 22:22:49 +08:00
辉鸭蛋 09e23cab57 Update QuickSereniteaPotTask.cs
add delay
2024-04-02 22:20:25 +08:00
辉鸭蛋 24713a47e1 mini map test 2024-04-02 22:03:53 +08:00
Mr-Quin a890fa1aca Change label wording 2024-04-01 08:53:55 -07:00
Mr-Quin 32a6507027 Add hotkey to enter Serenitea Pot 2024-04-01 08:37:14 -07:00
Mr-Quin 3f471c68da Fix code style issues 2024-03-31 23:14:24 -07:00
ema 3d4ae6cb06 changed hide button CornerRadius to default 0 2024-04-01 06:59:29 +08:00
辉鸭蛋 0bfaa0daf2 edit assets path 2024-03-31 15:02:40 +08:00
辉鸭蛋 a9ff321daf big map surf test 2024-03-31 14:49:03 +08:00
Mr-Quin 97f2dc4550 Small refactor to NotificationHelper 2024-03-30 15:23:53 -07:00
Mr-Quin 63bec641af Simplify notification creation 2024-03-30 13:57:03 -07:00
Mr-Quin 04ce508efd Slightly simplify call to NotifyAllNotifiersAsync 2024-03-30 13:57:03 -07:00
Mr-Quin 7e5b7eb1d4 Improve error handling 2024-03-30 13:57:03 -07:00
Mr-Quin 4f9424ff3d Register NotificationService as HostedService so it instantiates early 2024-03-30 13:57:03 -07:00
Mr-Quin 8c025feaba Remove taskParams fom serialization 2024-03-30 13:57:03 -07:00
Mr-Quin 083766320d Add error handling to NotifierManager 2024-03-30 13:57:03 -07:00
Mr-Quin a11d31bd62 Update Notification model 2024-03-30 13:57:03 -07:00
Mr-Quin 7781ca1271 Fix ImageConverter 2024-03-30 13:57:03 -07:00
Mr-Quin 4864d32f8c Add screenshot property to TaskNotificationData 2024-03-30 13:57:03 -07:00
Mr-Quin 911ee49083 Refactor notification 2024-03-30 13:57:02 -07:00
Mr-Quin 4755213ccc Fix notification page layout 2024-03-30 13:57:02 -07:00
Mr-Quin e62516c9ce Add notification to task 2024-03-30 13:57:02 -07:00
Mr-Quin 3973a132b4 Add notification 2024-03-30 13:57:02 -07:00
辉鸭蛋 992e1ac3eb key point map test & refactor test window 2024-03-30 22:38:10 +08:00
辉鸭蛋 94da864852 Merge pull request #338 from Mr-Quin/retry-to-new-retry 2024-03-30 11:32:10 +08:00
Mr-Quin 675d3cdb50 Change all references of Retry to NewRetry 2024-03-29 20:26:22 -07:00
辉鸭蛋 417dafa456 auto submit goods support multiple (have some problems) 2024-03-28 23:53:06 +08:00
Lightczx 1c97b425f4 refine 2024-03-28 14:00:29 +08:00
辉鸭蛋 fdd48f4f62 Update README.md 2024-03-27 18:50:21 +08:00
辉鸭蛋 282b7358a0 Merge pull request #327 from Mr-Quin/exit-to-tray 2024-03-27 00:31:46 +08:00
辉鸭蛋 2a7f5265a3 Merge pull request #328 from Mr-Quin/activate 2024-03-26 16:47:42 +08:00
Mr-Quin 43766c6d93 Bring window to foreground on startup 2024-03-25 22:53:51 -07:00
Mr-Quin 087956b161 Add option to minimize to tray when existing 2024-03-25 22:45:12 -07:00
辉鸭蛋 fa9157880f edit display text 2024-03-25 23:05:39 +08:00
辉鸭蛋 c1fce8a3eb Merge pull request #322 from Mr-Quin/status 2024-03-25 22:57:32 +08:00
辉鸭蛋 19e37a35bc city map test 2024-03-25 22:51:54 +08:00
辉鸭蛋 3385692de3 fixed #323 2024-03-25 22:51:16 +08:00
Mr-Quin 30ec2a55ad Add status display in mask window 2024-03-24 11:22:05 -07:00
辉鸭蛋 2448b5b6b0 map match test param opt 2024-03-23 23:55:53 +08:00
辉鸭蛋 f6e2694204 map match test & add map viewer 2024-03-23 20:31:38 +08:00
辉鸭蛋 a36c283784 fix genshin start WorkingDirectory 2024-03-22 22:58:02 +08:00
辉鸭蛋 741deafd3f new map combine 2024-03-22 00:34:23 +08:00
辉鸭蛋 39e552d9fe update Yap model 4.5 2024-03-21 23:28:31 +08:00
辉鸭蛋 919d4c5083 add map puzzle 2024-03-19 02:10:01 +08:00
辉鸭蛋 1d645b1565 catch exception get game path 2024-03-17 21:55:15 +08:00
辉鸭蛋 0d6ad22a22 fix Monitor.Exit() throw exception when use "async" worker functions 2024-03-17 00:15:26 +08:00
辉鸭蛋 29e679d1fd GC for #311 2024-03-16 21:13:59 +08:00
辉鸭蛋 037d4dadff add lock for independent task 2024-03-16 15:20:01 +08:00
辉鸭蛋 62492b3f95 auto hangout hotkey 2024-03-16 14:45:44 +08:00
辉鸭蛋 11c13c6fdd some opt 2024-03-14 23:24:30 +08:00
辉鸭蛋 6ba56fe6e2 add using keyword #311 2024-03-14 00:32:43 +08:00
辉鸭蛋 eb0a886784 replace message box #245 2024-03-14 00:09:02 +08:00
辉鸭蛋 016c94e06c rename editor #245 2024-03-13 23:41:52 +08:00
辉鸭蛋 8a450d9edd single simple JSON editor #245 2024-03-13 23:35:30 +08:00
辉鸭蛋 bb0ea6622b move namespace 2024-03-13 23:11:31 +08:00
郝凯阳 ede7751ebf auto tcg: update character card config to v4.5 (#310) 2024-03-13 11:30:47 +08:00
haokaiyang 7b721ee13c auto tcg: update character card config to v4.5 2024-03-13 10:37:40 +08:00
辉鸭蛋 c9851552e4 update logo (#309) 2024-03-13 00:53:06 +08:00
辉鸭蛋 e74422a219 new README.md (#306) 2024-03-12 13:52:53 +08:00
ema 77496332bf update: edit auto pick black/white list files #245 2024-03-12 04:16:49 +08:00
辉鸭蛋 c7df940f13 Update README.md 2024-03-11 22:39:52 +08:00
辉鸭蛋 ecaa8c15fb attempting to upgrade dependencies 2024-03-10 20:00:06 +08:00
辉鸭蛋 3b4c993aab auto skip hangout: remove all enter 2024-03-10 14:16:20 +08:00
辉鸭蛋 b98097e8e6 auto skip hangout ui 2024-03-10 13:48:00 +08:00
辉鸭蛋 22ea2c2576 clean up code by ReSharper and CodeMaid [\Core] 2024-03-10 12:55:11 +08:00
ema 5b1fe0e2d0 update: formatter 2024-03-10 03:03:14 +08:00
ema ce89e41b60 fix: process can't be exited by X button
#298
2024-03-10 02:58:30 +08:00
ema 24c4a021cb restruct: add mvvm with NotifyIcon 2024-03-10 02:40:40 +08:00
辉鸭蛋 8415daa740 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-03-10 00:50:00 +08:00
辉鸭蛋 ffac1859dc add auto skip hangout 2024-03-10 00:49:53 +08:00
ema ca418ba7b1 fix: change logo.ico file to inner resource 2024-03-10 00:48:45 +08:00
ema a1475732af Merge pull request #298 from Mr-Quin/notifyicon
添加最小化到托盘的按钮
2024-03-10 00:40:53 +08:00
辉鸭蛋 006c7a71cc 0.26.0 2024-03-09 16:36:05 +08:00
辉鸭蛋 5df1eac561 opencv mask test 2024-03-09 16:20:44 +08:00
Mr-Quin 8f7cd481f2 Implement NotifyIcon using WPF-UI.Tray 2024-03-08 12:08:15 -08:00
Mr-Quin c664eca7da Add button to send app to tray 2024-03-07 20:15:09 -08:00
qhy040404 4554769f38 real time mask settings 2024-03-07 23:36:19 +08:00
辉鸭蛋 3133478fca fix mask window config 2024-03-07 22:47:24 +08:00
辉鸭蛋 89b85e0bfd Merge pull request #295 from Mr-Quin/temp 2024-03-07 21:33:54 +08:00
Mr-Quin 961e73880b Change method to private 2024-03-07 00:24:35 -08:00
辉鸭蛋 920ea6333b Merge pull request #297 from qhy040404/feat/converter 2024-03-07 16:14:29 +08:00
qhy040404 fb8ee063bc Use converter to optimize binding
impl #296
2024-03-07 14:59:17 +08:00
Mr-Quin 60117666a7 Change object type to string 2024-03-06 19:51:47 -08:00
Mr-Quin fd47761f7f Fix event handler missed #294 2024-03-06 18:27:48 -08:00
辉鸭蛋 7d69c2ca7f Merge pull request #294 from Mr-Quin/load-dropdown 2024-03-07 10:15:03 +08:00
辉鸭蛋 007efdbf1a Merge pull request #293 from Mr-Quin/path 2024-03-07 10:11:32 +08:00
Mr-Quin 31d7e4c94b Load strategy files when dropdown opens 2024-03-06 13:08:32 -08:00
Mr-Quin 7590f6a273 Normalize detected game executable path 2024-03-06 13:06:50 -08:00
辉鸭蛋 ccadc11b2b Merge pull request #292 from Mr-Quin/Impl2 2024-03-06 22:15:06 +08:00
辉鸭蛋 c150e6a280 code simplify & consider the scenario of WGC 2024-03-06 22:12:58 +08:00
huiyadanli 4e92f7f2c6 auto domain: opt 2024-03-06 21:20:17 +08:00
Mr-Quin c0f34b6c87 Stop task when game exits and update UI 2024-03-06 00:16:02 -08:00
huiyadanli 6b4de6da19 auto enter game: use postmessage instead of sendinput 2024-03-04 22:49:03 +08:00
辉鸭蛋 b63f95b9c0 Merge pull request #288 from qiuyue0/main 2024-03-04 21:35:16 +08:00
秋月 7fcfdbd3bf fix 修复特定情况下关闭自动钓鱼程序未停止的错误
现在特定情况下关闭自动钓鱼后不会继续寻找鱼饵落点
2024-03-04 00:33:21 +08:00
秋月 6f8cfbee4f fix 修复关闭自动钓鱼后意外输出的日志
关闭自动钓鱼后停止输出相关日志
2024-03-04 00:31:13 +08:00
辉鸭蛋 fd79acaee6 Merge pull request #287 from babalae/feat-hutao-fisher 2024-03-03 18:16:33 +08:00
huiyadanli fecc95230f using a new model & new Pole Throwing Algorithm 2024-03-03 18:11:18 +08:00
huiyadanli cc181ebd16 fix: macro ui 2024-03-02 23:25:03 +08:00
huiyadanli 9c1c283576 add more auto fight strategy 2024-03-02 20:14:31 +08:00
huiyadanli 373b2fe61c feat: adjustable parameters 2024-03-01 19:55:16 +08:00
ema da353a9472 update: version comparison method 2024-02-29 17:33:16 +08:00
ema c5f81dd447 restruct: Retry methods 2024-02-29 10:29:29 +08:00
huiyadanli 591007eff6 fix: no longer display warnings that appear when minimizing and restoring #145 2024-02-27 22:41:58 +08:00
辉鸭蛋 ef8f51d8e1 Update README.md 2024-02-27 21:03:27 +08:00
huiyadanli cc37788495 auto enter game: timely close trigger 2024-02-26 20:45:42 +08:00
huiyadanli 9c29156584 add auto enter game trigger 2024-02-25 20:55:32 +08:00
huiyadanli ca00c3dfd7 update auto fish model 2024-02-25 18:15:34 +08:00
huiyadanli dd4d8ae2c2 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-02-23 23:07:18 +08:00
huiyadanli f9e9be6d9d add WindowsGraphicsCapture cache option 2024-02-23 22:55:31 +08:00
huiyadanli fbc5a3ced9 auto skip: update log output logic 2024-02-23 22:06:16 +08:00
ema cb395deef9 clean Fischless.WindowsInput codes 2024-02-19 12:15:56 +08:00
huiyadanli 36aa0270f6 fix: filter empty ocr result in auto skip #261 2024-02-17 23:17:48 +08:00
huiyadanli e3546e9b80 add RunaroundMouseXInterval 2024-02-16 14:32:05 +08:00
huiyadanli bd366503cf auto fish: support Sumeru and Fontaine fish 2024-02-14 19:07:17 +08:00
huiyadanli 9d6d621b75 revert wgc 2024-02-14 15:46:48 +08:00
huiyadanli eac6957185 hokey active when game active 2 2024-02-12 21:35:08 +08:00
huiyadanli 0ec20aa86c hokey active when game active 2024-02-12 21:31:28 +08:00
huiyadanli be291d4093 auto skip: black screen click threshold 2024-02-11 22:46:10 +08:00
huiyadanli 0b2541ac3a version 0.24.1 2024-02-10 22:36:27 +08:00
huiyadanli fe9b028bb2 monitor mode: combination keys not supported 2024-02-10 22:34:56 +08:00
huiyadanli aa9f1cb8d9 fix: switch hotKey type not unregister all hotkey #260 2024-02-10 18:23:19 +08:00
huiyadanli 06a46533d0 version 0.24 2024-02-10 15:39:19 +08:00
huiyadanli 9cc647196c add submit one goods in auto skip 2024-02-10 15:16:02 +08:00
huiyadanli b9ea59cc04 fix new auto skip 2024-02-10 00:21:35 +08:00
huiyadanli cb52ddc78b new auto skip 2024-02-09 23:27:49 +08:00
huiyadanli aedcb3dde5 optimize 2024-02-09 13:05:14 +08:00
huiyadanli 7660e58452 add require administartor tips #255 2024-02-09 11:41:17 +08:00
huiyadanli 2d6b399a07 more user-friendly parsing of error messages 2024-02-08 19:56:10 +08:00
huiyadanli a2255f8250 add quick tp hotkey #127 2024-02-08 18:59:57 +08:00
huiyadanli 15a4dbd624 add black list #175 2024-02-08 15:57:36 +08:00
huiyadanli 3fc3935519 add start param #152 2024-02-08 15:44:50 +08:00
huiyadanli 1c345eae16 add take screenshot 2024-02-08 14:47:26 +08:00
huiyadanli c1018bf3fd add manually pick window hwnd 2024-02-07 22:29:20 +08:00
huiyadanli d67e5e5635 optimize Windows.Graphics.Capture 2024-02-07 22:10:43 +08:00
huiyadanli 16a256dbe0 more accurate auto tp & slower judgment time 2024-02-06 21:18:33 +08:00
huiyadanli ad6d70f75e delete default hotkey 2024-02-06 18:56:47 +08:00
huiyadanli 6bb49eb243 optimizations 2024-02-06 18:25:51 +08:00
huiyadanli a9a02c7e9c update avatar json to 4.4 2024-02-06 13:58:11 +08:00
huiyadanli 92c30bec11 update Yap to 4.4 2024-02-06 13:54:09 +08:00
huiyadanli 8e700d271e Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-02-06 13:23:45 +08:00
huiyadanli a4d4aef130 support key mouse monitor hotkey 2024-02-06 13:23:36 +08:00
huiyadanli 78364c5fa7 more stringent fishing box rectangle 2024-02-05 23:54:13 +08:00
辉鸭蛋 3628bd1904 Update README.md 2024-02-04 14:24:45 +08:00
huiyadanli 54ee6e2ad1 add keyboard monitor hotkey 2024-02-03 23:04:14 +08:00
huiyadanli 7ac890e43f view model for #245 @Lightczx 2024-02-03 14:00:55 +08:00
huiyadanli 82ce255617 add YOLOv8 qq group 2024-02-03 12:34:49 +08:00
辉鸭蛋 4dc286c8e9 Merge pull request #249 from haokaiyang/main
auto tcg: update character card config to v4.4
2024-01-31 17:53:40 +08:00
haokaiyang 9162e5970c auto tcg: update character card config to v4.4 2024-01-31 16:23:37 +08:00
辉鸭蛋 2f96f7b312 Merge pull request #248 from Womsxd/main
fix 惊喜牌组 order
2024-01-31 14:11:22 +08:00
Womsxd 0846949823 fix 惊喜牌组 order 2024-01-31 11:11:37 +08:00
huiyadanli 9bab2a0c0c auto domain: add walk option 2024-01-28 15:39:02 +08:00
辉鸭蛋 afdb8e488d Merge pull request #244 from Womsxd/main
加入新的惊喜牌组
2024-01-27 18:06:16 +08:00
Womsxd 387711c413 Add new 惊喜牌组 2024-01-27 13:24:46 +08:00
huiyadanli ae4eb6a7f4 fix inoperative short move & add auto domain config 2024-01-24 23:40:04 +08:00
huiyadanli c714c73975 auto domain: handling situations where items are full 2024-01-24 22:24:27 +08:00
huiyadanli 2789b2edb2 quick teleport: more precise 2024-01-22 23:18:57 +08:00
huiyadanli c32508f0a9 extend waiting time 2024-01-22 22:57:15 +08:00
huiyadanli 215bd3e81f version 0.23 2024-01-21 23:00:41 +08:00
huiyadanli 149f964350 auto tcg: edit log skill name #217 2024-01-21 21:56:56 +08:00
huiyadanli 85f87b02aa auto tcg: default character card config #217 2024-01-21 21:39:11 +08:00
huiyadanli 47eb6ae392 print dpi scale 2024-01-20 19:27:13 +08:00
huiyadanli 4f578e293b 自动领取『每日委托』奖励后关闭奖励结果界面 #230 2024-01-20 19:16:22 +08:00
huiyadanli 954dc1968d use condensed resin double click #224 2024-01-17 23:47:05 +08:00
huiyadanli 1a04986d6e extend close popup page judgment time #223 2024-01-17 23:42:19 +08:00
huiyadanli 288c2856ca fix: auto get daily rewards not work #225 2024-01-17 23:31:33 +08:00
huiyadanli ee2f9f9368 fix: avatar switch bug #213 2024-01-17 00:48:23 +08:00
huiyadanli 511051eae6 fix: enter domain keydown F -> keypress F 2024-01-16 23:54:08 +08:00
huiyadanli 61e72330c6 auto fight: continuous operations will no longer be cancelled 2024-01-15 22:52:07 +08:00
huiyadanli b0d2be2808 auto domain: extend the time to obtain rewards 2024-01-15 22:12:54 +08:00
huiyadanli 6130852d4b version 0.22 2024-01-15 21:50:57 +08:00
huiyadanli d888a5f119 fix some script bug 2024-01-14 22:21:36 +08:00
huiyadanli 4b5b8f9b88 more combat script 2024-01-14 21:30:54 +08:00
huiyadanli 9a0fa23451 add alias support 2024-01-14 00:08:59 +08:00
huiyadanli d2dc2afcf5 add avatar alias 2024-01-14 00:05:25 +08:00
huiyadanli 374de87833 fix: OCR cannot accurately recognize "纳西妲" 2024-01-13 23:13:12 +08:00
huiyadanli 6977b07fad extend retry count and time when taking screenshots #207 2024-01-13 22:57:16 +08:00
huiyadanli 7883cc2d29 auto genius invokation: optimize dice count OCR & dice recognition is sorted by character element priority #165 2024-01-13 22:49:14 +08:00
huiyadanli 179d64dc64 auto domain when configuring rounds, do not recognize resin num 2024-01-13 21:07:28 +08:00
huiyadanli 5e5fcb4b82 optimize the success rate of condensed resin OCR 2024-01-13 21:00:43 +08:00
huiyadanli da87ee0b71 revert auto skip daily reward press esc 2024-01-13 17:20:30 +08:00
huiyadanli 3f1da9e995 optimize domain end recognition 2024-01-13 16:49:16 +08:00
huiyadanli 954fea6bbe optimize domain tree pathfinding #203 2024-01-13 16:24:13 +08:00
huiyadanli 02c6436a8b fix: combat script parse #203 2024-01-11 23:15:51 +08:00
huiyadanli 69fb7f95af fix drawable content not clear 2024-01-11 22:19:33 +08:00
huiyadanli 0d9cf01800 fix auto fight bug when all triggers close #203 2024-01-11 21:56:32 +08:00
huiyadanli d8935138fa revert e q 2024-01-10 22:49:19 +08:00
huiyadanli 1bf156449e new auto fight strategy 2024-01-10 22:44:54 +08:00
辉鸭蛋 4fdd4e90b8 Update question.md 2024-01-10 22:22:53 +08:00
ema 0921ceff85 add ISSUE_TEMPLATE 2024-01-10 12:03:23 +08:00
huiyadanli b7aaeed3d3 edit auto fight strategy (delete q) 2024-01-09 23:47:17 +08:00
huiyadanli 2f29ab7fae using debug log level to print StackTrace 2024-01-09 23:42:00 +08:00
huiyadanli c0171f7874 the log level for writing files is different (debug) 2024-01-09 23:30:28 +08:00
huiyadanli f709c4e019 task delay 2024-01-09 23:21:35 +08:00
huiyadanli 5ba5687178 auto domain add fight end delay 2024-01-09 23:21:19 +08:00
辉鸭蛋 df1191e348 Update README.md 2024-01-07 22:55:25 +08:00
huiyadanli cc8115710f fix log & use resin with retry 2024-01-07 22:36:29 +08:00
辉鸭蛋 96529e8cae Update README.md 2024-01-07 22:34:32 +08:00
辉鸭蛋 3f66de47b7 Update README.md 2024-01-07 20:25:05 +08:00
huiyadanli ed1fe39360 fix 惊喜牌组 order 2024-01-07 20:02:17 +08:00
huiyadanli f4ac8da670 add auto fight hotkey 2024-01-07 16:48:04 +08:00
huiyadanli 87df7297e1 support Neuvillette charge and more command 2024-01-07 16:46:16 +08:00
huiyadanli 92a084cde8 support Nahida long e 2024-01-07 15:56:06 +08:00
huiyadanli 819587d2bd mandatory assignment of team avatars 2024-01-07 14:56:58 +08:00
huiyadanli 7a50f8b994 fix wanderer recognition 2024-01-07 13:12:15 +08:00
huiyadanli 64bee42794 add auto fight task 2024-01-07 11:18:15 +08:00
huiyadanli f992b87acb add combat strategy ui and test it 2024-01-06 23:44:13 +08:00
huiyadanli 66cd73dbf3 universal combat strategy 2024-01-06 22:59:23 +08:00
huiyadanli b5a4806c64 add resin recognition and defeated recognition 2024-01-06 16:20:08 +08:00
huiyadanli 2ea4139a9f fix avatar avtive status detection 2024-01-06 14:58:51 +08:00
huiyadanli aebe605130 optimize auto fishing 2024-01-06 10:53:41 +08:00
huiyadanli d09f6dfee5 press esc after get daily reward 2024-01-05 21:08:58 +08:00
huiyadanli 4b41c2fb86 adjustable parameters 2024-01-04 23:36:25 +08:00
huiyadanli 433475d6c0 circulate domain 2024-01-02 23:40:13 +08:00
huiyadanli 279f7eb3b5 add enter domain 2024-01-01 22:22:46 +08:00
辉鸭蛋 8bfa560a0f Update README.md 2024-01-01 17:43:02 +08:00
辉鸭蛋 fe34e0f4d4 Merge pull request #192 from babalae/autoDomain
first version for auto domain
2024-01-01 16:03:50 +08:00
huiyadanli be08871440 go to domain tree 2024-01-01 15:06:16 +08:00
huiyadanli 2362b01742 init minimap 2024-01-01 00:15:11 +08:00
huiyadanli 922118a3a1 optimize "播放中" ocr result 2023-12-31 19:40:19 +08:00
huiyadanli 3f76d8dbc9 optimization task termination and team identification 2023-12-31 19:06:31 +08:00
辉鸭蛋 475d127ae5 Merge pull request #191 from babalae/autoDomain
auto fight
2023-12-31 17:40:36 +08:00
huiyadanli 1c4c884096 finsh auto combat 2023-12-31 17:39:42 +08:00
huiyadanli e1a66099ad use e, q and cd 2023-12-31 14:52:45 +08:00
huiyadanli e2360ca2bd switch avatar 2023-12-31 14:37:44 +08:00
huiyadanli 427ed0045f team identification 2023-12-30 13:53:07 +08:00
huiyadanli 0c52e3b85b init team avatars 2023-12-30 00:11:59 +08:00
huiyadanli d0321e9d73 add only capture mode 2023-12-28 23:18:36 +08:00
huiyadanli 7965dd15e5 walk to start domain 2023-12-27 00:05:33 +08:00
huiyadanli 877c16c605 Merge branch 'main' into autoDomain 2023-12-26 21:54:13 +08:00
huiyadanli 185e897e4f optimize expedition task 2023-12-26 21:53:12 +08:00
huiyadanli 02480ed060 fix LinkedStartEnabled not working 2023-12-26 21:33:45 +08:00
huiyadanli 76989a6487 update ui text 2023-12-26 21:31:19 +08:00
huiyadanli cddf66bd95 revert quick enhance artifact 2023-12-26 21:27:40 +08:00
huiyadanli f06bddffef init auto domain 2023-12-26 21:04:44 +08:00
huiyadanli da40679559 last felling don't exit game 2023-12-24 19:57:50 +08:00
huiyadanli c6d28874df auto genius invokation: dice OCR determination 2->4 2023-12-24 19:51:33 +08:00
huiyadanli 167c9f6973 0.20.0 2023-12-24 15:59:43 +08:00
辉鸭蛋 67d1c610b3 Merge pull request #182 from babalae/autoDomain
auto fight init
2023-12-24 15:52:16 +08:00
huiyadanli 18b0b03bc8 auto fight init 2023-12-24 15:51:27 +08:00
huiyadanli d38b1f6648 update Yap model to 4.3 2023-12-24 13:10:42 +08:00
huiyadanli 6a7eab49ed new auto expedition task 2023-12-23 18:30:55 +08:00
huiyadanli 0885faf8b8 remove quick enhance artifact 2023-12-23 17:50:51 +08:00
huiyadanli 8a940ae644 team identification test 2023-12-22 22:53:45 +08:00
huiyadanli 13e6d1651a finsh CameraOrientationTest 2023-12-20 00:46:10 +08:00
ema dff7d58873 NumEnter key support was added to the Fischless.WindowsInput 2023-12-19 00:03:20 +08:00
ema 5c557ae684 fix: hot key like binding name error
merge from Fischless.KeyboardCapture
2023-12-18 23:53:16 +08:00
ema c3b5829a2c use wScan got from User32.MapVirtualKey 2023-12-18 23:33:02 +08:00
huiyadanli 29f6351924 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-18 01:49:10 +08:00
huiyadanli ca51662b5c camera orientation test 2 2023-12-18 01:49:03 +08:00
辉鸭蛋 7465b5be7b Merge pull request #171 from babalae/ui-fix
fixup UI
2023-12-17 22:42:49 +08:00
DismissedLight 340952d074 fixup UI 2023-12-17 20:10:16 +08:00
ema efd6d1ea41 initial script control but debug only 2023-12-17 17:36:36 +08:00
ema ddfca0340e resolve the consolidate with setup 2023-12-17 15:47:17 +08:00
ema 3b9bd5d267 use IsRefreshExplorer for setup 2023-12-17 14:57:31 +08:00
huiyadanli 848fe90180 init camera orientation test 2023-12-16 23:45:24 +08:00
huiyadanli 978cd45fd8 finsh character orientation test 2023-12-14 01:20:35 +08:00
huiyadanli 24fe650ac9 revert find genshin handle #157 & delay after obtaining handle when BetterGI start genshin #153 2023-12-13 19:58:02 +08:00
huiyadanli 57fd22c4cd Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-13 12:10:31 +08:00
辉鸭蛋 553055ddfb Merge pull request #160 from goldenapple1/main
修改引号
2023-12-13 12:08:08 +08:00
huiyadanli a3dcda8261 QuickTeleport: The OCR result is a single character not clicked 2023-12-13 11:33:40 +08:00
_9EE199 0aaf13294b 修改引号 2023-12-12 22:33:05 -05:00
辉鸭蛋 4814c42f6c Merge pull request #159 from goldenapple1/main
增加针对NPC的错误OCR词语的屏蔽
2023-12-13 10:52:56 +08:00
_9EE199 d0544c1f1e 增加针对NPC的错误OCR词语的屏蔽 2023-12-12 15:56:02 -05:00
huiyadanli 62edd9c73a genshin registry opt todo #150 2023-12-13 01:50:24 +08:00
huiyadanli 401e484f4e CharacterOrientationTest 2023-12-13 00:15:52 +08:00
huiyadanli e7542bde79 add orientation display settings 2023-12-13 00:15:26 +08:00
huiyadanli 3d20a4357d unrestricted the name of the genshin startup program #158 2023-12-13 00:04:58 +08:00
huiyadanli 6433cbf456 add orientation display on mask window - ui #156 2023-12-13 00:03:37 +08:00
huiyadanli febbf2d064 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-13 00:02:09 +08:00
huiyadanli b44fe7ec19 add orientation display on mask window #156 2023-12-13 00:01:57 +08:00
ema 033b87c267 support more server's settings registry 2023-12-12 11:42:11 +08:00
ema c9b890536f fix override controller settings for auto wood #98 2023-12-11 05:07:16 +08:00
ema d58745a6a7 new input simulator from Fischless.WindowsInput 2023-12-11 05:00:00 +08:00
huiyadanli 5ce8740f17 character orientation test 2023-12-11 02:27:39 +08:00
huiyadanli e77f8322fc 0.18.0 2023-12-10 15:28:16 +08:00
huiyadanli 71095d5724 new linked game start #126 #139 2023-12-10 15:22:38 +08:00
huiyadanli 4bf302b013 auto wood custom buttons #98 2023-12-10 13:51:52 +08:00
huiyadanli 399ad7eb89 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-10 13:28:27 +08:00
huiyadanli 703e27662c auto genius invokation optimize #136 2023-12-10 13:25:42 +08:00
ema 5da8c225c0 the methods of the override controller settings #98 2023-12-09 13:36:00 +08:00
huiyadanli 3b7acdcaf0 fix quick buy bug 2023-12-09 12:22:32 +08:00
huiyadanli a56f0c33c9 edit text 2023-12-09 12:10:26 +08:00
huiyadanli 0def54599b add quick buy #138 2023-12-09 12:05:47 +08:00
huiyadanli a911036868 SettingsContainer opt 2023-12-08 00:54:34 +08:00
huiyadanli bc9c0a2e33 fix black screen click 2023-12-08 00:50:52 +08:00
huiyadanli 01999c15fe print logs when registry read fails 2023-12-07 23:49:59 +08:00
huiyadanli 261abf3255 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-07 23:36:55 +08:00
辉鸭蛋 c890a200d2 Merge pull request #143 from babalae/RegistryFix
try fix Registry search issue
2023-12-07 23:35:54 +08:00
DismissedLight 981a6c4c05 try fix Registry search issue 2023-12-07 21:05:08 +08:00
huiyadanli b45bbf9030 auto genius invokation: retry multi when capture failed 2023-12-06 23:06:51 +08:00
huiyadanli cce7d1a9f0 add manual GC #131 2023-12-06 22:26:33 +08:00
huiyadanli 8d25e6dcad auto wood support #125 2023-12-06 00:28:39 +08:00
huiyadanli df1174fd9b restore start genshin code 2023-12-05 23:52:26 +08:00
huiyadanli fbf00105c1 throw inner exception #132 #48 2023-12-05 23:50:35 +08:00
huiyadanli 265425eaf2 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-05 22:42:45 +08:00
huiyadanli b9200695be fixed: #135 use FindWindow instead of MainWindowHandle 2023-12-05 22:42:13 +08:00
ema f3b1d3ee10 fix: setup don't creat auto run 2023-12-05 20:00:52 +08:00
huiyadanli 6d485dca94 auto genius invokation for keqing #130 2023-12-05 01:59:23 +08:00
ema b58be043f5 syntax: C# 12.0 2023-12-05 00:40:38 +08:00
ema d155c285c3 fix setup some lost files 2023-12-04 15:57:31 +08:00
ema dc68f63d86 one more try login for auto wood bilibili 2023-12-04 02:32:35 +08:00
ema a6891e29dc create a setup builder impl from MicaSetup 2023-12-04 02:29:01 +08:00
huiyadanli edc597a19a 0.17.1 2023-12-03 16:38:32 +08:00
huiyadanli 19ad1f3891 fix auto teleport with high error rates 2023-12-03 16:38:08 +08:00
huiyadanli 1c314f419e fix version compare 2023-12-03 15:27:20 +08:00
huiyadanli 94260d73b4 0.17.0 2023-12-03 14:34:36 +08:00
huiyadanli 0702dc5824 There are certain issues and the release has been postponed 2023-12-03 14:02:21 +08:00
huiyadanli 56473d79a4 detailed error logs switch 2023-12-03 13:44:31 +08:00
huiyadanli a989db29e7 quick teleport ui & performance optimization 2023-12-03 12:55:11 +08:00
huiyadanli 46fd989ba5 auto teleport optimize 2023-12-03 00:25:08 +08:00
huiyadanli d7963fb0c9 quick teleport init 2023-12-02 23:23:08 +08:00
huiyadanli d56bd20b13 add auto wood hotkey 2023-12-02 18:51:37 +08:00
huiyadanli 2e5b62cc8e auto skip add after choose option delay config 2023-12-02 18:49:01 +08:00
huiyadanli e2fddc436d auto wood z delay config 2023-12-02 18:35:00 +08:00
huiyadanli a2addefbbf package scripts 2023-12-02 14:49:00 +08:00
huiyadanli 3990ad9a77 copywriting optimization 2023-12-01 23:38:03 +08:00
辉鸭蛋 5cb04cb05b Merge pull request #116 from Mr-Quin/main
修复七圣召唤启动报错
2023-12-01 10:37:44 +08:00
Mr-Quin 32f1f6a694 Fix OpenCv file name error 2023-11-30 09:31:00 -08:00
huiyadanli 2a48054472 fix auto wood not work in other resolutions #113 2023-11-30 23:20:45 +08:00
huiyadanli e3fdbe8990 fixed: GetNewestInfoの呼び出しが再びクラッシュ #114 2023-11-30 22:56:43 +08:00
ema 35d6f514cb internal beta version 0.16.4 2023-11-30 22:48:02 +08:00
ema dc7cf8f036 enable detect auto wood Z item 2023-11-30 22:44:57 +08:00
ema a293e9c420 support auto wood when bilibili 2023-11-30 22:43:10 +08:00
ema c6a7ff060a wait launching Task.Delay instead of Thread.Sleep 2023-11-30 21:52:12 +08:00
huiyadanli 6ff9f57c50 special not pick 尚需生长时间 #103 2023-11-30 12:57:47 +08:00
ema 50922a2a0a confirm the default backdrop type
1. The acrylic not recommended as default.
2. Mica first than Tabbed.
2023-11-30 10:07:57 +08:00
huiyadanli e33a0da3fa update yap model 2023-11-30 02:03:03 +08:00
huiyadanli 32ca6fdbd0 fix git lfs & update yap model 2023-11-30 02:00:36 +08:00
辉鸭蛋 0402b4d620 Merge pull request #108 from babalae/fluent-design
Bring Fluent Design to Better GI
2023-11-30 01:55:43 +08:00
huiyadanli c53ecb413f revert wpfui style 2023-11-30 01:43:36 +08:00
DismissedLight 115436d871 main window & home page 2023-11-29 22:08:07 +08:00
辉鸭蛋 3a49e82bf7 Merge pull request #105 from wwbweibo/main
支持从注册表中读取安装目录
2023-11-29 10:32:16 +08:00
ema 2d1fe16a65 Revert "fix game launching stuck"
This reverts commit 12be380f44.
2023-11-29 10:21:08 +08:00
ema 12be380f44 fix game launching stuck 2023-11-29 00:53:01 +08:00
wangweibo f5ed61c78e Merge branch 'babalae:main' into main 2023-11-29 00:29:40 +08:00
wwbweibo dd3fe0670b 优先从配置文件中读取游戏可执行文件 2023-11-29 00:15:59 +08:00
huiyadanli e7d49a7b51 auto wood: replace judgment esc menu image 2023-11-29 00:04:42 +08:00
huiyadanli efccde8765 attempted multiple times when capture failed #90 2023-11-28 22:41:05 +08:00
辉鸭蛋 237bf7141a Merge pull request #97 from wwbweibo/main
添加本地安装路径配置,直接启动原神
2023-11-28 12:14:17 +08:00
wwbweibo e16f24ce2a 添加游戏加载完成界面触发器, 直接进入游戏 2023-11-27 22:19:53 +08:00
wwbweibo a6b6772618 可以总本地路径直接启动原神 2023-11-27 22:13:12 +08:00
辉鸭蛋 8fb59738db Update README.md 2023-11-27 11:44:15 +08:00
huiyadanli 3298caa009 remove git lfs 2023-11-27 00:11:08 +08:00
辉鸭蛋 a1fdef7015 Merge pull request #77 from GengGode/main
feat:点击模拟添加是否启用随机参数
2023-11-26 09:12:18 +08:00
ema fc74e127c1 try support bilibili auto wood
Now wait for an account to test it
2023-11-26 07:21:57 +08:00
ema e2f37cae39 notify auto wood unsupported with bilibili 2023-11-26 05:56:33 +08:00
Yu SuiXian 0da4df1afa Merge branch 'babalae:main' into main 2023-11-26 02:32:38 +08:00
ema e06e7c878c simplify OnStartup method 2023-11-26 02:13:30 +08:00
Yu SuiXian c5aeb197c9 feat:点击模拟添加是否启用随机参数,默认不随机 2023-11-26 02:05:06 +08:00
ema ecfaba7252 feat: BetterGI single instance 2023-11-26 02:01:13 +08:00
huiyadanli c2ac8dff77 0.16.1 2023-11-26 00:08:17 +08:00
huiyadanli f8f8414909 AutoGeniusInvokation: fix last card burning 2 2023-11-26 00:07:50 +08:00
huiyadanli 944c61b867 0.16 2023-11-25 23:49:46 +08:00
huiyadanli 4a255ac1bd upgrade prompt to add options that will no longer be prompted 2023-11-25 23:47:39 +08:00
huiyadanli 775619b811 AutoGeniusInvokation: add strategy 2023-11-25 23:30:11 +08:00
huiyadanli 408e372481 auto wood 2023-11-25 22:30:18 +08:00
huiyadanli 5068f4a7f7 fix black screen click 2023-11-25 19:38:47 +08:00
huiyadanli d314b92d67 add switch bgi trigger enable hotkey 2023-11-25 17:16:54 +08:00
huiyadanli cef6f6a9e0 use new hotkey module 2023-11-25 17:04:36 +08:00
huiyadanli 9fe2a75db2 auto genius invokation: fix PredictionDiceType, switching characters does not require specific dice 2023-11-25 16:51:33 +08:00
huiyadanli 8af8b444c2 ui copywriting changes 2023-11-25 14:23:52 +08:00
huiyadanli 7c3e193ca7 fix the last card burn #29 2023-11-25 12:59:17 +08:00
huiyadanli ede9019649 double speed ! #54 2023-11-25 12:29:29 +08:00
huiyadanli f4fb5a24aa more friendly prompts #23 2023-11-25 04:21:18 +08:00
huiyadanli 15480e8de0 add locker for PaddleOcr 2023-11-25 03:42:38 +08:00
huiyadanli d8cbdba33b try catch #47 & print exception logs #48 2023-11-25 03:35:30 +08:00
huiyadanli 92df6d8bb4 add 3-channel template match & can quickly exit during automatic pole throwing 2023-11-25 03:24:35 +08:00
huiyadanli d679ef64f9 improve dice recognition rate #29 2023-11-25 02:46:28 +08:00
huiyadanli 55748bc549 fix rect 2023-11-25 02:21:03 +08:00
huiyadanli 8d4019010a RectConfig -> Rect test pass 2023-11-25 01:13:12 +08:00
Lightczx 5874ad285c OpenCvRectJsonConverter 2023-11-24 10:24:44 +08:00
ema f1208d8cfd Create FolderProfile.pubxml 2023-11-24 05:02:31 +08:00
ema 9b193e56ea feat: now you can launch through bettergi:// 2023-11-24 04:56:40 +08:00
ema df2acc4198 apply WindowBackdropType.Mica for MainWindow 2023-11-24 04:15:13 +08:00
ema b9bc7748d9 add a settings button to support win11 BitBlt 2023-11-24 03:41:46 +08:00
ema 48d94f8729 force platforms to x64 without testing 2023-11-24 03:28:39 +08:00
ema ce428fe9e7 fix mask window to an actual transparent mouse 2023-11-24 03:24:29 +08:00
辉鸭蛋 f4588ede42 Merge pull request #44 from qhy040404/main
Set btn text after exiting duel
2023-11-23 11:06:45 +08:00
huiyadanli 28899ee9d6 add update notice 2023-11-23 01:13:20 +08:00
qhy040404 920e0fb4df Set btn text after exiting duel 2023-11-22 18:58:13 +08:00
huiyadanli 34725b5122 fix OpenCvSharp.Rect can't deserialize 2023-11-22 00:30:06 +08:00
huiyadanli 70c13393fe fix trigger point 2023-11-21 00:24:16 +08:00
huiyadanli 6a7123ff72 enhance artifact: move the mouse back to the origin 2023-11-20 00:12:32 +08:00
huiyadanli a97a67d028 fix auto skip 2023-11-20 00:09:22 +08:00
huiyadanli f41129a6ad beautify the home page 2023-11-19 02:09:32 +08:00
huiyadanli 83c77745ef add genshin settings #23 2023-11-19 00:18:06 +08:00
huiyadanli 289b510c97 fix auto pick white list & log box hittest false 2023-11-18 19:49:39 +08:00
huiyadanli f20926d0e0 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-11-18 13:48:14 +08:00
huiyadanli 4e2bd0372e update Yap model and black list & update icon and urls 2023-11-18 13:44:57 +08:00
辉鸭蛋 59dd9761d2 use new home url 2023-11-18 03:14:17 +08:00
辉鸭蛋 c676ec720c Update README.md 2023-11-18 03:12:50 +08:00
huiyadanli d6d2f15d0e Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-11-18 01:07:01 +08:00
huiyadanli 4ba6a4540e adjust expedition waiting time 2023-11-18 00:42:21 +08:00
辉鸭蛋 167673f3d9 Update README.md 2023-11-17 21:01:07 +08:00
辉鸭蛋 c0e930c4d6 Update README.md 2023-11-17 20:44:26 +08:00
辉鸭蛋 6e88d1ebb3 Update README.md 2023-11-17 00:15:22 +08:00
huiyadanli 29d5ecf77d fix the TP interface was mistakenly closed by auto skip 2023-11-15 23:51:56 +08:00
huiyadanli 30f161eba7 fix expedition character idle judge 2023-11-13 23:31:07 +08:00
huiyadanli 82a6c229e3 some optimizations 2 2023-11-13 02:02:07 +08:00
huiyadanli b8ed185e2b some optimizations 2023-11-13 02:01:57 +08:00
huiyadanli 1356f5208c fix auto genius invokation 2023-11-13 01:27:38 +08:00
huiyadanli 117fc39dd2 set dice count by ocr #14 2023-11-13 00:17:58 +08:00
huiyadanli 95f4bff66e extend the wait time of the last card #14 2023-11-13 00:02:43 +08:00
huiyadanli 0743717f77 use hp ocr recognize which character active #14 2023-11-13 00:01:11 +08:00
huiyadanli e2143429c0 add PromptDialog & add explore config 2023-11-12 22:51:03 +08:00
huiyadanli 36463a4b75 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-11-12 17:52:43 +08:00
huiyadanli 4b01709e2e add task trigger interval settings 2023-11-12 17:52:29 +08:00
辉鸭蛋 cf2406aa9a Update README.md 2023-11-12 16:54:25 +08:00
辉鸭蛋 29d651f2ce Update README.md 2023-11-12 11:27:10 +08:00
huiyadanli 7f1dc84ec5 update yap model 2023-11-11 21:44:57 +08:00
huiyadanli cfa1aced7b auto skip: fix black screen click & add auto close page 2023-11-11 21:38:16 +08:00
huiyadanli 71eaecab0d add OCR within 3s of auto skip button recognition failure 2023-11-11 20:26:29 +08:00
huiyadanli 4feb7b489f update auto expedition 2023-11-09 22:53:33 +08:00
huiyadanli 77b4e9ab57 update Yap model for 4.2 2023-11-08 22:28:00 +08:00
huiyadanli dbec380c69 fix: auto expedition skip 2023-11-08 21:50:07 +08:00
huiyadanli 75788845ef fix: blinking window when selecting logs 2023-11-08 21:34:13 +08:00
huiyadanli 9ac4d12896 fixed: error app name #21 2023-11-07 22:58:01 +08:00
huiyadanli 3974fbb351 auto expedition: delay switch area time 2023-11-07 00:52:35 +08:00
辉鸭蛋 6e6277e531 Merge pull request #20 from babalae/async-startup-fix
Fix async void startup
2023-11-06 14:09:56 +08:00
Lightczx 9e1080c9ec Update App.xaml.cs 2023-11-06 14:05:08 +08:00
辉鸭蛋 c834b5376e Update README.md 2023-11-05 21:43:57 +08:00
huiyadanli dbadaa265c auto expedition: ui 2023-11-05 21:23:31 +08:00
huiyadanli fcc76de886 add enhance wait delay time config #9 2023-11-05 14:32:37 +08:00
huiyadanli d43a5a27db auto expedition: init 2023-11-05 00:33:17 +08:00
huiyadanli 35b994bdb9 auto pick: fast mode [deprecated] 2023-11-04 13:05:44 +08:00
huiyadanli b770f6ed9f remove Media.Ocr 2023-11-03 22:49:35 +08:00
huiyadanli 333d692237 refactor: add model in preject 2023-11-03 00:44:14 +08:00
huiyadanli a5d8758a97 update logo 2023-11-02 22:56:56 +08:00
ema 0a9a63841a fix: the lost logo in MainWindow 2023-11-02 00:29:08 +08:00
ema bb9e02f313 fix: deburring the logo 2023-11-01 20:32:37 +08:00
huiyadanli b5713ed0bb add SpeedTimer record debug time consumed 2023-10-31 23:48:24 +08:00
huiyadanli fd4e498898 auto picker: optimize performance 2023-10-31 23:04:42 +08:00
huiyadanli edb9a2ec67 add PaddleOcr 2023-10-31 22:29:42 +08:00
huiyadanli 4b9722aa25 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-30 00:09:50 +08:00
huiyadanli a2dcad54c8 auto get daily rewards 2023-10-30 00:09:39 +08:00
huiyadanli 5d87c7543b use gray-style by Yap 2023-10-29 20:44:50 +08:00
辉鸭蛋 45dbc27b2d Update README.md 2023-10-28 21:51:31 +08:00
辉鸭蛋 4b68d8d5f4 Update README.md 2023-10-28 21:50:59 +08:00
huiyadanli d57e67c159 update version and add logo 2023-10-28 21:03:05 +08:00
huiyadanli 8ca4baa377 fix typo 2023-10-28 20:26:44 +08:00
huiyadanli 5c6f93972f update ui 2023-10-28 20:25:24 +08:00
huiyadanli c12e9a28ad fully automatic fishing by YOLOv8 2023-10-28 20:20:35 +08:00
huiyadanli a27f66669f Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-28 02:23:05 +08:00
huiyadanli 9a78634628 preliminary completion of auto throwing rod 2023-10-28 02:22:53 +08:00
辉鸭蛋 9e98fa1a96 Update README.md 2023-10-25 14:53:12 +08:00
辉鸭蛋 46c59cf7c1 Update README.md 2023-10-25 14:51:58 +08:00
huiyadanli 480581b02b add fish bait assets 2023-10-25 00:41:51 +08:00
huiyadanli 2cdc3035a3 add YOLOv8 test trigger 2023-10-24 00:46:52 +08:00
1288 changed files with 132136 additions and 5735 deletions

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
---
name: Bug report / 错误报告
about: Create a report to help us improve / 创建报告以帮助我们改进
title: "[bug]请补充标题内容"
labels: bug
---
<!--
请提供下述完整信息以便快速定位问题 / Please provide the following information to quickly locate the problem
-->
- 系统环境 / System Environment:
- BetterGI版本号 / BetterGI Version:
- 问题描述 / Description of the issue:
- 复现步骤 / Reproduction steps:
+9
View File
@@ -0,0 +1,9 @@
blank_issues_enabled: false
contact_links:
- name: 官方文档 / Document
url: https://bgi.huiyadan.com/doc.html
about: 请在提出问题前阅读文档 / Read the document before submit the issue
- name: 常见问题 / FAQ
url: https://bgi.huiyadan.com/faq.html
about: 常见的用户提出的问题 / Common questions asked by users
+9
View File
@@ -0,0 +1,9 @@
---
name: I have feature requesting / 我有新功能请求
about: Your request may come as a surprise. / 你的请求也许成为惊喜
title: "[feature] "
labels: feature 功能请求
---
- Your feature requesting / 你的新功能请求
+5
View File
@@ -0,0 +1,5 @@
---
name: Feel free to express / 随便写写
about: Record something / 简单写写记录记录
---
+9
View File
@@ -0,0 +1,9 @@
---
name: I have a question / 我有疑问
about: Solve your problem / 解决你的疑问
title: "[question] "
labels: question
---
- Problem Description / 问题描述
- 请尽量提供问题相关的截图/日志等内容
+9
View File
@@ -0,0 +1,9 @@
---
name: I have suggestions / 我有建议
about: Your suggestions may benefit everyone / 你的建议可能让所有人受益
title: "[suggestion] "
labels: suggestion
---
- Your suggestions / 你的建议
+7 -1
View File
@@ -23,4 +23,10 @@ bld/
# Mine
Tmp/
/packages/
node_modules/
node_modules/
*.zip
# 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; }
}
+7
View File
@@ -0,0 +1,7 @@
<Application x:Class="BetterGenshinImpact.Test.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BetterGenshinImpact.Test"
StartupUri="MainWindow.xaml">
<Application.Resources />
</Application>
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Vision.WindowCapture.Test
namespace BetterGenshinImpact.Test
{
/// <summary>
/// Interaction logic for App.xaml
@@ -14,4 +10,5 @@ namespace Vision.WindowCapture.Test
public partial class App : Application
{
}
}
+10
View File
@@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OxyPlot.Wpf" Version="2.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BetterGenshinImpact\BetterGenshinImpact.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,156 @@
using System.Diagnostics;
using System.IO;
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Dataset;
public class AvatarClassifyGen
{
// 基础图像文件夹
private const string BaseDir = @"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\分类器\";
// 背景图像文件夹
private static readonly string BackgroundDir = Path.Combine(BaseDir, "background");
private static readonly Random Rd = new Random();
public static void GenAll()
{
// 读取基础图像
// 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_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);
// 生成测试集
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}_{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;
}
}
}
@@ -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}");
}
}
+90
View File
@@ -0,0 +1,90 @@
<Window x:Class="BetterGenshinImpact.Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Test"
Width="240"
Height="450"
mc:Ignorable="d">
<Canvas>
<Button Canvas.Left="10"
Canvas.Top="10"
Width="100"
Height="23"
Click="ShowCameraRecWindow"
Content="视角识别测试" />
<Button Canvas.Left="10"
Canvas.Top="40"
Width="100"
Height="23"
Click="ShowHsvTestWindow"
Content="Hsv拉条" />
<Button Canvas.Left="10"
Canvas.Top="70"
Width="100"
Height="23"
Click="DoMapPuzzle"
Content="拼接超大地图" />
<Button Canvas.Left="10"
Canvas.Top="100"
Width="100"
Height="23"
Click="DoMatchTest"
Content="生成特征点" />
<Button Canvas.Left="10"
Canvas.Top="130"
Width="100"
Height="23"
Click="DoMatchTemplateTest"
Content="模板匹配测试" />
<Button Canvas.Left="10"
Canvas.Top="160"
Width="100"
Height="23"
Click="MapDrawTeleportPoint"
Content="画传送点" />
<Button Canvas.Left="10"
Canvas.Top="190"
Width="100"
Height="23"
Click="GenAvatarData"
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"
Height="23"
Click="AutoCookTestCase"
Content="自动烹饪图像测试" />
<Button Canvas.Left="10"
Canvas.Top="250"
Width="100"
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>
+113
View File
@@ -0,0 +1,113 @@
using System.Diagnostics;
using BetterGenshinImpact.Core.Config;
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;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Global.StartUpPath = @"D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\bin\x64\Debug\net8.0-windows10.0.22621.0";
}
private void ShowCameraRecWindow(object sender, System.Windows.RoutedEventArgs e)
{
new CameraRecWindow().Show();
}
private void ShowHsvTestWindow(object sender, System.Windows.RoutedEventArgs e)
{
new HsvTestWindow().Run();
}
private void DoMapPuzzle(object sender, System.Windows.RoutedEventArgs e)
{
MapPuzzle.PutAll();
}
private void DoOcrTest(object sender, System.Windows.RoutedEventArgs e)
{
OcrTest.TestYap();
}
private void DoMatchTemplateTest(object sender, System.Windows.RoutedEventArgs e)
{
MatchTemplateTest.Test();
}
private void DoMatchTest(object sender, System.Windows.RoutedEventArgs e)
{
// KeyPointMatchTest.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)
{
MapTeleportPointDraw.Draw();
}
private void GenAvatarData(object sender, RoutedEventArgs e)
{
AvatarClassifyGen.GenAll();
}
private void AutoCookTestCase(object sender, RoutedEventArgs e)
{
AutoCookTest.Test();
}
private void MapPathView(object sender, RoutedEventArgs e)
{
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);
}
}
@@ -0,0 +1,47 @@
using BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
using BetterGenshinImpact.GameTask.Common.Element.Assets;
using BetterGenshinImpact.Helpers;
using OpenCvSharp;
using OpenCvSharp.Detail;
using System.Diagnostics;
using System.Windows.Forms;
using BetterGenshinImpact.Core.Recognition.OpenCv;
using BetterGenshinImpact.Helpers.Extensions;
namespace BetterGenshinImpact.Test.Simple.AllMap;
public class BigMapMatchTest
{
public static void Test()
{
SpeedTimer speedTimer = new();
// var mainMap100BlockMat = new Mat(@"D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\Assets\Map\mainMap100Block.png", ImreadModes.Grayscale);
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);
var surfMatcher = new FeatureMatcher(mainMap100BlockMat);
var queryMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\比较\Clip_20240321_000329.png", ImreadModes.Grayscale);
speedTimer.Record("初始化特征");
queryMat = ResizeHelper.Resize(queryMat, 1d / 4);
Cv2.ImShow("queryMat", queryMat);
var p = surfMatcher.Match(queryMat);
speedTimer.Record("匹配1");
if (p.IsEmpty())
{
// var rect = Cv2.BoundingRect(pArray);
Debug.WriteLine($"Matched rect 1: {p}");
// Cv2.Rectangle(mainMap100BlockMat, rect, Scalar.Red, 2);
// Cv2.ImShow(@"b1", mainMap100BlockMat);
}
else
{
Debug.WriteLine("No match 1");
}
speedTimer.DebugPrint();
}
}
@@ -0,0 +1,65 @@
using BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
using BetterGenshinImpact.GameTask.Common.Element.Assets;
using BetterGenshinImpact.Helpers;
using BetterGenshinImpact.Helpers.Extensions;
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;
public class EntireMapTest
{
public static void Test()
{
SpeedTimer speedTimer = new();
var mainMap1024BlockMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap1024Block.png", ImreadModes.Grayscale);
var surfMatcher = new FeatureMatcher(mainMap1024BlockMat);
var queryMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\比较\小地图\Clip_20240323_183119.png", ImreadModes.Grayscale);
speedTimer.Record("初始化特征");
var p = surfMatcher.Match(queryMat);
speedTimer.Record("匹配1");
if (!p.IsEmpty())
{
Debug.WriteLine($"Matched rect 1: {p}");
Cv2.Circle(mainMap1024BlockMat, p.ToPoint(), 10, Scalar.Red);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\b1.png", mainMap1024BlockMat);
var p2 = surfMatcher.Match(queryMat, p.X, p.Y);
speedTimer.Record("匹配2");
if (!p2.IsEmpty())
{
// var rect2 = Cv2.BoundingRect(pArray2);
Debug.WriteLine($"Matched rect 2: {p2}");
// Cv2.Rectangle(mainMap1024BlockMat, rect2, Scalar.Yellow, 1);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\b2.png", mainMap1024BlockMat);
}
else
{
Debug.WriteLine("No match 2");
}
}
else
{
Debug.WriteLine("No match 1");
}
speedTimer.DebugPrint();
}
public static void Storage()
{
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,33 @@
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Helpers;
using OpenCvSharp;
using System.IO;
namespace BetterGenshinImpact.Test.Simple.AllMap;
public class FeatureTransfer
{
private static string rootPath = Global.Absolute(@"User\Map\");
public static void Transfer()
{
var kp = LoadKeyPointArrayOld();
if (kp != null)
{
string kpPath = Path.Combine(rootPath, $"mainMap2048Block_SIFT.kp");
FileStorage fs = new(kpPath, FileStorage.Modes.Write);
fs.Write("kp", kp);
fs.Release();
}
}
public static KeyPoint[]? LoadKeyPointArrayOld()
{
string kpPath = Path.Combine(rootPath, "mainMap2048Block_SIFT.kp.old");
if (File.Exists(kpPath))
{
return ObjectUtils.Deserialize(File.ReadAllBytes(kpPath)) as KeyPoint[];
}
return null;
}
}
@@ -0,0 +1,328 @@
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Xml;
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple.AllMap;
public class KeyPointMatchTest
{
public static void Test()
{
// var trainMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\比较\叠图\无法匹配2.png", ImreadModes.Color);
var trainMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\比较\小地图\Clip_20240323_152015.png", ImreadModes.Grayscale);
// tar = tar.Resize(new Size(tar.Width * 2, tar.Height * 2), 0, 0, InterpolationFlags.Nearest);
// var queryMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\combined_image_lim[quick].png", ImreadModes.Color);
var queryMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\combined_image_2048_lim[quick].png", ImreadModes.Grayscale);
var res = MatchPicBySurf(trainMat, queryMat);
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\s1.png", res);
}
/*public static Mat MatchPicBySift(Mat matSrc, Mat matTo)
{
Stopwatch sw = new Stopwatch();
sw.Start();
Mat matSrcRet = new Mat();
using Mat matToRet = new Mat();
KeyPoint[] keyPointsSrc, keyPointsTo;
using (var sift = SIFT.Create())
{
var kpPath = @"E:\HuiTask\更好的原神\地图匹配\sift.kp";
var kpMatPath = @"E:\HuiTask\更好的原神\地图匹配\sift.mat";
if (File.Exists(kpPath) && File.Exists(kpMatPath))
{
keyPointsSrc = (KeyPoint[])DeserializeObject(File.ReadAllBytes(kpPath));
GCHandle pinnedArray = GCHandle.Alloc(DeserializeObject(File.ReadAllBytes(kpMatPath)), GCHandleType.Pinned);
IntPtr pointer = pinnedArray.AddrOfPinnedObject();
matSrcRet = new Mat(166767, 128, MatType.CV_32FC1, pointer);
}
else
{
sift.DetectAndCompute(matSrc, null, out keyPointsSrc, matSrcRet);
byte[] arr = new byte[matSrcRet.Step(0) * matSrcRet.Rows]; // matSrcRet.Total() * matSrcRet.ElemSize()
Marshal.Copy(matSrcRet.Data, arr, 0, arr.Length);
File.WriteAllBytes(kpMatPath, SerializeObject(arr));
File.WriteAllBytes(kpPath, SerializeObject(keyPointsSrc));
}
sw.Stop();
Debug.WriteLine($"大地图kp耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
sift.DetectAndCompute(matTo, null, out keyPointsTo, matToRet);
sw.Stop();
Debug.WriteLine($"模板kp耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
}
using (var bfMatcher = new OpenCvSharp.BFMatcher())
{
var matches = bfMatcher.KnnMatch(matSrcRet, matToRet, k: 2);
var pointsSrc = new List<Point2f>();
var pointsDst = new List<Point2f>();
var goodMatches = new List<DMatch>();
foreach (DMatch[] items in matches.Where(x => x.Length > 1))
{
if (items[0].Distance < 0.5 * items[1].Distance)
{
pointsSrc.Add(keyPointsSrc[items[0].QueryIdx].Pt);
pointsDst.Add(keyPointsTo[items[0].TrainIdx].Pt);
goodMatches.Add(items[0]);
Debug.WriteLine($"{keyPointsSrc[items[0].QueryIdx].Pt.X}, {keyPointsSrc[items[0].QueryIdx].Pt.Y}");
}
}
sw.Stop();
Debug.WriteLine($"bfMatcher耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
var outMat = new Mat();
// algorithm RANSAC Filter the matched results
var pSrc = pointsSrc.ConvertAll(Point2fToPoint2d);
var pDst = pointsDst.ConvertAll(Point2fToPoint2d);
var outMask = new Mat();
// If the original matching result is null, Skip the filtering step
if (pSrc.Count > 0 && pDst.Count > 0)
Cv2.FindHomography(pSrc, pDst, HomographyMethods.Ransac, mask: outMask);
sw.Stop();
Debug.WriteLine($"FindHomography耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
// If passed RANSAC After processing, the matching points are more than 10.,Only filters are used. Otherwise, use the original matching point result(When the matching point is too small, it passes through RANSAC After treatment,It is possible to get the result of 0 matching points.).
if (outMask.Rows > 10)
{
byte[] maskBytes = new byte[outMask.Rows * outMask.Cols];
outMask.GetArray(out maskBytes);
Cv2.DrawMatches(matSrc, keyPointsSrc, matTo, keyPointsTo, goodMatches, outMat, matchesMask: maskBytes, flags: DrawMatchesFlags.NotDrawSinglePoints);
}
else
Cv2.DrawMatches(matSrc, keyPointsSrc, matTo, keyPointsTo, goodMatches, outMat, flags: DrawMatchesFlags.NotDrawSinglePoints);
sw.Stop();
Debug.WriteLine($"绘图耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
return outMat;
}
}*/
//This method may be missed, you may read a lot of blogs, but none of them wrote
private static Point2d Point2fToPoint2d(Point2f input)
{
Point2d p2 = new Point2d(input.X, input.Y);
return p2;
}
public static Mat MatchPicBySurf(Mat matSrc, Mat matTo, double threshold = 400)
{
Stopwatch sw = new Stopwatch();
sw.Start();
using Mat matSrcRet = new Mat();
using Mat matToRet = new Mat();
KeyPoint[] keyPointsSrc, keyPointsTo;
using (var surf = OpenCvSharp.XFeatures2D.SURF.Create(threshold, 4, 3, false, true))
{
surf.DetectAndCompute(matSrc, null, out keyPointsSrc, matSrcRet);
sw.Stop();
Debug.WriteLine($"模板kp耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
surf.DetectAndCompute(matTo, null, out keyPointsTo, matToRet);
sw.Stop();
Debug.WriteLine($"大地图kp耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
}
using (var flnMatcher = new FlannBasedMatcher())
{
var matches = flnMatcher.Match(matSrcRet, matToRet);
//Finding the Minimum and Maximum Distance
double minDistance = 1000; //Backward approximation
double maxDistance = 0;
for (int i = 0; i < matSrcRet.Rows; i++)
{
double distance = matches[i].Distance;
if (distance > maxDistance)
{
maxDistance = distance;
}
if (distance < minDistance)
{
minDistance = distance;
}
}
Debug.WriteLine($"max distance : {maxDistance}");
Debug.WriteLine($"min distance : {minDistance}");
var pointsSrc = new List<Point2f>();
var pointsDst = new List<Point2f>();
//Screening better matching points
var goodMatches = new List<DMatch>();
for (int i = 0; i < matSrcRet.Rows; i++)
{
double distance = matches[i].Distance;
if (distance < Math.Max(minDistance * 2, 0.02))
{
pointsSrc.Add(keyPointsSrc[matches[i].QueryIdx].Pt);
pointsDst.Add(keyPointsTo[matches[i].TrainIdx].Pt);
//Compression of new ones with distances less than ranges DMatch
goodMatches.Add(matches[i]);
}
}
sw.Stop();
Debug.WriteLine($"flnMatcher耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
var outMat = new Mat();
// algorithm RANSAC Filter the matched results
var pSrc = pointsSrc.ConvertAll(Point2fToPoint2d);
var pDst = pointsDst.ConvertAll(Point2fToPoint2d);
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);
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);
// for (int i = 0; i < 4; i++)
// {
// /* 作用和perspectiveTransform一样
// double x = obj_corners[i].x;
// double y = obj_corners[i].y;
// double Z = 1. / (H.At<double>(2, 0) * x + H.At<double>(2, 1) * y + H.At<double>(2, 2));
// double X = (H.At<double>(0, 0) * x + H.At<double>(0, 1) * y + H.At<double>(0, 2)) * Z;
// double Y = (H.At<double>(1, 0) * x + H.At<double>(1, 1) * y + H.At<double>(1, 2)) * Z;
// scene_corners[i] = new Point(cv.Round(X) + img_1.Cols, cv.Round(Y));*/
// sceneCorners[i].X += matSrc.Cols;
// }
Cv2.Line(matTo, sceneCorners[0].ToPoint(), sceneCorners[1].ToPoint(), Scalar.Red, 2);
Cv2.Line(matTo, sceneCorners[1].ToPoint(), sceneCorners[2].ToPoint(), Scalar.Red, 2);
Cv2.Line(matTo, sceneCorners[2].ToPoint(), sceneCorners[3].ToPoint(), Scalar.Red, 2);
Cv2.Line(matTo, sceneCorners[3].ToPoint(), sceneCorners[0].ToPoint(), Scalar.Red, 2);
}
sw.Stop();
Debug.WriteLine($"FindHomography耗时:{sw.ElapsedMilliseconds}ms.");
sw.Restart();
// If passed RANSAC After processing, the matching points are more than 10.,Only filters are used. Otherwise, use the original matching point result(When the matching point is too small, it passes through RANSAC After treatment,It's possible to get the result of 0 matching points.).
if (outMask.Rows > 10)
{
Debug.WriteLine($"使用了Ransac的结果");
byte[] maskBytes = new byte[outMask.Rows * outMask.Cols];
outMask.GetArray(out maskBytes);
Cv2.DrawMatches(matSrc, keyPointsSrc, matTo, keyPointsTo, goodMatches, outMat, matchesMask: maskBytes, flags: DrawMatchesFlags.NotDrawSinglePoints);
}
else
Cv2.DrawMatches(matSrc, keyPointsSrc, matTo, keyPointsTo, goodMatches, outMat, flags: DrawMatchesFlags.NotDrawSinglePoints);
sw.Stop();
Debug.WriteLine($"绘图耗时:{sw.ElapsedMilliseconds}ms.");
return outMat;
}
}
/// <summary>
/// 序列化
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
private static byte[] Serialize(object obj)
{
using var memoryStream = new MemoryStream();
DataContractSerializer ser = new DataContractSerializer(typeof(object));
ser.WriteObject(memoryStream, obj);
var data = memoryStream.ToArray();
return data;
}
/// <summary>
/// 反序列化
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="data"></param>
/// <returns></returns>
private static T Deserialize<T>(byte[] data)
{
using var memoryStream = new MemoryStream(data);
XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(memoryStream, new XmlDictionaryReaderQuotas());
DataContractSerializer ser = new DataContractSerializer(typeof(T));
var result = (T)ser.ReadObject(reader, true);
return result;
}
static bool WriteRawImage(Mat image, string filename)
{
using (FileStream file = new FileStream(filename, FileMode.Create))
{
if (file == null || !file.CanWrite)
return false;
BinaryWriter writer = new BinaryWriter(file);
writer.Write(image.Rows);
writer.Write(image.Cols);
int depth = image.Depth();
int type = image.Type();
int channels = image.Channels();
writer.Write(depth);
writer.Write(type);
writer.Write(channels);
int sizeInBytes = (int)image.Step() * image.Rows;
writer.Write(sizeInBytes);
byte[] arr = new byte[sizeInBytes];
Marshal.Copy(image.Data, arr, 0, arr.Length);
writer.Write(arr, 0, sizeInBytes);
}
return true;
}
static bool ReadRawImage(out Mat image, string filename)
{
int rows, cols, data, depth, type, channels;
image = null;
using (FileStream file = new FileStream(filename, FileMode.Open))
{
if (file == null || !file.CanRead)
return false;
try
{
BinaryReader reader = new BinaryReader(file);
rows = reader.ReadInt32();
cols = reader.ReadInt32();
depth = reader.ReadInt32();
type = reader.ReadInt32();
channels = reader.ReadInt32();
data = reader.ReadInt32();
image = new Mat(rows, cols, (MatType)type);
// reader.Read(image.Data, 0, data);
}
catch (Exception)
{
return false;
}
}
return true;
}
}
@@ -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("特征保存成功。");
}
}
@@ -0,0 +1,238 @@
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple.AllMap;
public class MapPuzzle
{
public static List<string> PicWhiteHashList = new List<string>
{
"25E23B0D18C2CBEA19D28E5E399D42FA",
"3B4847FEA7D506EAF3B75D4F4541E867",
"CCCAF02768432A46AA0001E51DC5991B",
"F80C609208063B289A05B8A1E0351226",
"06767779699056515930D0597072AB7D",
"04F757BD57FBB5FA74A6C9C0634BB122",
"04C1EDFCD89249209D1DD885DD2F2129",
"01B8641F5F58BBDE6E10F53D56EA7288",
"AF56BDE27BDF534317A9FB34E08165C0",
"05F4EAB8C6BFBADD60B8A5CCDD614F83"
};
public static MD5 Md5Service = MD5.Create();
public static void PutAll()
{
// 保存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); // 获取所有图片文件路径
// 解析图片位置信息并存储到字典中
var imageLocations = new Dictionary<(int row, int col), ImgInfo>();
foreach (var imagePath in images)
{
// 获取文件大小
var fileInfo = new FileInfo(imagePath);
// 解析图片名称中的行列信息
var name = Path.GetFileNameWithoutExtension(imagePath);
var match = Regex.Match(name, pattern);
int row, col;
if (match.Success)
{
// Debug.WriteLine($"已匹配 ({match.Groups[1].Value}, {match.Groups[2].Value}) {name}");
row = int.Parse(match.Groups[1].Value);
col = int.Parse(match.Groups[2].Value);
}
else
{
// Debug.WriteLine($"未匹配 {name}");
continue;
}
// 排除指定行列的图片
if ((row, col) == (4, 6) || (row, col) == (5, 6) || (row, col) == (5, 5) || (row, col) == (5, 2) || (row, col) == (5, 1) || (row, col) == (4, 1))
{
continue;
}
// 读取图片并计算hash值
Mat img = Cv2.ImRead(imagePath);
var hashBytes = Md5Service.ComputeHash(File.ReadAllBytes(imagePath));
var hash = BitConverter.ToString(hashBytes).Replace("-", "").ToUpperInvariant();
if (img.Width < 8)
{
Debug.WriteLine($"太小的不要 ({row}, {col}) {img.Width} {img.Height} {name}");
continue;
}
// 如果只要城市拼接,取消注释这段
// if (block == 2048 && img.Width != 2048)
// {
// Debug.WriteLine($"不是2048的不要 ({row}, {col}) {img.Width} {img.Height} {name}");
// continue;
// }
// 如果当前位置已经有图片了,保留尺寸较大的图片
if (imageLocations.ContainsKey((row, col)))
{
// 如果当前位置的图片已经被hash锁定,跳过
if (imageLocations[(row, col)].Locked)
{
Debug.WriteLine($"已锁定 ({row}, {col}) {name}");
continue;
}
if (img.Width > imageLocations[(row, col)].Img.Width || fileInfo.Length > imageLocations[(row, col)].FileLength || PicWhiteHashList.Contains(hash))
{
imageLocations[(row, col)] = new ImgInfo(img, name, fileInfo.Length, PicWhiteHashList.Contains(hash));
}
else
{
Debug.WriteLine($"重复 ({row}, {col}) {img.Width} {img.Height} {name}");
}
}
else
{
imageLocations[(row, col)] = new ImgInfo(img, name, fileInfo.Length, PicWhiteHashList.Contains(hash));
}
}
int minRow = imageLocations.Keys.Min(key => key.row);
int minCol = imageLocations.Keys.Min(key => key.col);
// 确定大图的行数和列数
int maxRow = imageLocations.Keys.Max(key => key.row);
int maxCol = imageLocations.Keys.Max(key => key.col);
// 计算大图的总宽度和高度
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;
// 创建空白大图
Mat largeImage = new Mat(totalHeight, totalWidth, MatType.CV_8UC3, new Scalar(0, 0, 0));
// 拼接图片
int[,] arr = new int[lenRow + 1, lenCol + 1];
foreach (var location in imageLocations)
{
int row = location.Key.row - minRow;
int col = location.Key.col - minCol;
Mat img = location.Value.Img;
arr[row, col] = 1;
// 计算当前图片在大图中的左上角位置
int x = (lenCol - col) * block; // 顺序倒过来了,屮
int y = (lenRow - row) * block; // 顺序倒过来了,屮
// 将图片粘贴到大图上
if (img.Width != block || img.Height != block)
{
img = img.Resize(new Size(block, block), 0, 0, InterpolationFlags.Nearest);
}
// 添加位置标识
// img.PutText($"{location.Key.row} , {location.Key.col}", new Point(50, 50), HersheyFonts.HersheyComplex, 2, Scalar.Red, 2, LineTypes.Link8);
img.CopyTo(new Mat(largeImage, new Rect(x, y, img.Width, img.Height)));
}
// 康康二维数组的拼接结果
for (int i = 0; i < arr.GetLength(0); i++)
{
for (int j = 0; j < arr.GetLength(1); j++)
{
Debug.Write(arr[i, j] + " ");
}
Debug.WriteLine("");
}
// 地图图片块
// 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));
// 释放资源
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))
{
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();
}
}
}
}
}
public class ImgInfo
{
public Mat Img { get; set; }
public string Name { get; set; }
/// <summary>
/// 文件大小
/// </summary>
public long FileLength { get; set; }
public bool Locked { get; set; }
public ImgInfo(Mat mat, string name, long fileLength, bool locked = false)
{
Img = mat;
Name = name;
FileLength = fileLength;
Locked = locked;
}
}
}
@@ -0,0 +1,72 @@
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;
public class MapTeleportPointDraw
{
public static void Draw()
{
// 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, List<GiWorldPosition> points)
{
foreach (var point in points)
{
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<GiWorldPosition> LoadTeleportPoint(string folderPath)
{
string[] files = Directory.GetFiles(folderPath, "*.*", SearchOption.AllDirectories);
List<GiWorldPosition> points = new();
foreach (var file in files)
{
var gamePoint = JsonSerializer.Deserialize<GamePoint>(File.ReadAllText(file), ConfigService.JsonOptions);
if (gamePoint == null)
{
Debug.WriteLine($"{file} json is null");
continue;
}
points.Add(Transform(gamePoint.Position));
}
return points;
}
/// <summary>
/// 坐标系转换
/// </summary>
/// <param name="position">[a,b,c]</param>
/// <returns></returns>
public static GiWorldPosition Transform(decimal[] position)
{
return new GiWorldPosition
{
Position = position,
};
}
class GamePoint
{
public string Description { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public decimal[] Position { get; set; } = new decimal[3];
}
}
@@ -0,0 +1,117 @@
using BetterGenshinImpact.Core.Recognition.OpenCv;
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple.AllMap;
public class MatchTemplateTest
{
public static readonly Size TemplateSize = new(240, 135);
// 对无用部分进行裁剪(左160,上80,下96)
public static readonly Rect TemplateSizeRoi = new Rect(20, 10, TemplateSize.Width - 20, TemplateSize.Height - 22);
public static void Test()
{
var tar = new Mat(@"E:\HuiTask\更好的原神\地图匹配\比较\叠图\无法匹配.png", ImreadModes.Grayscale);
var sTar = tar.Resize(new Size(240, 135), 0, 0, InterpolationFlags.Cubic);
// sTar = new Mat(sTar, TemplateSizeRoi);
Cv2.ImShow("sTar", sTar);
var src = new Mat(@"E:\HuiTask\更好的原神\地图匹配\combined_image_small.png", ImreadModes.Grayscale);
var src2 = src.Clone();
var p = MatchTemplateWithGaussianBlur(src, sTar, TemplateMatchModes.CCoeffNormed, null, 0.1);
Cv2.Rectangle(src2, new Rect(p.X, p.Y, sTar.Width, sTar.Height), new Scalar(0, 0, 255));
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\x1.png", src2);
}
public static void TestTrack()
{
var tar = new Mat(@"E:\HuiTask\更好的原神\自动剧情\任务剧情与地图追踪\blue_task_point_28x.png", ImreadModes.Grayscale);
var src = new Mat(@"E:\HuiTask\更好的原神\自动剧情\任务剧情与地图追踪\202404050232291883.png", ImreadModes.Grayscale);
var src2 = src.Clone();
var p = MatchTemplateHelper.MatchTemplate(src, tar, TemplateMatchModes.CCoeffNormed, null, 0.2);
Cv2.Rectangle(src2, new Rect(p.X, p.Y, tar.Width, tar.Height), new Scalar(0, 0, 255), 1);
Cv2.ImWrite(@"E:\HuiTask\更好的原神\自动剧情\任务剧情与地图追踪\rec_b1.png", src2);
}
public static void TestMenu()
{
var tar = new Mat(@"D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\GameTask\Common\Element\Assets\1920x1080\paimon_menu.png", ImreadModes.Color);
var src = new Mat(@"E:\HuiTask\更好的原神\地图匹配\比较\菜单\Clip_20240331_155210.png", ImreadModes.Color);
var src2 = src.Clone();
var p = MatchTemplateHelper.MatchTemplate(src, tar, TemplateMatchModes.CCoeffNormed, null, 0.1);
Cv2.Rectangle(src2, new Rect(p.X, p.Y, tar.Width, tar.Height), new Scalar(0, 0, 255), 1);
// 画出小地图的位置
// 此图38x40 小地图210x210 小地图左上角位置 24,-15
Cv2.Rectangle(src2, new Rect(p.X + 24, p.Y - 15, 210, 210), Scalar.Blue, 1);
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\比较\菜单\rec2.png", src2);
}
public static void TestTeamAvatar()
{
var tar = new Mat(@"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\识别头像素材\UI_AvatarIcon_Side_Zhongli_2.png", ImreadModes.Unchanged);
// tar = tar.Resize(new Size(108, 108), 0, 0, InterpolationFlags.Cubic);
var channels = tar.Split();
for (int i = 0; i < 3; i++)
{
channels[i] &= channels[3];
}
Cv2.Merge(channels[..3], tar);
Cv2.ImShow("tar.png", tar);
var src = new Mat(@"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\1.png", ImreadModes.Color);
var src2 = src.Clone();
var p = MatchTemplateWithGaussianBlur(src, tar, TemplateMatchModes.CCoeffNormed, null, 0.1);
Cv2.Rectangle(src2, new Rect(p.X, p.Y, tar.Width, tar.Height), new Scalar(0, 0, 255), 1);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\rec_1.png", src2);
Cv2.ImShow("src2", src2);
}
public static Point MatchTemplateWithGaussianBlur(Mat srcMat, Mat dstMat, TemplateMatchModes matchMode, Mat? maskMat = null, double threshold = 0.8)
{
try
{
var result = new Mat();
if (maskMat == null)
{
Cv2.MatchTemplate(srcMat, dstMat, result, matchMode);
}
else
{
Cv2.MatchTemplate(srcMat, dstMat, result, matchMode, maskMat);
}
if (matchMode is TemplateMatchModes.SqDiff or TemplateMatchModes.CCoeff or TemplateMatchModes.CCorr)
{
Cv2.Normalize(result, result, 0, 1, NormTypes.MinMax, -1, null);
}
using var blurResult = new Mat();
Cv2.GaussianBlur(result, blurResult, new Size(1, 1), 0);
Cv2.ImShow("blurResult", blurResult);
Cv2.Subtract(result, blurResult, result);
Cv2.MinMaxLoc(result, out var minValue, out var maxValue, out var minLoc, out var maxLoc);
Cv2.ImShow("result", result);
if (matchMode is TemplateMatchModes.SqDiff or TemplateMatchModes.SqDiffNormed)
{
if (minValue <= 1 - threshold)
{
return minLoc;
}
}
else
{
if (maxValue >= threshold)
{
return maxLoc;
}
}
return new Point();
}
catch (Exception ex)
{
return new Point();
}
}
}
@@ -0,0 +1,17 @@
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple;
internal class AutoCookTest
{
public static void Test()
{
var img = new Mat(@"E:\HuiTask\更好的原神\自动烹饪\2.png");
Cv2.CvtColor(img, img, ColorConversionCodes.BGR2RGB);
var img2 = new Mat();
// Cv2.InRange(img, new Scalar(255, 192, 64), new Scalar(255, 192, 64), img2);
Cv2.InRange(img, new Scalar(255, 255, 192), new Scalar(255, 255, 192), img2);
Cv2.ImShow("img", img2);
}
}
@@ -0,0 +1,85 @@
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple;
internal class HsvTestWindow
{
private const int MaxValueH = 360 / 2;
private static readonly int MaxValue = 255;
//private const string WindowCaptureName = "Video Capture";
private const string _windowDetectionName = "Object Detection";
private static int _lowH = 0, _lowS = 0, _lowV = 0;
private static int _highH = MaxValueH, _highS = MaxValue, _highV = MaxValue;
static void on_low_H_thresh_trackbar(int pos, nint userdata)
{
_lowH = Math.Min(_highH - 1, _lowH);
Cv2.SetTrackbarPos("Low H", _windowDetectionName, _lowH);
}
static void on_high_H_thresh_trackbar(int pos, nint userdata)
{
_highH = Math.Max(_highH, _lowH + 1);
Cv2.SetTrackbarPos("High H", _windowDetectionName, _highH);
}
static void on_low_S_thresh_trackbar(int pos, nint userdata)
{
_lowS = Math.Min(_highS - 1, _lowS);
Cv2.SetTrackbarPos("Low S", _windowDetectionName, _lowS);
}
static void on_high_S_thresh_trackbar(int pos, nint userdata)
{
_highS = Math.Max(_highS, _lowS + 1);
Cv2.SetTrackbarPos("High S", _windowDetectionName, _highS);
}
static void on_low_V_thresh_trackbar(int pos, nint userdata)
{
_lowV = Math.Min(_highV - 1, _lowV);
Cv2.SetTrackbarPos("Low V", _windowDetectionName, _lowV);
}
static void on_high_V_thresh_trackbar(int pos, nint userdata)
{
_highV = Math.Max(_highV, _lowV + 1);
Cv2.SetTrackbarPos("High V", _windowDetectionName, _highV);
}
public void Run()
{
//Cv2.NamedWindow(WindowCaptureName);
Cv2.NamedWindow(_windowDetectionName);
Cv2.ResizeWindow(_windowDetectionName, 900, 900);
// Trackbars to set thresholds for HSV values
Cv2.CreateTrackbar("Low H", _windowDetectionName, ref _lowH, MaxValueH, on_low_H_thresh_trackbar);
Cv2.CreateTrackbar("High H", _windowDetectionName, ref _highH, MaxValueH, on_high_H_thresh_trackbar);
Cv2.CreateTrackbar("Low S", _windowDetectionName, ref _lowS, MaxValue, on_low_S_thresh_trackbar);
Cv2.CreateTrackbar("High S", _windowDetectionName, ref _highS, MaxValue, on_high_S_thresh_trackbar);
Cv2.CreateTrackbar("Low V", _windowDetectionName, ref _lowV, MaxValue, on_low_V_thresh_trackbar);
Cv2.CreateTrackbar("High V", _windowDetectionName, ref _highV, MaxValue, on_high_V_thresh_trackbar);
var frame = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\bsz1.png", ImreadModes.Color);
Mat frameHsv = new Mat();
// Convert from BGR to HSV colorspace
Cv2.CvtColor(frame, frameHsv, ColorConversionCodes.BGR2HSV);
Mat frameThreshold = new Mat();
while (true)
{
// Detect the object based on HSV Range Values
Cv2.InRange(frameHsv, new Scalar(_lowH, _lowS, _lowV), new Scalar(_highH, _highS, _highV), frameThreshold);
// Show the frames
// Cv2.ImShow(WindowCaptureName, frame);
Cv2.ImShow(_windowDetectionName, frameThreshold);
char key = (char)Cv2.WaitKey(30);
if (key == 'q' || key == 27)
{
break;
}
}
}
}
@@ -0,0 +1,164 @@
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple.MiniMap;
public class CameraOrientationTest
{
public static (int[], int[], int[]) Test1()
{
var mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\视角朝向识别\3.png", ImreadModes.Grayscale);
Cv2.GaussianBlur(mat, mat, new Size(3, 3), 0);
// 极坐标展开
var centerPoint = new Point2f(mat.Width / 2f, mat.Height / 2f);
var polarMat = new Mat();
Cv2.WarpPolar(mat, polarMat, new Size(360, 360), centerPoint, 360d, InterpolationFlags.Linear, WarpPolarMode.Linear);
// Cv2.ImShow("polarMat", polarMat);
var polarRoiMat = new Mat(polarMat, new Rect(10, 0, 70, polarMat.Height));
Cv2.Rotate(polarRoiMat, polarRoiMat, RotateFlags.Rotate90Counterclockwise);
Cv2.ImShow("极坐标转换后", polarRoiMat);
//Cv2.ImWrite(@"E:\HuiTask\更好的原神\自动秘境\视角朝向识别\2_p.png", polarRoiMat);
var scharrResult = new Mat();
Cv2.Scharr(polarRoiMat, scharrResult, MatType.CV_32F, 1, 0);
var scharrResultDisplay = new Mat();
Cv2.ConvertScaleAbs(scharrResult, scharrResultDisplay);
Cv2.ImShow("Scharr", scharrResultDisplay);
// 求波峰
var left = new int[360];
var right = new int[360];
scharrResult.GetArray<float>(out var array);
var leftPeaks = FindPeaks(array);
leftPeaks.ForEach(i => left[i % 360]++);
var reversedArray = array.Select(x => -x).ToArray();
var rightPeaks = FindPeaks(reversedArray);
rightPeaks.ForEach(i => right[i % 360]++);
// 优化
var left2 = left.Zip(right, (x, y) => Math.Max(x - y, 0)).ToArray();
var right2 = right.Zip(left, (x, y) => Math.Max(x - y, 0)).ToArray();
// 左移后相乘
var rightAfterShift = Shift(right2, -90);
//var all = left2.Zip(rightAfterShift, (x, y) => x * y).ToArray();
// for (var i = 0; i < all.Length; i++)
// {
// if (i < 270)
// {
// all[i] = left[i] * right[i + 90];
// }
// else
// {
// all[i] = left[i] * right[i - 270];
// }
// }
// 左移后相乘 在附近2°内寻找最大值
var sum = new int[360];
for (var i = -2; i <= 2; i++)
{
var all = left2.Zip(Shift(right2, -90 + i), (x, y) => x * y * (3 - Math.Abs(i)) / 3).ToArray();
sum = sum.Zip(all, (x, y) => x + y).ToArray();
}
// 卷积
var result = new int[360];
for (var i = -2; i <= 2; i++)
{
var all = Shift(sum, i);
for (var j = 0; j < all.Length; j++)
{
all[j] = all[j] * (3 - Math.Abs(i)) / 3;
}
result = result.Zip(all, (x, y) => x + y).ToArray();
}
return (left2, rightAfterShift, result);
}
//static List<int> FindPeaks(double[] data)
//{
// List<int> peakIndices = new List<int>();
// for (int i = 1; i < data.Length - 1; i++)
// {
// if (data[i] > data[i - 1] && data[i] > data[i + 1])
// {
// peakIndices.Add(i);
// }
// }
// return peakIndices;
//}
static List<int> FindPeaks(float[] data)
{
List<int> peakIndices = new List<int>();
for (int i = 1; i < data.Length - 1; i++)
{
if (data[i] > data[i - 1] && data[i] > data[i + 1])
{
peakIndices.Add(i);
}
}
return peakIndices;
}
public static int[] RightShift(int[] array, int k)
{
return array.Skip(array.Length - k)
.Concat(array.Take(array.Length - k))
.ToArray();
}
public static int[] LeftShift(int[] array, int k)
{
return array.Skip(k)
.Concat(array.Take(k))
.ToArray();
}
public static int[] Shift(int[] array, int k)
{
if (k > 0)
{
return RightShift(array, k);
}
else
{
return LeftShift(array, -k);
}
}
public static void Test2()
{
var mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\视角朝向识别\1.png", ImreadModes.Color);
// 极坐标展开
var centerPoint = new Point2f(mat.Width / 2f, mat.Height / 2f);
var polarMat = new Mat();
Cv2.WarpPolar(mat, polarMat, new Size(360, 360), centerPoint, 360d, InterpolationFlags.Linear, WarpPolarMode.Linear);
var polarRoiMat = new Mat(polarMat, new Rect(20, 0, 70, polarMat.Height));
Cv2.Rotate(polarRoiMat, polarRoiMat, RotateFlags.Rotate90Counterclockwise);
Cv2.CvtColor(polarRoiMat, polarRoiMat, ColorConversionCodes.BGR2Lab);
Cv2.ImShow("极坐标转换后", polarRoiMat);
var splitMat = polarRoiMat.Split();
for (int i = 0; i < splitMat.Length; i++)
{
Cv2.ImShow($"splitMat{i}", splitMat[i]);
}
var andMat = new Mat();
Cv2.Scharr(splitMat[0], andMat, MatType.CV_8UC1, 1, 0);
Cv2.ImShow("Scharr", andMat);
}
}
@@ -0,0 +1,362 @@
using System.Diagnostics;
using BetterGenshinImpact.Core.Recognition.OpenCv;
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple.MiniMap;
public class CharacterOrientationTest
{
public static void TestArrow()
{
var mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\箭头识别\3.png", ImreadModes.Color);
var lowScalar = new Scalar(0, 207, 255);
var highScalar = new Scalar(0, 208, 255);
var gray = OpenCvCommonHelper.Threshold(mat, lowScalar, highScalar);
Cv2.ImShow("gray", gray);
}
static double Distance(Point pt1, Point pt2)
{
int deltaX = Math.Abs(pt2.X - pt1.X);
int deltaY = Math.Abs(pt2.Y - pt1.Y);
return Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
}
static double Distance(Point2f pt1, Point2f pt2)
{
var deltaX = Math.Abs(pt2.X - pt1.X);
var deltaY = Math.Abs(pt2.Y - pt1.Y);
return Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
}
// static Point2f Midpoint(Point2f p1, Point2f p2)
// {
// var midX = (p1.X + p2.X) / 2;
// var midY = (p1.Y + p2.Y) / 2;
// return new Point2f(midX, midY);
// }
static Point Midpoint(Point p1, Point p2)
{
var midX = (p1.X + p2.X) / 2;
var midY = (p1.Y + p2.Y) / 2;
return new Point(midX, midY);
}
public static void Triangle(Mat src, Mat gray)
{
Cv2.FindContours(gray, out var contours, out var hierarchy, RetrievalModes.External, ContourApproximationModes.ApproxNone);
Mat dst = Mat.Zeros(gray.Size(), MatType.CV_8UC3);
for (int i = 0; i < contours.Length; i++)
{
Cv2.DrawContours(src, contours, i, Scalar.Red, 1, LineTypes.Link4, hierarchy);
}
// Cv2.ImShow("目标", dst);
Mat dst2 = Mat.Zeros(gray.Size(), MatType.CV_8UC3);
// 遍历轮廓
for (int i = 0; i < contours.Length; i++)
{
// 计算轮廓的周长
double perimeter = Cv2.ArcLength(contours[i], true);
// 近似多边形拟合
Point[] approx = Cv2.ApproxPolyDP(contours[i], 0.04 * perimeter, true);
// 如果拟合的多边形有三个顶点,认为是三角形
if (approx.Length == 3)
{
// 在图像上绘制三角形的轮廓
Cv2.DrawContours(src, new Point[][] { approx }, -1, Scalar.Green, 1);
// 计算三条边的长度
var sideLengths = new double[3];
sideLengths[0] = Distance(approx[1], approx[2]);
sideLengths[1] = Distance(approx[2], approx[0]);
sideLengths[2] = Distance(approx[0], approx[1]);
var result = sideLengths
.Select((value, index) => new { Value = value, Index = index })
.OrderBy(item => item.Value)
.First();
// 计算最短线的中点
var residue = approx.ToList();
residue.RemoveAt(result.Index);
var midPoint = new Point((residue[0].X + residue[1].X) / 2, (residue[0].Y + residue[1].Y) / 2);
// 在图像上绘制直线
Cv2.Line(src, midPoint, approx[result.Index] + (approx[result.Index] - midPoint) * 3, Scalar.Red, 1);
Debug.WriteLine(CalculateAngle(midPoint, approx[result.Index]));
}
}
Cv2.ImShow("目标2", src);
}
public static void TestArrow2()
{
var mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\箭头识别\s1.png", ImreadModes.Color);
Cv2.GaussianBlur(mat, mat, new Size(3, 3), 0);
var splitMat = mat.Split();
//for (int i = 0; i < splitMat.Length; i++)
//{
// Cv2.ImShow($"splitMat{i}", splitMat[i]);
//}
// 红蓝通道按位与
var red = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[0], new Scalar(250), new Scalar(255), red);
//Cv2.ImShow("red", red);
var blue = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[2], new Scalar(0), new Scalar(10), blue);
//Cv2.ImShow("blue", blue);
var andMat = red & blue;
Cv2.ImShow("andMat2", andMat);
Triangle(mat, andMat);
}
public static void TestArrow3()
{
var mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\箭头识别\s1.png", ImreadModes.Color);
Cv2.GaussianBlur(mat, mat, new Size(3, 3), 0);
var splitMat = mat.Split();
//for (int i = 0; i < splitMat.Length; i++)
//{
// Cv2.ImShow($"splitMat{i}", splitMat[i]);
//}
// 红蓝通道按位与
var red = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[0], new Scalar(255), new Scalar(255), red);
//Cv2.ImShow("red", red);
var blue = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[2], new Scalar(0), new Scalar(0), blue);
//Cv2.ImShow("blue", blue);
var andMat = red & blue;
// Cv2.ImShow("andMat", andMat);
//腐蚀
var kernel = Cv2.GetStructuringElement(MorphShapes.Rect, new Size(3, 3));
var res = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.Erode(andMat.ToMat(), res, kernel);
Cv2.ImShow("erode", res);
// 膨胀
// var res2 = new Mat(mat.Size(), MatType.CV_8UC1);
// Cv2.Dilate(res, res2, kernel);
// Cv2.ImShow("dilate", res2);
// 矩形检测
Cv2.FindContours(res, out var contours, out var hierarchy, RetrievalModes.External, ContourApproximationModes.ApproxNone);
Mat dst = Mat.Zeros(res.Size(), MatType.CV_8UC3);
for (int i = 0; i < contours.Length; i++)
{
// 最小外接矩形
var rect = Cv2.MinAreaRect(contours[i]);
// 矩形的四个顶点
var points = Cv2.BoxPoints(rect);
// 绘制矩形
for (int j = 0; j < 4; ++j)
{
Cv2.Line(mat, (Point)points[j], (Point)points[(j + 1) % 4], Scalar.Red, 1);
}
if (Distance(points[0], points[1]) > Distance(points[1], points[2]))
{
Debug.WriteLine(CalculateAngle(points[0], points[1]));
}
else
{
Debug.WriteLine(CalculateAngle(points[1], points[2]));
}
}
Cv2.ImShow("目标", mat);
TestArrow2();
}
static double CalculateAngle(Point2f point1, Point2f point2)
{
var angleRadians = Math.Atan2(point2.Y - point1.Y, point2.X - point1.X);
var angleDegrees = angleRadians * (180 / Math.PI);
// 将角度调整为正值
if (angleDegrees < 0)
{
angleDegrees += 360;
}
return angleDegrees;
}
public static void FloodFill()
{
var mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\箭头识别\s1.png", ImreadModes.Color);
Cv2.GaussianBlur(mat, mat, new Size(3, 3), 0);
var splitMat = mat.Split();
//for (int i = 0; i < splitMat.Length; i++)
//{
// Cv2.ImShow($"splitMat{i}", splitMat[i]);
//}
// 1. 红蓝通道按位与
var red = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[0], new Scalar(250), new Scalar(255), red);
//Cv2.ImShow("red", red);
var blue = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[2], new Scalar(0), new Scalar(10), blue);
//Cv2.ImShow("blue", blue);
var andMat = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.BitwiseAnd(red, blue, andMat);
Cv2.ImShow("andMat2", andMat);
// 寻找轮廓
Cv2.FindContours(andMat, out var contours, out var hierarchy, RetrievalModes.External, ContourApproximationModes.ApproxSimple);
Mat dst = Mat.Zeros(andMat.Size(), MatType.CV_8UC3);
for (int i = 0; i < contours.Length; i++)
{
Cv2.DrawContours(dst, contours, i, Scalar.Red, 1, LineTypes.Link4, hierarchy);
}
Cv2.ImShow("寻找轮廓", dst);
// 计算最大外接矩形
if (contours.Length > 0)
{
var boxes = contours.Select(Cv2.BoundingRect).Where(w => w.Height >= 2);
var boxArray = boxes as Rect[] ?? boxes.ToArray();
if (boxArray.Count() != 1)
{
throw new Exception("找到多个外接矩形");
}
var box = boxArray.First();
// 剪裁出准备泛洪的区域(放大4倍的区域)
var newSrcMat = new Mat(mat, new Rect(box.X - box.Width / 2, box.Y - box.Height / 2, box.Width * 2, box.Height * 2));
Cv2.ImShow("剪裁出准备泛洪的区域", newSrcMat);
// 中心点作为种子点
var seedPoint = new Point(newSrcMat.Width / 2, newSrcMat.Height / 2);
// 泛洪填充
Cv2.FloodFill(newSrcMat, seedPoint, Scalar.White, out _, new Scalar());
}
}
public static void Hsv()
{
var mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\箭头识别\e1.png", ImreadModes.Color);
// Cv2.GaussianBlur(mat, mat, new Size(3, 3), 0);
var splitMat = mat.Split();
// 1. 红蓝通道按位与
var red = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[0], new Scalar(250), new Scalar(255), red);
var blue = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.InRange(splitMat[2], new Scalar(0), new Scalar(10), blue);
var andMat = new Mat(mat.Size(), MatType.CV_8UC1);
Cv2.BitwiseAnd(red, blue, andMat);
Cv2.ImShow("andMat2", andMat);
// 寻找轮廓
Cv2.FindContours(andMat, out var contours, out var hierarchy, RetrievalModes.External, ContourApproximationModes.ApproxSimple);
Mat dst = Mat.Zeros(andMat.Size(), MatType.CV_8UC3);
for (int i = 0; i < contours.Length; i++)
{
Cv2.DrawContours(dst, contours, i, Scalar.Red, 1, LineTypes.Link4, hierarchy);
}
Cv2.ImShow("寻找轮廓", dst);
// 计算最大外接矩形
if (contours.Length > 0)
{
var maxRect = Rect.Empty;
var maxIndex = 0;
for (int i = 0; i < contours.Length; i++)
{
var box = Cv2.BoundingRect(contours[i]);
if (box.Width * box.Height > maxRect.Width * maxRect.Height)
{
maxRect = box;
maxIndex = i;
}
}
var maxContour = contours[maxIndex];
// 计算轮廓的周长
var perimeter = Cv2.ArcLength(maxContour, true);
// 近似多边形拟合
var approx = Cv2.ApproxPolyDP(maxContour, 0.08 * perimeter, true);
// 如果拟合的多边形有三个顶点,认为是三角形
if (approx.Length == 3)
{
// 在图像上绘制三角形的轮廓
Cv2.DrawContours(mat, new Point[][] { approx }, -1, Scalar.Green, 1);
// 剪裁出三角形所在区域
var newSrcMat = new Mat(mat, maxRect);
// HSV 阈值取出中心飞镖
var hsvMat = new Mat();
Cv2.CvtColor(newSrcMat, hsvMat, ColorConversionCodes.BGR2HSV);
// var lowScalar = new Scalar(95, 255, 255);
// var highScalar = new Scalar(255, 255, 255);
var lowScalar = new Scalar(93, 155, 170);
var highScalar = new Scalar(255, 255, 255);
var hsvThresholdMat = new Mat();
Cv2.InRange(hsvMat, lowScalar, highScalar, hsvThresholdMat);
Cv2.ImShow("剪裁出三角形所在区域", hsvMat);
Cv2.ImShow("HSV 阈值取出中心飞镖", hsvThresholdMat);
// 循环计算三条边的中点,并计算中点到顶点的所有点中连续黑色像素的个数
var maxBlackCount = 0;
Point correctP1 = new(), correctP2 = new();
var offset = new Point(maxRect.X, maxRect.Y);
for (int i = 0; i < 3; i++)
{
var midPoint = Midpoint(approx[i], approx[(i + 1) % 3]);
var targetPoint = approx[(i + 2) % 3];
// 中点到顶点的所有点
var lineIterator = new LineIterator(hsvThresholdMat, midPoint - offset, targetPoint - offset, PixelConnectivity.Connectivity8);
// 计算连续黑色像素的个数
var blackCount = 0;
foreach (var item in lineIterator)
{
if (item.GetValue<Vec2b>().Item0 == 255)
{
break;
}
blackCount++;
}
if (blackCount > maxBlackCount)
{
maxBlackCount = blackCount;
correctP1 = midPoint;
correctP2 = targetPoint;
}
}
Cv2.Line(mat, correctP1, correctP2 + (correctP2 - correctP1) * 3, Scalar.Red, 1);
Cv2.ImShow("最终结果", mat);
}
}
}
}
@@ -0,0 +1,37 @@
using System.Diagnostics;
using BetterGenshinImpact.Core.Recognition.OCR;
using BetterGenshinImpact.Core.Recognition.ONNX.SVTR;
using BetterGenshinImpact.Core.Recognition.OpenCv;
using OpenCvSharp;
namespace BetterGenshinImpact.Test.Simple;
public class OcrTest
{
public static void TestYap()
{
Mat mat = Cv2.ImRead(@"E:\HuiTask\更好的原神\临时文件\fuben_jueyuan.png", ImreadModes.Grayscale);
var text = TextInferenceFactory.Pick.Inference(PreProcessForInference(mat));
Debug.WriteLine(text);
Mat mat2 = Cv2.ImRead(@"E:\HuiTask\更好的原神\临时文件\fuben_jueyuan.png", ImreadModes.Grayscale);
var text2 = OcrFactory.Paddle.Ocr(mat2);
Debug.WriteLine(text2);
}
private static Mat PreProcessForInference(Mat mat)
{
// Yap 已经改用灰度图了 https://github.com/Alex-Beng/Yap/commit/c2ad1e7b1442aaf2d80782a032e00876cd1c6c84
// 二值化
// Cv2.Threshold(mat, mat, 0, 255, ThresholdTypes.Otsu | ThresholdTypes.Binary);
//Cv2.AdaptiveThreshold(mat, mat, 255, AdaptiveThresholdTypes.GaussianC, ThresholdTypes.Binary, 31, 3); // 效果不错 但是和模型不搭
//mat = OpenCvCommonHelper.Threshold(mat, Scalar.FromRgb(235, 235, 235), Scalar.FromRgb(255, 255, 255)); // 识别物品不太行
// 不知道为什么要强制拉伸到 221x32
mat = ResizeHelper.ResizeTo(mat, 221, 32);
// 填充到 384x32
var padded = new Mat(new Size(384, 32), MatType.CV_8UC1, Scalar.Black);
padded[new Rect(0, 0, mat.Width, mat.Height)] = mat;
//Cv2.ImWrite(Global.Absolute("padded.png"), padded);
return padded;
}
}
@@ -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);
}
}
@@ -0,0 +1,34 @@
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Core.Recognition.OpenCv;
using BetterGenshinImpact.GameTask.AutoTrackPath.Model;
using BetterGenshinImpact.GameTask.Common.Element.Assets;
using BetterGenshinImpact.Service;
using OpenCvSharp;
using System.IO;
using System.Text.Json;
namespace BetterGenshinImpact.Test.Simple.Track;
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);
}
}
@@ -0,0 +1,39 @@
using BetterGenshinImpact.Test.Simple.MiniMap;
using OxyPlot;
using OxyPlot.Series;
namespace BetterGenshinImpact.Test.View;
internal class CameraRecViewModel
{
public PlotModel LeftModel { get; private set; }
public PlotModel RightModel { get; private set; }
public PlotModel AllModel { get; private set; }
public CameraRecViewModel()
{
var data = CameraOrientationTest.Test1();
LeftModel = BuildModel(data.Item1, "左");
RightModel = BuildModel(data.Item2, "右(左移90度后)");
AllModel = BuildModel(data.Item3, "乘积");
}
public PlotModel BuildModel(int[] data, string name)
{
// 创建折线图
var series = new LineSeries();
for (int i = 0; i < data.Length; i++)
{
series.Points.Add(new DataPoint(i, data[i]));
}
// 创建绘图模型并添加折线图
var plotModel = new PlotModel();
plotModel.Series.Add(series);
// 设置图表标题
plotModel.Title = name;
return plotModel;
}
}
@@ -0,0 +1,26 @@
<Window x:Class="BetterGenshinImpact.Test.View.CameraRecWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BetterGenshinImpact.Test"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:oxy="http://oxyplot.org/wpf"
xmlns:view="clr-namespace:BetterGenshinImpact.Test.View"
Title="MainWindow"
Width="400"
Height="800"
mc:Ignorable="d">
<Window.DataContext>
<view:CameraRecViewModel />
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<oxy:PlotView Grid.Row="0" Model="{Binding LeftModel}" />
<oxy:PlotView Grid.Row="1" Model="{Binding RightModel}" />
<oxy:PlotView Grid.Row="2" Model="{Binding AllModel}" />
</Grid>
</Window>
@@ -0,0 +1,12 @@
namespace BetterGenshinImpact.Test.View;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class CameraRecWindow : System.Windows.Window
{
public CameraRecWindow()
{
InitializeComponent();
}
}
@@ -1,20 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</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
+83 -37
View File
@@ -5,13 +5,23 @@ 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}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.HotkeyCapture", "Fischless.HotkeyCapture\Fischless.HotkeyCapture.csproj", "{08152E44-2564-46C5-B5B2-54DD43C01A79}"
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}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicaSetup.Uninst", "Build\MicaSetup\MicaSetup.Uninst.csproj", "{673344BC-B860-44AE-AD88-D33465BDE25B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Test", "BetterGenshinImpact.Test\BetterGenshinImpact.Test.csproj", "{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}"
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
@@ -21,30 +31,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|x64.ActiveCfg = Debug|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|x64.Build.0 = Debug|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.Build.0 = Release|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.ActiveCfg = Release|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.Build.0 = Release|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|x64.ActiveCfg = Debug|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|x64.Build.0 = Debug|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.Build.0 = Release|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|x64.ActiveCfg = Release|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|x64.Build.0 = Release|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|x64.ActiveCfg = Debug|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|x64.Build.0 = Debug|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.Build.0 = Release|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|x64.ActiveCfg = Release|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|x64.Build.0 = Release|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.ActiveCfg = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.Build.0 = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|x64.ActiveCfg = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|x64.Build.0 = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.ActiveCfg = Release|x64
{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
{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
@@ -53,18 +47,70 @@ 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|Any CPU
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|x64.ActiveCfg = Debug|Any CPU
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|x64.Build.0 = Debug|Any CPU
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|Any CPU.Build.0 = Release|Any CPU
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|x64.ActiveCfg = Release|Any CPU
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|x64.Build.0 = Release|Any CPU
{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
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|x64.Build.0 = Debug|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|Any CPU.ActiveCfg = Release|x64
{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
{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
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Debug|x64.Build.0 = Debug|x64
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Release|Any CPU.Build.0 = Release|Any CPU
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Release|x64.ActiveCfg = Release|x64
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Release|x64.Build.0 = Release|x64
{673344BC-B860-44AE-AD88-D33465BDE25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{673344BC-B860-44AE-AD88-D33465BDE25B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{673344BC-B860-44AE-AD88-D33465BDE25B}.Debug|x64.ActiveCfg = Debug|x64
{673344BC-B860-44AE-AD88-D33465BDE25B}.Debug|x64.Build.0 = Debug|x64
{673344BC-B860-44AE-AD88-D33465BDE25B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{673344BC-B860-44AE-AD88-D33465BDE25B}.Release|Any CPU.Build.0 = Release|Any CPU
{673344BC-B860-44AE-AD88-D33465BDE25B}.Release|x64.ActiveCfg = Release|x64
{673344BC-B860-44AE-AD88-D33465BDE25B}.Release|x64.Build.0 = Release|x64
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.ActiveCfg = Debug|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.Build.0 = Debug|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.Build.0 = Release|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.ActiveCfg = Release|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.Build.0 = Release|Any CPU
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|Any CPU.ActiveCfg = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|Any CPU.Build.0 = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|x64.ActiveCfg = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|x64.Build.0 = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|Any CPU.ActiveCfg = Release|x64
{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
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15} = {458E1106-43A4-47E6-B11B-D243035D4C76}
{673344BC-B860-44AE-AD88-D33465BDE25B} = {458E1106-43A4-47E6-B11B-D243035D4C76}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {352D8B78-9DE3-4E58-985F-FADD22594DB4}
EndGlobalSection
+1
View File
@@ -0,0 +1 @@
/Assets/Strings/*.html linguist-vendored
+12 -3
View File
@@ -1,15 +1,24 @@
<Application x:Class="BetterGenshinImpact.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Exit="OnExit"
Startup="OnStartup">
xmlns:bgivc="clr-namespace:BetterGenshinImpact.View.Converters"
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>
</Application.Resources>
</Application>
+266 -222
View File
@@ -1,246 +1,290 @@
using BetterGenshinImpact.Service;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.Helpers;
using BetterGenshinImpact.Helpers.Extensions;
using BetterGenshinImpact.Hutao;
using BetterGenshinImpact.Service;
using BetterGenshinImpact.Service.Interface;
using BetterGenshinImpact.Service.Notification;
using BetterGenshinImpact.Service.Notifier;
using BetterGenshinImpact.View;
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;
using System;
using System.IO;
using System.Windows;
using BetterGenshinImpact.Service.Interface;
using BetterGenshinImpact.ViewModel.Pages;
using Microsoft.Extensions.Configuration;
using Serilog.Events;
using Wpf.Ui;
using Serilog.Filters;
using System.Reflection;
using System.Security.Principal;
using BetterGenshinImpact.Core.Config;
using Serilog.Sinks.RichTextBox.Abstraction;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Controls;
using BetterGenshinImpact.GameTask;
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
namespace BetterGenshinImpact;
public partial class App : Application
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
// The.NET Generic Host provides dependency injection, configuration, logging, and other services.
// https://docs.microsoft.com/dotnet/core/extensions/generic-host
// https://docs.microsoft.com/dotnet/core/extensions/dependency-injection
// https://docs.microsoft.com/dotnet/core/extensions/configuration
// https://docs.microsoft.com/dotnet/core/extensions/logging
private static readonly IHost _host = Host.CreateDefaultBuilder()
.CheckIntegration()
.UseElevated()
.UseSingleInstance("BetterGI")
.ConfigureLogging(builder =>
{
builder.ClearProviders();
})
.ConfigureServices(
(context, services) =>
{
// 提前初始化配置
var configService = new ConfigService();
services.AddSingleton<IConfigService>(sp => configService);
var all = configService.Get();
var logFolder = Path.Combine(AppContext.BaseDirectory, "log");
Directory.CreateDirectory(logFolder);
var logFile = Path.Combine(logFolder, "better-genshin-impact.log");
var richTextBox = new RichTextBoxImpl();
services.AddSingleton<IRichTextBox>(richTextBox);
var loggerConfiguration = new LoggerConfiguration()
.WriteTo.File(path: logFile, outputTemplate: "[{Timestamp:HH:mm:ss.fff}] [{Level:u3}] {SourceContext}{NewLine}{Message}{NewLine}{Exception}{NewLine}", rollingInterval: RollingInterval.Day)
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning);
if (all.MaskWindowConfig.MaskEnabled)
{
loggerConfiguration.WriteTo.RichTextBox(richTextBox, LogEventLevel.Information, outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}");
}
Log.Logger = loggerConfiguration.CreateLogger();
services.AddLogging(c => c.AddSerilog());
// 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>();
services.AddSingleton<ISnackbarService, SnackbarService>();
// Main window with navigation
services.AddView<INavigationWindow, MainWindow, MainWindowViewModel>();
services.AddSingleton<NotifyIconViewModel>();
// Views
services.AddView<HomePage, HomePageViewModel>();
services.AddView<ScriptControlPage, ScriptControlViewModel>();
services.AddView<TriggerSettingsPage, TriggerSettingsPageViewModel>();
services.AddView<MacroSettingsPage, MacroSettingsPageViewModel>();
services.AddView<CommonSettingsPage, CommonSettingsPageViewModel>();
services.AddView<TaskSettingsPage, TaskSettingsPageViewModel>();
services.AddView<HotKeyPage, HotKeyPageViewModel>();
// services.AddView<NotificationSettingsPage, NotificationSettingsPageViewModel>();
services.AddView<KeyMouseRecordPage, KeyMouseRecordPageViewModel>();
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)));
}
)
.Build();
public static ILogger<T> GetLogger<T>()
{
// The.NET Generic Host provides dependency injection, configuration, logging, and other services.
// https://docs.microsoft.com/dotnet/core/extensions/generic-host
// https://docs.microsoft.com/dotnet/core/extensions/dependency-injection
// https://docs.microsoft.com/dotnet/core/extensions/configuration
// https://docs.microsoft.com/dotnet/core/extensions/logging
private static readonly IHost _host = Host.CreateDefaultBuilder()
.ConfigureServices(
(context, services) =>
{
// 提前初始化配置
var configService = new ConfigService();
services.AddSingleton<IConfigService>(sp => configService);
var all = configService.Get();
return _host.Services.GetService<ILogger<T>>()!;
}
var logFolder = Path.Combine(AppContext.BaseDirectory, @"log");
Directory.CreateDirectory(logFolder);
var logFile = Path.Combine(logFolder, $"better-genshin-impact.log");
/// <summary>
/// Gets registered service.
/// </summary>
/// <typeparam name="T">Type of the service to get.</typeparam>
/// <returns>Instance of the service or <see langword="null"/>.</returns>
public static T? GetService<T>() where T : class
{
return _host.Services.GetService(typeof(T)) as T;
}
var maskWindow = new MaskWindow();
services.AddSingleton(maskWindow);
/// <summary>
/// Gets registered service.
/// </summary>
/// <returns>Instance of the service or <see langword="null"/>.</returns>
/// <returns></returns>
public static object? GetService(Type type)
{
return _host.Services.GetService(type);
}
var loggerConfiguration = new LoggerConfiguration()
.WriteTo.File(path: logFile, outputTemplate: "[{Timestamp:HH:mm:ss.fff}] [{Level:u3}] {SourceContext}{NewLine}{Message}{NewLine}{Exception}{NewLine}", rollingInterval: RollingInterval.Day)
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning);
if (all.MaskWindowConfig.MaskEnabled)
{
loggerConfiguration.WriteTo.RichTextBox(maskWindow.LogBox, outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}");
}
Log.Logger = loggerConfiguration.CreateLogger();
services.AddLogging(c => c.AddSerilog());
/// <summary>
/// Occurs when the application is loading.
/// </summary>
protected override async void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// App Host
services.AddHostedService<ApplicationHostService>();
// Page resolver service
services.AddSingleton<IPageService, PageService>();
// Service containing navigation, same as INavigationWindow... but without window
services.AddSingleton<INavigationService, NavigationService>();
// Main window with navigation
services.AddSingleton<INavigationWindow, MainWindow>();
services.AddSingleton<MainWindowViewModel>();
// Views and ViewModels
services.AddSingleton<HomePage>();
services.AddSingleton<HomePageViewModel>();
services.AddSingleton<TriggerSettingsPage>();
services.AddSingleton<TriggerSettingsPageViewModel>();
services.AddSingleton<MacroSettingsPage>();
services.AddSingleton<MacroSettingsPageViewModel>();
services.AddSingleton<CommonSettingsPage>();
services.AddSingleton<CommonSettingsPageViewModel>();
services.AddSingleton<TaskSettingsPage>();
services.AddSingleton<TaskSettingsPageViewModel>();
services.AddSingleton<HotKeyPage>();
services.AddSingleton<HotKeyPageViewModel>();
// My Services
services.AddSingleton<TaskTriggerDispatcher>();
// Configuration
//services.Configure<AppConfig>(context.Configuration.GetSection(nameof(AppConfig)));
}
)
.Build();
public static ILogger<T> GetLogger<T>()
try
{
return _host.Services.GetService<ILogger<T>>()!;
RegisterEvents();
await _host.StartAsync();
await UrlProtocolHelper.RegisterAsync();
}
/// <summary>
/// Gets registered service.
/// </summary>
/// <typeparam name="T">Type of the service to get.</typeparam>
/// <returns>Instance of the service or <see langword="null"/>.</returns>
public static T? GetService<T>() where T : class
catch (Exception ex)
{
return _host.Services.GetService(typeof(T)) as T;
}
// DEBUG only, no overhead
Debug.WriteLine(ex);
/// <summary>
/// Occurs when the application is loading.
/// </summary>
private async void OnStartup(object sender, StartupEventArgs e)
{
// 获得当前登录的Windows用户标示
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
// 判断当前登录用户是否为管理员
if (principal.IsInRole(WindowsBuiltInRole.Administrator))
if (Debugger.IsAttached)
{
//如果是管理员,则直接运行
RegisterEvents();
await _host.StartAsync();
Debugger.Break();
}
else
{
//创建启动对象
var startInfo = new System.Diagnostics.ProcessStartInfo
{
UseShellExecute = true,
WorkingDirectory = Environment.CurrentDirectory,
FileName = Global.AppPath,
//设置启动动作,确保以管理员身份运行
Verb = "runas"
};
try
{
System.Diagnostics.Process.Start(startInfo);
}
catch
{
return;
}
//退出
Application.Current.Shutdown();
}
}
/// <summary>
/// Occurs when the application is closing.
/// </summary>
private async void OnExit(object sender, ExitEventArgs e)
{
await _host.StopAsync();
_host.Dispose();
}
/// <summary>
/// 注册事件
/// </summary>
private void RegisterEvents()
{
//Task线程内未捕获异常处理事件
TaskScheduler.UnobservedTaskException += TaskSchedulerUnobservedTaskException;
//UI线程未捕获异常处理事件(UI主线程)
this.DispatcherUnhandledException += AppDispatcherUnhandledException;
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
}
private static void TaskSchedulerUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
{
try
{
var exception = e.Exception as Exception;
HandleException(exception);
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
e.SetObserved();
}
}
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
try
{
var exception = e.ExceptionObject as Exception;
if (exception != null)
{
HandleException(exception);
}
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
//ignore
}
}
//UI线程未捕获异常处理事件(UI主线程)
private static void AppDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
try
{
HandleException(e.Exception);
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
//处理完后,我们需要将Handler=true表示已此异常已处理过
e.Handled = true;
}
}
private static void HandleException(Exception e)
{
MessageBox.Show("程序异常:" + e.Source + "\r\n--" + Environment.NewLine + e.StackTrace + "\r\n---" + Environment.NewLine + e.Message);
// log
}
}
}
/// <summary>
/// Occurs when the application is closing.
/// </summary>
protected override async void OnExit(ExitEventArgs e)
{
base.OnExit(e);
await _host.StopAsync();
_host.Dispose();
}
/// <summary>
/// 注册事件
/// </summary>
private void RegisterEvents()
{
//Task线程内未捕获异常处理事件
TaskScheduler.UnobservedTaskException += TaskSchedulerUnobservedTaskException;
//UI线程未捕获异常处理事件(UI主线程)
this.DispatcherUnhandledException += AppDispatcherUnhandledException;
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
}
private static void TaskSchedulerUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
{
try
{
HandleException(e.Exception);
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
e.SetObserved();
}
}
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
try
{
if (e.ExceptionObject is Exception exception)
{
HandleException(exception);
}
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
//ignore
}
}
//UI线程未捕获异常处理事件(UI主线程)
private static void AppDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
try
{
HandleException(e.Exception);
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
//处理完后,我们需要将Handler=true表示已此异常已处理过
e.Handled = true;
}
}
private static void HandleException(Exception e)
{
if (e.InnerException != null)
{
e = e.InnerException;
}
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.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8" ?>
<SyntaxDefinition name="Json" extensions=".json" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Bool" foreground="#569CD6" exampleText="true | false" />
<Color name="Number" foreground="#B5CEA8" exampleText="3.14" />
<Color name="String" foreground="#CE9178" exampleText="" />
<Color name="Null" foreground="#569CD6" exampleText="" />
<Color name="FieldName" foreground="#9CDCF0" />
<Color name="Punctuation1" foreground="#DA66BE" />
<Color name="Punctuation2" foreground="#FFD710" />
<Color name="Punctuation3" foreground="#FFFFFF" />
<RuleSet name="String">
<Span begin="\\" end="."/>
</RuleSet>
<RuleSet name="Object">
<Span color="FieldName" ruleSet="String">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span color="FieldName" ruleSet="String">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span color="Punctuation3" ruleSet="Expression">
<Begin>:</Begin>
</Span>
<Span color="Punctuation3">
<Begin>,</Begin>
</Span>
</RuleSet>
<RuleSet name="Array">
<Import ruleSet="Expression"/>
<Span color="Punctuation3">
<Begin>,</Begin>
</Span>
</RuleSet>
<RuleSet name="Expression">
<Keywords color="Bool" >
<Word>true</Word>
<Word>false</Word>
</Keywords>
<Keywords color="Null" >
<Word>null</Word>
</Keywords>
<Span color="String" ruleSet="String">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span color="String" ruleSet="String">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span color="Punctuation1" ruleSet="Object" multiline="true">
<Begin>\{</Begin>
<End>\}</End>
</Span>
<Span color="Punctuation2" ruleSet="Array" multiline="true">
<Begin>\[</Begin>
<End>\]</End>
</Span>
<Rule color="Number">
\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?
</Rule>
</RuleSet>
<RuleSet>
<Import ruleSet="Expression"/>
</RuleSet>
</SyntaxDefinition>
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.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.
Loaded 100 of 1288 files, more files were not shown because too many files have changed in this diff. Show more