diff --git a/src/MaaWpfGui/Main/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs index 55e7c68e75..e1775958bb 100644 --- a/src/MaaWpfGui/Main/AsstProxy.cs +++ b/src/MaaWpfGui/Main/AsstProxy.cs @@ -971,7 +971,8 @@ namespace MaaWpfGui.Main var missingOpers = details["details"]?["opers"]?.ToObject>>(); if (missingOpers is not null) { - var missingOpersStr = "[" + string.Join("]; [", missingOpers.Select(opers => string.Join(", ", opers))) + "]"; + var missingOpersStr = "[" + string.Join("]; [", missingOpers.Select(opers => + string.Join(", ", opers.Select(oper => DataHelper.GetLocalizedCharacterName(oper))))) + "]"; Instances.CopilotViewModel.AddLog(LocalizationHelper.GetString("MissingOperators") + missingOpersStr, UiLogColor.Error); } else @@ -1393,11 +1394,12 @@ namespace MaaWpfGui.Main } case "BattleFormation": - Instances.CopilotViewModel.AddLog(LocalizationHelper.GetString("BattleFormation") + "\n" + JsonConvert.SerializeObject(subTaskDetails!["formation"])); + Instances.CopilotViewModel.AddLog(LocalizationHelper.GetString("BattleFormation") + "\n[" + + string.Join(", ", subTaskDetails!["formation"]?.ToObject>().Select(oper => DataHelper.GetLocalizedCharacterName(oper))) + "]"); break; case "BattleFormationSelected": - Instances.CopilotViewModel.AddLog(LocalizationHelper.GetString("BattleFormationSelected") + subTaskDetails!["selected"]); + Instances.CopilotViewModel.AddLog(LocalizationHelper.GetString("BattleFormationSelected") + DataHelper.GetLocalizedCharacterName(subTaskDetails!["selected"]?.ToString())); break; case "CopilotAction": diff --git a/src/MaaWpfGui/ViewModels/UI/RecognizerViewModel.cs b/src/MaaWpfGui/ViewModels/UI/RecognizerViewModel.cs index ab51a3f6b0..0b4f0cdefa 100644 --- a/src/MaaWpfGui/ViewModels/UI/RecognizerViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/RecognizerViewModel.cs @@ -316,8 +316,8 @@ namespace MaaWpfGui.ViewModels.UI foreach (var oper in (JArray?)combs["opers"] ?? []) { int operLevel = (int)oper["level"]; - string operId = oper["id"]?.ToString(); - string operName = oper["name"]?.ToString(); + var operId = oper["id"]?.ToString(); + var operName = DataHelper.GetLocalizedCharacterName(oper["name"]?.ToString()); string potential = string.Empty; @@ -617,7 +617,16 @@ namespace MaaWpfGui.ViewModels.UI List> operHave = []; List> operNotHave = []; - string localizedName = ConfigurationHelper.GetValue(ConfigurationKeys.Localization, string.Empty) switch + string localizedName = ConfigurationHelper.GetValue(ConfigurationKeys.OperNameLanguage, string.Empty) == "OperNameLanguageClient" ? + ConfigurationHelper.GetValue(ConfigurationKeys.ClientType, string.Empty) switch + { + "Official" => "name", + "Bilibili" => "name", + "YoStarJP" => "name_jp", + "YoStarKR" => "name_kr", + "txwy" => "name_tw", + _ => "name_en", + } : ConfigurationHelper.GetValue(ConfigurationKeys.Localization, string.Empty) switch { "zh-cn" => "name", "ja-jp" => "name_jp",