diff --git a/src/MaaCore/Controller/AdbController.cpp b/src/MaaCore/Controller/AdbController.cpp index b97d5eb6f5..f5a5afd6bb 100644 --- a/src/MaaCore/Controller/AdbController.cpp +++ b/src/MaaCore/Controller/AdbController.cpp @@ -427,6 +427,16 @@ bool asst::AdbController::screencap(cv::Mat& image_payload, bool allow_reconnect { AdbProperty::ScreencapMethod::Encode, "Encode" }, }; Log.info("The fastest way is", MethodName.at(m_adb.screencap_method), ", cost:", min_cost.count(), "ms"); + json::value info = json::object { + { "uuid", m_uuid }, + { "what", "FastestWayToScreencap" }, + { "details", + json::object { + { "method", MethodName.at(m_adb.screencap_method) }, + { "cost", min_cost.count() }, + } }, + }; + callback(AsstMsg::ConnectionInfo, info); clear_lf_info(); return m_adb.screencap_method != AdbProperty::ScreencapMethod::UnknownYet; } break; diff --git a/src/MaaWpfGui/Main/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs index 3d052fd8ae..f214500575 100644 --- a/src/MaaWpfGui/Main/AsstProxy.cs +++ b/src/MaaWpfGui/Main/AsstProxy.cs @@ -455,6 +455,29 @@ namespace MaaWpfGui.Main case "TouchModeNotAvailable": Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("TouchModeNotAvailable"), UiLogColor.Error); break; + + case "FastestWayToScreencap": + var detailsObj = details["details"]; + string costString = detailsObj?["cost"]?.ToString() ?? "???"; + string method = detailsObj?["method"]?.ToString() ?? "???"; + + string color = UiLogColor.Trace; + if (!int.TryParse(costString, out var timeCost)) + { + color = UiLogColor.Error; + } + else if (timeCost > 800) + { + color = UiLogColor.Error; + } + else if (timeCost > 400) + { + color = UiLogColor.Warning; + } + + string logMessage = string.Format(LocalizationHelper.GetString("FastestWayToScreencap"), method, costString); + Instances.TaskQueueViewModel.AddLog(logMessage, color); + break; } } diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index da35d0dcb7..d79d00cb66 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -557,6 +557,7 @@ The video aspect ratio needs to be 16:9 without interference factors such as bla Reconnection failed. The connection is down! Touch mode is not available, please go to 「Settings - Connection Settings」 to switch to a different touch mode. Screencap failed. If it happens repeatedly, try to restart or change the emulator! + Fastest screenshot method: {0} ({1:#,#}ms) Recognition error Task error: Combat error diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index 896b83624b..21dfd0a3c8 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -557,6 +557,7 @@ Bilibili: ログイン インターフェイスに表示されるアカウント 再接続に失敗、切断されました! タッチモードは利用できません。設定-接続設定に入って、他のタッチモードに変更してください。 スクリーンキャプチャに失敗しました。繰り返し発生する場合は、エミュレータの再起動または変更をお試しください! + 最速のスクリーンショット方法: {0} ({1:#,#}ms) 認識エラー タスクエラー: 戦闘エラー diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index 0c26d9b42b..1c0ae00c2e 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -557,6 +557,7 @@ Bilibili: 로그인 인터페이스에 표시되는 계정 이름(예: 장산) 다시 연결하지 못했습니다. 연결 해제되었습니다! 터치 수행 방식이 사용 불가능합니다. 설정 - 연결 설정에서 다른 방식으로 변경해 주세요. 스크린샷 캡처에 실패했습니다. 반복적으로 발생 시 에뮬레이터를 다시 시작하거나 변경해 보세요! + 가장 빠른 스크린샷 방법: {0} ({1:#,#}ms) 인식 오류 작업 오류: 작전 오류 diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 2bbcb5ccd9..1b2b9e3a03 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -557,6 +557,7 @@ 重连失败,连接断开! 触控模式不可用。请进入 设置 - 连接设置 切换其他触控模式。 截图失败,如反复出现请尝试重启或更换模拟器! + 最快截图: {0} ({1:#,#}ms) 识别错误 任务出错: 战斗出错 diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index 67ab54cf25..8a46ea731d 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -557,6 +557,7 @@ 重連失敗,連接斷開! 觸控模式不可用。請進入 設定 - 連接設定 切換其他觸控模式。 截圖失敗,如反覆出現請嘗試重開或更換模擬器! + 最快截圖: {0} ({1:#,#}ms) 辨識錯誤 任務出錯: 戰鬥出錯