mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
perf: 优化截图增强显示
This commit is contained in:
@@ -59,6 +59,11 @@ namespace MaaWpfGui.Constants
|
||||
/// </summary>
|
||||
public const string Download = "DownloadLogBrush";
|
||||
|
||||
/// <summary>
|
||||
/// The recommended color for special screenshot.
|
||||
/// </summary>
|
||||
public const string SpecialScreenshot = "HighlightBrush";
|
||||
|
||||
// 颜色在MaaWpfGui\Res\Themes中定义
|
||||
// Brush are defined in MaaWpfGui\Res\Themes
|
||||
}
|
||||
|
||||
@@ -493,6 +493,7 @@ namespace MaaWpfGui.Main
|
||||
{
|
||||
string costString = details["details"]?["cost"]?.ToString() ?? "???";
|
||||
string method = details["details"]?["method"]?.ToString() ?? "???";
|
||||
Instances.SettingsViewModel.ScreencapMethod = method;
|
||||
|
||||
StringBuilder fastestScreencapStringBuilder = new();
|
||||
string color = UiLogColor.Trace;
|
||||
@@ -515,21 +516,37 @@ namespace MaaWpfGui.Main
|
||||
color = UiLogColor.Error;
|
||||
}
|
||||
|
||||
fastestScreencapStringBuilder.Insert(0, string.Format(LocalizationHelper.GetString("FastestWayToScreencap"), costString, method));
|
||||
Instances.TaskQueueViewModel.AddLog(fastestScreencapStringBuilder.ToString(), color);
|
||||
Instances.CopilotViewModel.AddLog(fastestScreencapStringBuilder.ToString(), color, showTime: false);
|
||||
|
||||
var needToStop = false;
|
||||
switch (Instances.SettingsViewModel.ConnectConfig)
|
||||
{
|
||||
case "MuMuEmulator12":
|
||||
if (Instances.SettingsViewModel.MuMuEmulator12Extras.Enable && method != "MumuExtras")
|
||||
{
|
||||
Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("MuMuExtrasNotEnabledMessage"), UiLogColor.Warning);
|
||||
Instances.CopilotViewModel.AddLog(LocalizationHelper.GetString("MuMuExtrasNotEnabledMessage"), UiLogColor.Warning, showTime: false);
|
||||
Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("MuMuExtrasNotEnabledMessage"), UiLogColor.Error);
|
||||
Instances.CopilotViewModel.AddLog(LocalizationHelper.GetString("MuMuExtrasNotEnabledMessage"), UiLogColor.Error, showTime: false);
|
||||
needToStop = true;
|
||||
}
|
||||
else if (timeCost < 100)
|
||||
{
|
||||
color = UiLogColor.SpecialScreenshot;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
fastestScreencapStringBuilder.Insert(0, string.Format(LocalizationHelper.GetString("FastestWayToScreencap"), costString, method));
|
||||
Instances.TaskQueueViewModel.AddLog(fastestScreencapStringBuilder.ToString(), color);
|
||||
Instances.CopilotViewModel.AddLog(fastestScreencapStringBuilder.ToString(), color, showTime: false);
|
||||
|
||||
// 截图增强未生效自动停止一次,再开就不管了
|
||||
if (needToStop)
|
||||
{
|
||||
Execute.OnUIThreadAsync(async () =>
|
||||
{
|
||||
await Instances.TaskQueueViewModel.Stop();
|
||||
Instances.TaskQueueViewModel.SetStopped();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<SolidColorBrush x:Key="MdXamlForeground" Color="#E6E6E6" />
|
||||
<SolidColorBrush x:Key="MdXamlHyperlink" Color="#326cf3" />
|
||||
<SolidColorBrush x:Key="MdXamlHyperlinkClicked" Color="#e45649" />
|
||||
|
||||
|
||||
<!-- UiLogColor -->
|
||||
<SolidColorBrush x:Key="ErrorLogBrush" Color="Red" />
|
||||
<SolidColorBrush x:Key="WarningLogBrush" Color="Goldenrod" />
|
||||
@@ -43,4 +43,5 @@
|
||||
<SolidColorBrush x:Key="RareOperatorLogBrush" Color="Orange" />
|
||||
<SolidColorBrush x:Key="RobotOperatorLogBrush" Color="Gray" />
|
||||
<SolidColorBrush x:Key="DownloadLogBrush" Color="Violet" />
|
||||
<SolidColorBrush x:Key="HighlightBrush" Color="DeepSkyBlue" />
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<SolidColorBrush x:Key="MdXamlForeground" Color="#212121" />
|
||||
<SolidColorBrush x:Key="MdXamlHyperlink" Color="#326cf3" />
|
||||
<SolidColorBrush x:Key="MdXamlHyperlinkClicked" Color="#ff0000" />
|
||||
|
||||
|
||||
|
||||
<!-- UiLogColor -->
|
||||
<SolidColorBrush x:Key="ErrorLogBrush" Color="DarkRed" />
|
||||
@@ -25,4 +25,5 @@
|
||||
<SolidColorBrush x:Key="RareOperatorLogBrush" Color="DarkOrange" />
|
||||
<SolidColorBrush x:Key="RobotOperatorLogBrush" Color="DarkGray" />
|
||||
<SolidColorBrush x:Key="DownloadLogBrush" Color="BlueViolet" />
|
||||
<SolidColorBrush x:Key="HighlightBrush" Color="DodgerBlue" />
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user