diff --git a/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp b/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp index b9a5dc4f3b..83e2c3de1f 100644 --- a/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp +++ b/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp @@ -151,7 +151,10 @@ namespace Map inline bool TileCalc::run(const std::string& code_or_name, bool side, std::vector>& out_pos, std::vector>& out_tiles) const { for (const Map::Level& level : TileCalc::levels) { - if (level.code != code_or_name && level.name != code_or_name) { + if (level.code != code_or_name && + level.name != code_or_name && + level.levelId != code_or_name && + level.stageId != code_or_name) { continue; } auto [x, y, z] = level.view[side ? 1 : 0]; diff --git a/CHANGELOG_MAA.md b/CHANGELOG_MAA.md index 34c7949722..215b0fe159 100644 --- a/CHANGELOG_MAA.md +++ b/CHANGELOG_MAA.md @@ -1,9 +1,27 @@ -## 全新版本! +## 自动战斗 -- 新增自动战斗抄作业功能!欢迎加 [Q 群](https://jq.qq.com/?_wv=1027&k=ICIzu7lv) 分享/获取作业~ -- 肉鸽新增识别干员练度,自动选择最优干员及技能,不用再手动改文件了! -- 信用商店新增支持优先购买和自定义黑名单 -- 全模拟器支持自动连接(如果还是连不上请参考 [模拟器支持情况](https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/docs/%E6%A8%A1%E6%8B%9F%E5%99%A8%E6%94%AF%E6%8C%81.md) 及 [常见问题](https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/docs/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.md#%E8%BF%9E%E6%8E%A5%E9%94%99%E8%AF%AF%E4%B8%8D%E7%9F%A5%E9%81%93-adb-%E8%B7%AF%E5%BE%84%E6%80%8E%E4%B9%88%E5%A1%AB%E5%86%99) -- 重写关卡掉落识别,支持识别所有材料 -- 新增支持定时执行 -- 其他大量优化及问题修复 +- 新增支持模拟悖论(需要自己选技能) +- 修复部分地图坐标错误的问题 +- 修复部分干员 3 技能选不到的问题 +- 修复部分干员识别错误问题 +- 修复不选择作业直接开始时崩溃的问题 +- 修复作业不填写 `actions` 字段时崩溃的问题 + +## 基建 + +- 修复不收取会客室的问题 +- 修复搓玉补货时卡住的问题 +- 修复 `巫恋组` 赤金不足时卡住的问题 +- 下调办公室 `地灵` 的优先级 + +## 信用商店 + +- 修复信用商店黑名单为空时不购物的问题 +- 修复偶现卡在商品弹出界面的问题 + +## 其他 + +- 新增一个配置文件备份机制,修复界面设置被还原的问题 +- 修复开始唤醒卡在领取每日补给的问题 +- 修复部分模拟器地址变动带来的连接错误问题 +- 界面简单调整 diff --git a/docs/常见问题.md b/docs/常见问题.md index 702f4b0d7c..dafebe9c96 100644 --- a/docs/常见问题.md +++ b/docs/常见问题.md @@ -10,14 +10,21 @@ (具体可以下载 [CPU-Z](https://www.cpuid.com/softwares/cpu-z.html),查看“指令集”中有无 `AVX` 这一项来判断) - 若上述均没有效果,请提 issue。 -### 连接错误、不知道 adb 路径怎么填写 +### 连接错误 -提示 : 请根据 [使用说明](../README.md#使用说明) 确定您的模拟器及打开方式正确 +提示 : 请参考 [模拟器支持](模拟器支持.md) 确定您的模拟器是受支持的 -- 方法 1: 找到你的模拟器安装路径,大概率会有一个 `adb.exe`(不一定就叫这个名字,可能叫 `nox_adb.exe`, `HD-adb.exe`, `adb_server.exe`...总之是名字带 `adb` 的 exe。在 MAA 的连接设置里选择它! -- 方法 2: 使用 [自定义连接](#自定义连接) 的方式连接模拟器 -- 方法 3: 换模拟器,推荐 [蓝叠国际版](https://www.bluestacks.com/download.html) Nougat 64 bit -- 方法 4: 修改相关代码,C# 侧负责抓取模拟器进程并获取 adb 程序所在路径,这部分逻辑在 [这里](../src/MeoAsstGui/Helper/WinAdapter.cs),~~然后提 PR 给我们!~~ +#### 方式一 + +1. 确认 MAA `设置` - `连接设置` - `adb 路径` 是否自动填写了,若已填写请忽略这步。若未填写: + - 方法 1: 找到你的模拟器安装路径,大概率会有一个 `adb.exe`(不一定就叫这个名字,可能叫 `nox_adb.exe`, `HD-adb.exe`, `adb_server.exe`... 总之是名字带 `adb` 的 exe, 选择它! + - 方法 2: 自行下载 [adb](https://dl.google.com/android/repository/platform-tools-latest-windows.zip) 并解压,选择里面的 `adb.exe` + +2. 确认您的连接地址填写正确。可在网上搜索您使用的模拟器 adb 地址是什么,一般是类似 `127.0.0.1:5555` 这样的格式(雷电模拟器除外) + +#### 方式二 + +- 换模拟器,推荐 [蓝叠国际版](https://www.bluestacks.com/download.html) Nougat 64 bit ### 识别错误/任务开始后一直不动、没有反应 diff --git a/docs/模拟器支持.md b/docs/模拟器支持.md index 120135a4dd..de579da4df 100644 --- a/docs/模拟器支持.md +++ b/docs/模拟器支持.md @@ -45,9 +45,7 @@ ### 雷电模拟器 -支持。 - -但雷电的连接地址会在 `127.0.0.1:5555` 和 `emulator-5554` 之间反复横跳,不同的电脑还可能会不一样,也有重启就变成另一个了的情况。所以如果一个连不上,可以换另一个试试~ +勉强支持。但雷电可能获取不到分辨率,若一直提示分辨率过低,推荐换别的模拟器 ### 逍遥模拟器 diff --git a/resource/config.json b/resource/config.json index 109624d646..366d834b1d 100644 --- a/resource/config.json +++ b/resource/config.json @@ -13,8 +13,7 @@ "adbExtraSwipeDuration": 1000, "adbExtraSwipeDuration_Doc": "额外的滑动持续时间:adb有bug,同样的参数,偶尔会划得非常远。额外做一个短程滑动,把之前的停下来。若小于0,则关闭额外滑动功能", "penguinReport": { - "Doc": "企鹅数据汇报:每次到结算界面,汇报掉落数据至企鹅数据 https://penguin-stats.cn/。true-开启,false-关闭,默认true", - "enable": true, + "Doc": "企鹅数据汇报: https://penguin-stats.cn/", "cmdFormat": "curl -H \"Content-Type: application/json\" -s -i -d \"[body]\" \"https://penguin-stats.cn/PenguinStats/api/v2/report\" [extra]", "cmdFormat_Doc": "命令格式,想打印详细信息可以尝试添加 -v -i" } @@ -24,7 +23,7 @@ "devices": "[Adb] devices", "addressRegex": "(.+)\tdevice", "connect": "[Adb] connect [Address]", - "uuid": "[Adb] -s [Address] shell \"settings get secure android_id | awk 'NR == 1 {p = $0} NR > 1 {print p; p = $0} END{printf p}' \"", + "uuid": "[Adb] -s [Address] shell settings get secure android_id", "click": "[Adb] -s [Address] shell input tap [x] [y]", "swipe": "[Adb] -s [Address] shell input swipe [x1] [y1] [x2] [y2] [duration]", "display": "[Adb] -s [Address] shell dumpsys window displays | grep init=", @@ -37,7 +36,7 @@ "devices": "[Adb] devices", "addressRegex": "(.+)\tdevice", "connect": "[Adb] connect [Address]", - "uuid": "[Adb] -s [Address] shell \"settings get secure android_id | awk 'NR == 1 {p = $0} NR > 1 {print p; p = $0} END{printf p}' \"", + "uuid": "[Adb] -s [Address] shell settings get secure android_id", "click": "[Adb] -s [Address] shell input tap [x] [y]", "swipe": "[Adb] -s [Address] shell input swipe [x1] [y1] [x2] [y2] [duration]", "display": "[Adb] -s [Address] shell dumpsys window displays | grep init= | awk ' { print $3 } '", @@ -50,7 +49,7 @@ "devices": "[Adb] devices", "addressRegex": "(.+)\tdevice", "connect": "[Adb] connect [Address]", - "uuid": "[Adb] -s [Address] shell \"settings get secure android_id | awk 'NR == 1 {p = $0} NR > 1 {print p; p = $0} END{printf p}' \"", + "uuid": "[Adb] -s [Address] shell settings get secure android_id", "click": "[Adb] -s [Address] shell input tap [x] [y]", "swipe": "[Adb] -s [Address] shell input swipe [x1] [y1] [x2] [y2] [duration]", "display": "[Adb] -s [Address] shell dumpsys window displays | grep init= | awk ' { print $3 } '", @@ -63,7 +62,7 @@ "devices": "[Adb] devices", "addressRegex": "(.+)\tdevice", "connect": "[Adb] connect [Address]", - "uuid": "[Adb] -s [Address] shell \"settings get secure android_id | awk 'NR == 1 {p = $0} NR > 1 {print p; p = $0} END{printf p}' \"", + "uuid": "[Adb] -s [Address] shell settings get secure android_id", "click": "[Adb] -s [Address] shell input tap [x] [y]", "swipe": "[Adb] -s [Address] shell input swipe [x1] [y1] [x2] [y2] [duration]", "display": "[Adb] -s [Address] shell dumpsys window displays | grep init= | awk ' { print $3 } '", @@ -76,7 +75,7 @@ "devices": "[Adb] devices", "addressRegex": "(.+)\tdevice", "connect": "[Adb] connect [Address]", - "uuid": "[Adb] -s [Address] shell \"settings get secure android_id | awk 'NR == 1 {p = $0} NR > 1 {print p; p = $0} END{printf p}' \"", + "uuid": "[Adb] -s [Address] shell settings get secure android_id", "click": "[Adb] -s [Address] shell input tap [x] [y]", "swipe": "[Adb] -s [Address] shell input swipe [x1] [y1] [x2] [y2] [duration]", "display": "[Adb] -s [Address] shell dumpsys window displays | grep init= | awk ' { print $3 } '", @@ -103,7 +102,7 @@ "addressRegex": "(.+)\tdevice", "connect": "[Adb] connect [Address]", "displayId": "[Adb] -s [Address] shell dumpsys display | grep mUniqueId=virtual:com.microsoft.windows.systemapp:com.hypergryph.arknights", - "uuid": "[Adb] -s [Address] shell \"settings get secure android_id | awk 'NR == 1 {p = $0} NR > 1 {print p; p = $0} END{printf p}' \"", + "uuid": "[Adb] -s [Address] shell settings get secure android_id", "click": "[Adb] -s [Address] shell input -d [DisplayId] tap [x] [y]", "swipe": "[Adb] -s [Address] shell input -d [DisplayId] swipe [x1] [y1] [x2] [y2] [duration]", "display": "[Adb] -s [Address] shell \"wm size -d [DisplayId]\"", diff --git a/resource/tasks.json b/resource/tasks.json index d79567c868..933a10e71a 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -4485,7 +4485,7 @@ 232, 374 ], - "rearDelay": 3000 + "rearDelay": 2000 }, "BattleStartRaid": { "action": "ClickSelf", @@ -4495,7 +4495,7 @@ 232, 374 ], - "rearDelay": 3000 + "rearDelay": 2000 }, "BattleStartExercise": { "action": "ClickSelf", @@ -4505,7 +4505,17 @@ 232, 374 ], - "rearDelay": 3000 + "rearDelay": 2000 + }, + "BattleStartSimulation": { + "action": "ClickSelf", + "roi": [ + 417, + 567, + 444, + 153 + ], + "rearDelay": 2000 }, "BattleOperName": { "algorithm": "OcrDetect", diff --git a/resource/template/BattleStartSimulation.png b/resource/template/BattleStartSimulation.png new file mode 100644 index 0000000000..081ac38719 Binary files /dev/null and b/resource/template/BattleStartSimulation.png differ diff --git a/src/MeoAssistant/CopilotTask.cpp b/src/MeoAssistant/CopilotTask.cpp index 99a840675c..4baf8a645a 100644 --- a/src/MeoAssistant/CopilotTask.cpp +++ b/src/MeoAssistant/CopilotTask.cpp @@ -19,7 +19,7 @@ asst::CopilotTask::CopilotTask(AsstCallback callback, void* callback_arg) m_subtasks.emplace_back(m_formation_task_ptr)->set_ignore_error(false); auto start_2_tp = std::make_shared(callback, callback_arg, TaskType); - start_2_tp->set_tasks({ "BattleStartNormal", "BattleStartRaid", "BattleStartExercise" }) + start_2_tp->set_tasks({ "BattleStartNormal", "BattleStartRaid", "BattleStartExercise", "BattleStartSimulation" }) .set_ignore_error(false); m_subtasks.emplace_back(start_2_tp); diff --git a/src/MeoAssistant/DronesForShamareTaskPlugin.cpp b/src/MeoAssistant/DronesForShamareTaskPlugin.cpp index f55c0fbd5f..6698144108 100644 --- a/src/MeoAssistant/DronesForShamareTaskPlugin.cpp +++ b/src/MeoAssistant/DronesForShamareTaskPlugin.cpp @@ -37,6 +37,7 @@ bool asst::DronesForShamareTaskPlugin::_run() } ProcessTask drone_task(*this, { "DroneAssistTrade" }); + drone_task.set_retry_times(5); bool drone_ret = drone_task.run(); if (drone_ret) { m_cast_ptr->set_uses_of_drone("_Used"); diff --git a/src/MeoAssistant/InfrastTask.cpp b/src/MeoAssistant/InfrastTask.cpp index 8ac482852b..a13511ac78 100644 --- a/src/MeoAssistant/InfrastTask.cpp +++ b/src/MeoAssistant/InfrastTask.cpp @@ -27,7 +27,7 @@ asst::InfrastTask::InfrastTask(AsstCallback callback, void* callback_arg) m_dorm_task_ptr(std::make_shared(callback, callback_arg, TaskType)) { m_infrast_begin_task_ptr->set_tasks({ "InfrastBegin" }); - m_trade_task_ptr->regiseter_plugin(); + m_trade_task_ptr->regiseter_plugin()->set_retry_times(0); m_replenish_task_ptr = m_mfg_task_ptr->regiseter_plugin(); m_subtasks.emplace_back(m_infrast_begin_task_ptr); diff --git a/src/MeoAsstGui/Helper/AsstProxy.cs b/src/MeoAsstGui/Helper/AsstProxy.cs index 63a6d51e6a..d620687400 100644 --- a/src/MeoAsstGui/Helper/AsstProxy.cs +++ b/src/MeoAsstGui/Helper/AsstProxy.cs @@ -619,9 +619,19 @@ namespace MeoAsstGui settings.TryToSetBlueStacksHyperVAddress(); bool ret = AsstConnect(_handle, settings.AdbPath, settings.ConnectAddress, settings.ConnectConfig); + + // 尝试默认的备选端口 if (!ret) { - error = "连接失败\n请检查连接设置\n"; + foreach (var address in settings.DefaultAddress[settings.ConnectConfig]) + { + ret = AsstConnect(_handle, settings.AdbPath, address, settings.ConnectConfig); + if (ret) + { + settings.ConnectAddress = address; + break; + } + } } return ret; } diff --git a/src/MeoAsstGui/UserControl/AboutUserControl.xaml b/src/MeoAsstGui/UserControl/AboutUserControl.xaml index c77898b2b1..6a8945c106 100644 --- a/src/MeoAsstGui/UserControl/AboutUserControl.xaml +++ b/src/MeoAsstGui/UserControl/AboutUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="300" d:DesignWidth="550"> diff --git a/src/MeoAsstGui/UserControl/AutoRecruitSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/AutoRecruitSettingsUserControl.xaml index c7a9997955..95945ea915 100644 --- a/src/MeoAsstGui/UserControl/AutoRecruitSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/AutoRecruitSettingsUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="150" d:DesignWidth="300"> diff --git a/src/MeoAsstGui/UserControl/ConnectSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/ConnectSettingsUserControl.xaml index 4e3bc01f5f..d3c25fea9a 100644 --- a/src/MeoAsstGui/UserControl/ConnectSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/ConnectSettingsUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="300" d:DesignWidth="550"> diff --git a/src/MeoAsstGui/UserControl/FightSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/FightSettingsUserControl.xaml index 0d39d07b11..66fd08804a 100644 --- a/src/MeoAsstGui/UserControl/FightSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/FightSettingsUserControl.xaml @@ -6,7 +6,8 @@ xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding" mc:Ignorable="d" - xmlns:local="clr-namespace:MeoAsstGui" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:TaskQueueViewModel}}" d:DesignHeight="200" d:DesignWidth="300"> diff --git a/src/MeoAsstGui/UserControl/InfrastSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/InfrastSettingsUserControl.xaml index 2efc0ffa0b..2090c6e8b8 100644 --- a/src/MeoAsstGui/UserControl/InfrastSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/InfrastSettingsUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="300" d:DesignWidth="550"> diff --git a/src/MeoAsstGui/UserControl/MallSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/MallSettingsUserControl.xaml index d52648ce08..4b9b4f48d8 100644 --- a/src/MeoAsstGui/UserControl/MallSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/MallSettingsUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="300" d:DesignWidth="550"> diff --git a/src/MeoAsstGui/UserControl/PenguinReportSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/PenguinReportSettingsUserControl.xaml index e0c484e88d..d4256e162a 100644 --- a/src/MeoAsstGui/UserControl/PenguinReportSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/PenguinReportSettingsUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="300" d:DesignWidth="550"> diff --git a/src/MeoAsstGui/UserControl/RogueliekSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/RogueliekSettingsUserControl.xaml index 062866d347..b2c0391e88 100644 --- a/src/MeoAsstGui/UserControl/RogueliekSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/RogueliekSettingsUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="300" d:DesignWidth="550"> diff --git a/src/MeoAsstGui/UserControl/ToastSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/ToastSettingsUserControl.xaml index 392a6b8ffb..8efff9a2ff 100644 --- a/src/MeoAsstGui/UserControl/ToastSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/ToastSettingsUserControl.xaml @@ -5,6 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="https://github.com/canton7/Stylet" d:DesignHeight="300" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignWidth="550" mc:Ignorable="d"> diff --git a/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml index 8b9792e536..ce1b6bfbd0 100644 --- a/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="300" d:DesignWidth="550"> diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index 0cba8b3578..07941de1d6 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -132,8 +132,6 @@ namespace MeoAsstGui new CombData { Display = "刷源石锭投资,第一层商店后直接退出", Value = "1" }, new CombData { Display = "刷源石锭投资,投资过后退出", Value = "2" } }; - - ConnectAddressList = new ObservableCollection(); } private bool _idle = true; @@ -154,7 +152,6 @@ namespace MeoAsstGui public List UsesOfDronesList { get; set; } public List RoguelikeModeList { get; set; } public List ConnectConfigList { get; set; } - public ObservableCollection ConnectAddressList { get; set; } private int _dormThreshold = Convert.ToInt32(ViewStatusStorage.Get("Infrast.DormThreshold", "30")); @@ -969,39 +966,6 @@ namespace MeoAsstGui } } - public void QueryAdbDevices() - { - ConnectAddressList.Clear(); - var adbProcess = new Process - { - StartInfo = new ProcessStartInfo - { - FileName = AdbPath, - Arguments = "devices", - UseShellExecute = false, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true, - }, - EnableRaisingEvents = true - }; - - adbProcess.Start(); - adbProcess.WaitForExit(); - string output = adbProcess.StandardOutput.ReadToEnd(); - adbProcess.Close(); - var addressList = new List(output.Split('\n')); - addressList.RemoveAt(0); - foreach (var address in addressList) - { - if (string.IsNullOrWhiteSpace(address)) - continue; - - var device = address.Split('\t')[0]; - ConnectAddressList.Add(device); - } - } - private string _connectConfig = ViewStatusStorage.Get("Connect.ConnectConfig", "General"); public string ConnectConfig @@ -1014,15 +978,15 @@ namespace MeoAsstGui } } - private readonly Dictionary DefaultAddress = new Dictionary + public readonly Dictionary> DefaultAddress = new Dictionary> { - { "General", "" }, - { "BlueStacks", "127.0.0.1:5555" }, - { "MuMuEmulator", "127.0.0.1:7555" }, - { "LDPlayer", "emulator-5554" }, - { "Nox", "127.0.0.1:62001" }, - { "XYAZ", "127.0.0.1:21503" }, - { "WSA","127.0.0.1:58526" }, + { "General", new List{ "" } }, + { "BlueStacks", new List{ "127.0.0.1:5555", "127.0.0.1:5556", "127.0.0.1:5557", "127.0.0.1:5554" } }, + { "MuMuEmulator", new List{ "127.0.0.1:7555", "127.0.0.1:7556" } }, + { "LDPlayer", new List{ "emulator-5554", "127.0.0.1:5555", "127.0.0.1:5556", "127.0.0.1:5554" } }, + { "Nox", new List{ "127.0.0.1:62001", "127.0.0.1:59865" } }, + { "XYAZ", new List{ "127.0.0.1:21503" } }, + { "WSA", new List{ "127.0.0.1:58526" } }, }; public bool RefreshAdbConfig(ref string error) @@ -1053,7 +1017,7 @@ namespace MeoAsstGui if (ConnectAddress.Length == 0) { var addresses = adapter.GetAdbAddresses(AdbPath); - // 傻逼雷电已经关掉了用别的 adb 还能检测出来这个端口 device + // 傻逼雷电已经关掉了,用别的 adb 还能检测出来这个端口 device if (addresses.Count == 1 && addresses.First() != "emulator-5554") { ConnectAddress = addresses.First(); @@ -1073,7 +1037,7 @@ namespace MeoAsstGui if (ConnectAddress.Length == 0) { - ConnectAddress = DefaultAddress[ConnectConfig]; + ConnectAddress = DefaultAddress[ConnectConfig][0]; } } diff --git a/src/MeoAsstGui/Views/CopilotView.xaml b/src/MeoAsstGui/Views/CopilotView.xaml index 4cda0df789..f157fc1276 100644 --- a/src/MeoAsstGui/Views/CopilotView.xaml +++ b/src/MeoAsstGui/Views/CopilotView.xaml @@ -7,6 +7,8 @@ xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding" xmlns:local="clr-namespace:MeoAsstGui" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:CopilotViewModel}}" d:DesignHeight="495" d:DesignWidth="800"> diff --git a/src/MeoAsstGui/Views/RecruitView.xaml b/src/MeoAsstGui/Views/RecruitView.xaml index b8addde8d6..6278ab9170 100644 --- a/src/MeoAsstGui/Views/RecruitView.xaml +++ b/src/MeoAsstGui/Views/RecruitView.xaml @@ -5,6 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:s="https://github.com/canton7/Stylet" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:RecruitViewModel}}" d:DesignHeight="495" d:DesignWidth="800"> diff --git a/src/MeoAsstGui/Views/RootView.xaml b/src/MeoAsstGui/Views/RootView.xaml index 5b4eaa2ab9..deb94dfb63 100644 --- a/src/MeoAsstGui/Views/RootView.xaml +++ b/src/MeoAsstGui/Views/RootView.xaml @@ -5,6 +5,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="https://github.com/canton7/Stylet" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:RootViewModel}}" Title="{Binding WindowTitle}" Height="595" Width="800"> diff --git a/src/MeoAsstGui/Views/SettingsView.xaml b/src/MeoAsstGui/Views/SettingsView.xaml index e20ef6381a..4b5ee02d1c 100644 --- a/src/MeoAsstGui/Views/SettingsView.xaml +++ b/src/MeoAsstGui/Views/SettingsView.xaml @@ -7,6 +7,8 @@ xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding" xmlns:local="clr-namespace:MeoAsstGui" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:SettingsViewModel}}" d:DesignHeight="495" d:DesignWidth="800"> diff --git a/src/MeoAsstGui/Views/TaskQueueView.xaml b/src/MeoAsstGui/Views/TaskQueueView.xaml index 89e52a48ac..d22642dda5 100644 --- a/src/MeoAsstGui/Views/TaskQueueView.xaml +++ b/src/MeoAsstGui/Views/TaskQueueView.xaml @@ -8,6 +8,8 @@ xmlns:local="clr-namespace:MeoAsstGui" xmlns:dd="urn:gong-wpf-dragdrop" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:TaskQueueViewModel}}" d:DesignHeight="495" d:DesignWidth="800"> diff --git a/src/MeoAsstGui/Views/VersionUpdateView.xaml b/src/MeoAsstGui/Views/VersionUpdateView.xaml index 30de8c3bc1..71616837c9 100644 --- a/src/MeoAsstGui/Views/VersionUpdateView.xaml +++ b/src/MeoAsstGui/Views/VersionUpdateView.xaml @@ -6,6 +6,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:md="clr-namespace:Neo.Markdig.Xaml;assembly=Neo.Markdig.Xaml" mc:Ignorable="d" + xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui" + d:DataContext="{d:DesignInstance {x:Type vm:VersionUpdateViewModel}}" Title="版本已更新" Height="500" Width="600">