diff --git a/src/MaaWpfGui/Constants/UILogColor.cs b/src/MaaWpfGui/Constants/UILogColor.cs index e680840edc..8978fab1e5 100644 --- a/src/MaaWpfGui/Constants/UILogColor.cs +++ b/src/MaaWpfGui/Constants/UILogColor.cs @@ -59,6 +59,11 @@ namespace MaaWpfGui.Constants /// public const string Download = "DownloadLogBrush"; + /// + /// The recommended color for special screenshot. + /// + public const string SpecialScreenshot = "HighlightBrush"; + // 颜色在MaaWpfGui\Res\Themes中定义 // Brush are defined in MaaWpfGui\Res\Themes } diff --git a/src/MaaWpfGui/Main/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs index 6773261e62..6befc6b844 100644 --- a/src/MaaWpfGui/Main/AsstProxy.cs +++ b/src/MaaWpfGui/Main/AsstProxy.cs @@ -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; diff --git a/src/MaaWpfGui/Res/Themes/Dark.xaml b/src/MaaWpfGui/Res/Themes/Dark.xaml index 65991db3dd..7066219e1c 100644 --- a/src/MaaWpfGui/Res/Themes/Dark.xaml +++ b/src/MaaWpfGui/Res/Themes/Dark.xaml @@ -33,7 +33,7 @@ - + @@ -43,4 +43,5 @@ + diff --git a/src/MaaWpfGui/Res/Themes/Light.xaml b/src/MaaWpfGui/Res/Themes/Light.xaml index 1ec11ea0f9..e8bca1ec31 100644 --- a/src/MaaWpfGui/Res/Themes/Light.xaml +++ b/src/MaaWpfGui/Res/Themes/Light.xaml @@ -14,7 +14,7 @@ - + @@ -25,4 +25,5 @@ +