mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
chore: 添加截图过长解决方案
This commit is contained in:
@@ -460,19 +460,23 @@ namespace MaaWpfGui.Main
|
||||
|
||||
StringBuilder fastestScreencapStringBuilder = new();
|
||||
string color = UiLogColor.Trace;
|
||||
if (!int.TryParse(costString, out var timeCost))
|
||||
if (int.TryParse(costString, out var timeCost))
|
||||
{
|
||||
switch (timeCost)
|
||||
{
|
||||
case > 800:
|
||||
color = UiLogColor.Error;
|
||||
costString = timeCost.ToString("#,#");
|
||||
break;
|
||||
case > 400:
|
||||
color = UiLogColor.Warning;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
color = UiLogColor.Error;
|
||||
}
|
||||
else if (timeCost > 800)
|
||||
{
|
||||
color = UiLogColor.Error;
|
||||
costString = timeCost.ToString("#,#");
|
||||
}
|
||||
else if (timeCost > 400)
|
||||
{
|
||||
color = UiLogColor.Warning;
|
||||
}
|
||||
|
||||
fastestScreencapStringBuilder.Insert(0, string.Format(LocalizationHelper.GetString("FastestWayToScreencap"), costString));
|
||||
Instances.TaskQueueViewModel.AddLog(fastestScreencapStringBuilder.ToString(), color);
|
||||
@@ -481,21 +485,32 @@ namespace MaaWpfGui.Main
|
||||
|
||||
break;
|
||||
case "ScreencapCost":
|
||||
Instances.SettingsViewModel.ScreencapCost = string.Format(LocalizationHelper.GetString("ScreencapCost"), details["details"]?["min"]?.ToString() ?? "???", details["details"]?["avg"]?.ToString() ?? "???", details["details"]?["max"]?.ToString() ?? "???", DateTimeOffset.Now.ToString("HH:mm:ss"));
|
||||
if (HasPrintedScreencapWarning || !int.TryParse(details["details"]?["avg"]?.ToString() ?? "???", out var screencapCostAvg))
|
||||
var screencapCostMin = details["details"]?["min"]?.ToString() ?? "???";
|
||||
var screencapCostAvg = details["details"]?["avg"]?.ToString() ?? "???";
|
||||
var screencapCostMax = details["details"]?["max"]?.ToString() ?? "???";
|
||||
var currentTime = DateTimeOffset.Now.ToString("HH:mm:ss");
|
||||
Instances.SettingsViewModel.ScreencapCost = string.Format(LocalizationHelper.GetString("ScreencapCost"), screencapCostMin, screencapCostAvg, screencapCostMax, currentTime);
|
||||
if (!HasPrintedScreencapWarning && int.TryParse(screencapCostAvg, out var screencapCostAvgInt))
|
||||
{
|
||||
}
|
||||
else if (screencapCostAvg >= 800)
|
||||
{
|
||||
Instances.TaskQueueViewModel.AddLog(string.Format(LocalizationHelper.GetString("FastestWayToScreencapErrorTip"), screencapCostAvg), UiLogColor.Error);
|
||||
Instances.CopilotViewModel.AddLog(string.Format(LocalizationHelper.GetString("FastestWayToScreencapErrorTip"), screencapCostAvg), UiLogColor.Error);
|
||||
HasPrintedScreencapWarning = true;
|
||||
}
|
||||
else if (screencapCostAvg >= 400)
|
||||
{
|
||||
Instances.TaskQueueViewModel.AddLog(string.Format(LocalizationHelper.GetString("FastestWayToScreencapWarningTip"), screencapCostAvg), UiLogColor.Warning);
|
||||
Instances.CopilotViewModel.AddLog(string.Format(LocalizationHelper.GetString("FastestWayToScreencapWarningTip"), screencapCostAvg), UiLogColor.Warning);
|
||||
HasPrintedScreencapWarning = true;
|
||||
static void AddLog(string message, string color)
|
||||
{
|
||||
Instances.TaskQueueViewModel.AddLog(message, color);
|
||||
Instances.CopilotViewModel.AddLog(message, color);
|
||||
}
|
||||
|
||||
switch (screencapCostAvgInt)
|
||||
{
|
||||
case >= 800:
|
||||
AddLog(string.Format(LocalizationHelper.GetString("FastestWayToScreencapErrorTip"), screencapCostAvgInt), UiLogColor.Error);
|
||||
AddLog(string.Format(LocalizationHelper.GetString("OptimizationTips"), screencapCostAvgInt), UiLogColor.Error);
|
||||
HasPrintedScreencapWarning = true;
|
||||
break;
|
||||
case >= 400:
|
||||
AddLog(string.Format(LocalizationHelper.GetString("FastestWayToScreencapWarningTip"), screencapCostAvgInt), UiLogColor.Warning);
|
||||
AddLog(string.Format(LocalizationHelper.GetString("OptimizationTips"), screencapCostAvgInt), UiLogColor.Warning);
|
||||
HasPrintedScreencapWarning = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -587,6 +587,7 @@ The video aspect ratio needs to be 16:9 without interference factors such as bla
|
||||
<system:String x:Key="FastestWayToScreencap">Screenshot test tasks: {0}ms</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapWarningTip">Screencap takes a long time (avg: {0}ms) which may cause some abnormal behaviors using automatic combat functions (e.g. Auto I. S.).</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">Screencap takes too long (avg: {0}ms), so automatic combat functions (e.g. Auto I. S.) may not run properly. It is recommended to try restarting or changing the simulator!</system:String>
|
||||
<system:String x:Key="OptimizationTips">This time consumption is unrelated to MAA, but related to computer performance, current usage, or emulator. You can try cleaning up background processes, changing emulators, or upgrading computer configurations.</system:String>
|
||||
<system:String x:Key="IdentifyTheMistakes">Recognition error</system:String>
|
||||
<system:String x:Key="TaskError" xml:space="preserve">Task error: </system:String>
|
||||
<system:String x:Key="CombatError">Combat error</system:String>
|
||||
|
||||
@@ -586,7 +586,8 @@ Bilibili: ログイン インターフェイスに表示されるアカウント
|
||||
<system:String x:Key="ScreencapFailed">スクリーンキャプチャに失敗しました。繰り返し発生する場合は、エミュレータの再起動または変更をお試しください!</system:String>
|
||||
<system:String x:Key="FastestWayToScreencap">スクリーンショット テストには: {0}ms</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapWarningTip">スクリーンキャップには時間がかかるため(平均: {0}ms)、自動戦闘機能 (Auto I.S. など) を使用すると異常な動作が発生する可能性があります。</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">スクリーンキャップに時間がかかりすぎるため(平均: {0}ms)、自動戦闘機能 (Auto I.S. など) が適切に動作しない可能性があります。 シミュレーターを再起動または変更してみることをお勧めします。</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">スクリーンキャップに時間がかかりすぎるため(平均: {0}ms)、自動戦闘機能 (Auto I.S. など) が適切に動作しない可能性があります。</system:String>
|
||||
<system:String x:Key="OptimizationTips">この時間の消費はMAAとは関係ありませんが、コンピューターのパフォーマンス、現在の使用状況、またはエミュレーターに関連しています。バックグラウンドプロセスをクリーンアップしたり、エミュレーターを変更したり、コンピューターの構成をアップグレードすることができます。</system:String>
|
||||
<system:String x:Key="IdentifyTheMistakes">認識エラー</system:String>
|
||||
<system:String x:Key="TaskError" xml:space="preserve">タスクエラー: </system:String>
|
||||
<system:String x:Key="CombatError">戦闘エラー</system:String>
|
||||
|
||||
@@ -587,6 +587,7 @@ Bilibili: 로그인 인터페이스에 표시되는 계정 이름(예: 장산)
|
||||
<system:String x:Key="FastestWayToScreencap">스크린샷 캡쳐 속도: {0}ms</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapWarningTip">스크린샷 캡쳐 속도가 느리므로 (평균: {0}ms) 자동 전투 기능(예: Copilot)을 사용하면 비정상적인 동작이 발생할 수 있습니다.</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">스크린샷 캡쳐 속도가 느리므로 (평균: {0}ms) 자동 전투 기능(예: Copilot)이 제대로 실행되지 않을 수 있습니다. 시뮬레이터를 다시 시작하거나 변경해 보는 것이 좋습니다!</system:String>
|
||||
<system:String x:Key="OptimizationTips">이 시간 소모는 MAA와 무관하지만 컴퓨터 성능, 현재 사용량 또는 에뮬레이터와 관련이 있습니다. 백그라운드 프로세스를 정리하거나, 에뮬레이터를 변경하거나, 컴퓨터 구성을 업그레이드해 볼 수 있습니다.</system:String>
|
||||
<system:String x:Key="IdentifyTheMistakes">인식 오류</system:String>
|
||||
<system:String x:Key="TaskError" xml:space="preserve">작업 오류: </system:String>
|
||||
<system:String x:Key="CombatError">작전 오류</system:String>
|
||||
|
||||
@@ -585,8 +585,9 @@
|
||||
<system:String x:Key="TouchModeNotAvailable">触控模式不可用。请进入 设置 - 连接设置 切换其他触控模式。</system:String>
|
||||
<system:String x:Key="ScreencapFailed">截图失败,如反复出现请尝试重启或更换模拟器!</system:String>
|
||||
<system:String x:Key="FastestWayToScreencap">最快截图耗时: {0}ms</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapWarningTip">截图用时较长(平均: {0}ms),使用自动战斗类功能(如自动肉鸽)时,可能出现部分异常表现</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">截图用时过长(平均: {0}ms),自动战斗类功能(如自动肉鸽)很可能无法正常运行,建议尝试重启或更换模拟器</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapWarningTip">截图用时较长(平均: {0}ms),使用自动战斗类功能(如自动肉鸽)时,可能出现部分异常表现。</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">截图用时过长(平均: {0}ms),自动战斗类功能(如自动肉鸽)很可能无法正常运行,建议尝试重启或更换模拟器。</system:String>
|
||||
<system:String x:Key="OptimizationTips">此项耗时与MAA无关,与电脑性能、当前占用或模拟器相关,可尝试清理后台/更换模拟器/升级电脑配置</system:String>
|
||||
<system:String x:Key="IdentifyTheMistakes">识别错误</system:String>
|
||||
<system:String x:Key="TaskError" xml:space="preserve">任务出错: </system:String>
|
||||
<system:String x:Key="CombatError">战斗出错</system:String>
|
||||
|
||||
@@ -583,8 +583,9 @@
|
||||
<system:String x:Key="TouchModeNotAvailable">觸控模式不可用。請進入 設定 - 連接設定 切換其他觸控模式。</system:String>
|
||||
<system:String x:Key="ScreencapFailed">截圖失敗,如反覆出現請嘗試重開或更換模擬器!</system:String>
|
||||
<system:String x:Key="FastestWayToScreencap">最快截圖用時: {0}ms</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapWarningTip">截圖用時較長(平均: {0}ms),使用自動戰鬥類功能(如自動肉鴿)時,可能會出現部分異常表現</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">截圖用時過長(平均: {0}ms),自動戰鬥類功能(如自動肉鴿)很可能無法正常運行,建議嘗試重新啟動或更換模擬器</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapWarningTip">截圖用時較長(平均: {0}ms),使用自動戰鬥類功能(如自動肉鴿)時,可能會出現部分異常表現。</system:String>
|
||||
<system:String x:Key="FastestWayToScreencapErrorTip">截圖用時過長(平均: {0}ms),自動戰鬥類功能(如自動肉鴿)很可能無法正常運行,建議嘗試重新啟動或更換模擬器。</system:String>
|
||||
<system:String x:Key="OptimizationTips">此項耗時與MAA無關,與電腦性能、當前佔用或模擬器相關,可嘗試清理後臺/更換模擬器/升級電腦配置。</system:String>
|
||||
<system:String x:Key="IdentifyTheMistakes">辨識錯誤</system:String>
|
||||
<system:String x:Key="TaskError" xml:space="preserve">任務出錯: </system:String>
|
||||
<system:String x:Key="CombatError">戰鬥出錯</system:String>
|
||||
|
||||
Reference in New Issue
Block a user