From 792e7bb6811071a7e34a3e8ba6b88155e3b956cd Mon Sep 17 00:00:00 2001 From: ManicSteiner Date: Sun, 4 Aug 2024 23:50:30 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E9=80=89?= =?UTF-8?q?=E6=8B=A9WPFGUI=E4=B8=AD=E7=9A=84=E5=B9=B2=E5=91=98=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=98=BE=E7=A4=BA=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Constants/ConfigurationKeys.cs | 1 + src/MaaWpfGui/Helper/DataHelper.cs | 2 +- src/MaaWpfGui/Res/Localizations/zh-cn.xaml | 3 + .../ViewModels/UI/SettingsViewModel.cs | 56 ++++++++++++++++++- .../UserControl/GUISettingsUserControl.xaml | 11 ++++ 5 files changed, 71 insertions(+), 2 deletions(-) diff --git a/src/MaaWpfGui/Constants/ConfigurationKeys.cs b/src/MaaWpfGui/Constants/ConfigurationKeys.cs index e6959c23ce..5f4560afaf 100644 --- a/src/MaaWpfGui/Constants/ConfigurationKeys.cs +++ b/src/MaaWpfGui/Constants/ConfigurationKeys.cs @@ -30,6 +30,7 @@ namespace MaaWpfGui.Constants public const string ConfigurationCron = "Cron"; public const string Localization = "GUI.Localization"; + public const string OperNameLanguage = "GUI.OperNameLanguage"; public const string UseTray = "GUI.UseTray"; public const string MinimizeToTray = "GUI.MinimizeToTray"; public const string HideCloseButton = "GUI.HideCloseButton"; diff --git a/src/MaaWpfGui/Helper/DataHelper.cs b/src/MaaWpfGui/Helper/DataHelper.cs index d35966fd66..a8b30d7b9b 100644 --- a/src/MaaWpfGui/Helper/DataHelper.cs +++ b/src/MaaWpfGui/Helper/DataHelper.cs @@ -100,7 +100,7 @@ namespace MaaWpfGui.Helper return null; } - language ??= Instances.SettingsViewModel.Language; + language ??= Instances.SettingsViewModel.OperNameLocalization; return language switch { diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 440ec682e9..382bc92247 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -404,6 +404,9 @@ 自动肉鸽 生息演算·沙中之火 生息演算·沙洲遗闻 + 干员名称显示语言 + 跟随MAA + 跟随游戏客户端 亮色 暗色 与系统同步 diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index 91a3726f83..df6b6b9fa3 100644 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -1936,7 +1936,7 @@ namespace MaaWpfGui.ViewModels.UI continue; } - var localizedName = DataHelper.GetLocalizedCharacterName(name, _language); + var localizedName = DataHelper.GetLocalizedCharacterName(name, OperNameLocalization); if (!string.IsNullOrEmpty(localizedName) && !(_clientType.Contains("YoStar") && DataHelper.GetLocalizedCharacterName(name, "en-us") == DataHelper.GetLocalizedCharacterName(name, "zh-cn"))) { roguelikeCoreCharList.Add(localizedName); @@ -4428,6 +4428,15 @@ namespace MaaWpfGui.ViewModels.UI /// public List LanguageList { get; set; } + /// + /// Gets the list of operator name language settings + /// + public List OperNameLanguageModeList { get; } = + [ + new() { Display = LocalizationHelper.GetString("OperNameLanguageMAA"), Value = "OperNameLanguageMAA" }, + new() { Display = LocalizationHelper.GetString("OperNameLanguageClient"), Value = "OperNameLanguageClient" } + ]; + /// /// Gets the list of dark mode. /// @@ -4763,6 +4772,51 @@ namespace MaaWpfGui.ViewModels.UI } } + private static readonly Dictionary _clientLanguageMapper = new() + { + { string.Empty, "zh-cn" }, + { "Official", "zh-cn" }, + { "Bilibili", "zh-cn" }, + { "YoStarEN", "en-us" }, + { "YoStarJP", "ja-jp" }, + { "YoStarKR", "ko-kr" }, + { "txwy", "zh-tw" }, + }; + + private string _operNameLanguage = ConfigurationHelper.GetValue(ConfigurationKeys.OperNameLanguage, "OperNameLanguageMAA"); + + public string OperNameLanguage + { + get => _operNameLanguage; + + set + { + switch (value) + { + case "OperNameLanguageClient": + ConfigurationHelper.SetValue(ConfigurationKeys.OperNameLanguage, value); + break; + case "OperNameLanguageMAA": + default: + ConfigurationHelper.SetValue(ConfigurationKeys.OperNameLanguage, "OperNameLanguageMAA"); + break; + } + } + } + + public string OperNameLocalization + { + get + { + if (_operNameLanguage == "OperNameLanguageClient") + { + return _clientLanguageMapper[ConfigurationHelper.GetValue(ConfigurationKeys.ClientType, string.Empty)]; + } + + return _language; + } + } + #endregion #region HotKey diff --git a/src/MaaWpfGui/Views/UserControl/GUISettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/GUISettingsUserControl.xaml index 99997ae69f..3807cf8091 100644 --- a/src/MaaWpfGui/Views/UserControl/GUISettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/GUISettingsUserControl.xaml @@ -93,6 +93,17 @@ SelectedValue="{Binding Language}" SelectedValuePath="Value" Style="{StaticResource ComboBoxExtend}" /> + Date: Mon, 5 Aug 2024 14:06:55 +0800 Subject: [PATCH 2/7] chore: OperNameLanguage i18n --- src/MaaWpfGui/Res/Localizations/en-us.xaml | 3 +++ src/MaaWpfGui/Res/Localizations/ja-jp.xaml | 3 +++ src/MaaWpfGui/Res/Localizations/ko-kr.xaml | 3 +++ src/MaaWpfGui/Res/Localizations/zh-tw.xaml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index e826437f11..aa09731620 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -401,6 +401,9 @@ Only supports Official(CN) and Bilibili server. Login account is not supported.< Auto I.S. Reclamation Algorithm Reclamation Algorithm #2 + Operator name display language + Follow MAA + Follow game client Light Dark Sync with OS diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index b122300b8c..cf9e5f58aa 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -400,6 +400,9 @@ 自動ローグ 生息演算「砂中の火」 生息演算「沙洲遺聞」 + オペレーター名の表示言語 + MAAをフォローする + ゲームクライアントをフォローする ライトモード ダークモード OSと同期する diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index 19b662e155..2317d698dd 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -403,6 +403,9 @@ OF-1을 해금하지 않았다면 선택하지 말아 주세요. 통합전략 생명연산·모래 속의 불 생명연산·沙洲遗闻 + 간부 이름 표시 언어 + MAA 따라가기 + 게임 클라이언트 따라가기 라이트 다크 시스템 연동 diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index d98a879079..852085b93a 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -394,6 +394,9 @@ 自動肉鴿 生息演算·沙中之火 生息演算·沙洲遺聞 + 幹員名稱顯示語言 + 跟隨MAA + 跟隨遊戲客戶端 亮色 暗色 與系統同步 From 7743ee3e06eb55159db167aa8bd842afb9a0ef96 Mon Sep 17 00:00:00 2001 From: ManicSteiner Date: Mon, 5 Aug 2024 14:09:43 +0800 Subject: [PATCH 3/7] feat: restart MAA after change OperNameLanguage --- .../ViewModels/UI/SettingsViewModel.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index df6b6b9fa3..9f53fdf73b 100644 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -4791,6 +4791,11 @@ namespace MaaWpfGui.ViewModels.UI set { + if (value == _operNameLanguage) + { + return; + } + switch (value) { case "OperNameLanguageClient": @@ -4801,6 +4806,29 @@ namespace MaaWpfGui.ViewModels.UI ConfigurationHelper.SetValue(ConfigurationKeys.OperNameLanguage, "OperNameLanguageMAA"); break; } + + var mainWindow = Application.Current.MainWindow; + + if (mainWindow != null) + { + mainWindow.Show(); + mainWindow.WindowState = mainWindow.WindowState = WindowState.Normal; + mainWindow.Activate(); + } + + var result = MessageBoxHelper.Show( + LocalizationHelper.GetString("LanguageChangedTip"), + LocalizationHelper.GetString("Tip"), + MessageBoxButton.OKCancel, + MessageBoxImage.Question, + ok: LocalizationHelper.GetString("Ok"), + cancel: LocalizationHelper.GetString("ManualRestart")); + if (result == MessageBoxResult.OK) + { + Bootstrapper.ShutdownAndRestartWithoutArgs(); + } + + SetAndNotify(ref _operNameLanguage, value); } } From 6063d98da078111587289afe23d2542430d20f57 Mon Sep 17 00:00:00 2001 From: ManicSteiner Date: Mon, 5 Aug 2024 22:27:09 +0800 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E7=BC=96?= =?UTF-8?q?=E7=BB=84=E3=80=81=E5=B9=B2=E5=91=98=E8=AF=86=E5=88=AB=E3=80=81?= =?UTF-8?q?=E5=85=AC=E6=8B=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Main/AsstProxy.cs | 8 +++++--- .../ViewModels/UI/RecognizerViewModel.cs | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) 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", From 1684045c5218b9cf201e9a05f9cecf33e9dc3bf8 Mon Sep 17 00:00:00 2001 From: ManicSteiner Date: Mon, 5 Aug 2024 22:45:53 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=88=98=E6=96=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Res/Localizations/en-us.xaml | 6 +++++ src/MaaWpfGui/Res/Localizations/ja-jp.xaml | 6 +++++ src/MaaWpfGui/Res/Localizations/ko-kr.xaml | 6 +++++ src/MaaWpfGui/Res/Localizations/zh-cn.xaml | 6 +++++ src/MaaWpfGui/Res/Localizations/zh-tw.xaml | 6 +++++ .../ViewModels/UI/CopilotViewModel.cs | 27 ++++++++++++++----- 6 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index aa09731620..56c44e99ba 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -586,6 +586,12 @@ The video aspect ratio needs to be 16:9 without interference factors such as bla Loop Times Start Video Link + Skill + Total {0} Operator(s) + Directive EC unit: + Other operators: + Tactical Equipment (horizontal): + Initial Strategy: Tips: \n\n diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index cf9e5f58aa..371ba8e7d4 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -585,6 +585,12 @@ ループ回数 開始 映像へのハイパーリンク + スキル + 合計 {0} 名のオペレーター + 拡張式戦術ユニット: + その他のオペレーター: + 初期戦術装備(横): + 初期戦略: ヒント: \n\n diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index 2317d698dd..09c56cb252 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -588,6 +588,12 @@ OF-1을 해금하지 않았다면 선택하지 말아 주세요. 반복 횟수 시작 영상 링크 + 스킬 + 총 {0}명의 오퍼레이터 + 에너지 기어: + 기타 오퍼레이터: + 전술 장비 (가로): + 초기 전략: 팁:\n\n diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 382bc92247..424bd8ceef 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -589,6 +589,12 @@ 右键清除未激活任务 开始 视频链接 + 技能 + 共 {0} 名干员 + 导能原件: + 编队工具人: + 开局装备(横向): + 开局策略: 小提示: \n\n diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index 852085b93a..e44d908689 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -579,6 +579,12 @@ 循環次數 開始 影片連結 + 技能 + 共 {0} 名幹員 + 導能組件: + 其他幹員: + 開局裝備(橫向): + 開局策略: 小提示: \n\n diff --git a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs index 7b134b6072..5728854edd 100644 --- a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs @@ -30,6 +30,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Serilog; using Stylet; +using Windows.Globalization; using DataFormats = System.Windows.Forms.DataFormats; using Task = System.Threading.Tasks.Task; @@ -373,11 +374,15 @@ namespace MaaWpfGui.ViewModels.UI } AddLog(string.Empty, UiLogColor.Message, showTime: false); + AddLog("------------------------------------------------", UiLogColor.Message, showTime: false); + AddLog(string.Empty, UiLogColor.Message, showTime: false); + int count = 0; foreach (var oper in json["opers"] ?? new JArray()) { count++; - AddLog($"{oper["name"]}, {oper["skill"]} 技能", UiLogColor.Message, showTime: false); + var localizedName = DataHelper.GetLocalizedCharacterName((string?)oper["name"]); + AddLog($"{localizedName}, {LocalizationHelper.GetString("CopilotSkill")} {oper["skill"]}", UiLogColor.Message, showTime: false); } if (json.TryGetValue("groups", out var groupsValue)) @@ -386,13 +391,14 @@ namespace MaaWpfGui.ViewModels.UI { count++; string groupName = group["name"] + ": "; - var operInfos = group["opers"]!.Cast().Select(oper => $"{oper["name"]} {oper["skill"]}").ToList(); + var operInfos = group["opers"]!.Cast() + .Select(oper => $"{DataHelper.GetLocalizedCharacterName((string?)oper["name"])} {oper["skill"]}").ToList(); AddLog(groupName + string.Join(" / ", operInfos), UiLogColor.Message, showTime: false); } } - AddLog($"共 {count} 名干员", UiLogColor.Message, showTime: false); + AddLog(string.Format(LocalizationHelper.GetString("TotalOperatorsCount"), count), UiLogColor.Message, showTime: false); if (json.TryGetValue("type", out var typeValue)) { @@ -401,19 +407,28 @@ namespace MaaWpfGui.ViewModels.UI { _taskType = "SSSCopilot"; + if (json.TryGetValue("buff", out var buffValue)) + { + string buffLog = LocalizationHelper.GetString("DirectiveECTerm"); + AddLog(buffLog + DataHelper.GetLocalizedCharacterName((string?)buffValue), UiLogColor.Message, showTime: false); + } + if (json.TryGetValue("tool_men", out var toolMenValue)) { - AddLog("编队工具人:\n" + toolMenValue, UiLogColor.Message, showTime: false); + string toolMenLog = LocalizationHelper.GetString("OtherOperators"); + AddLog(toolMenLog + toolMenValue, UiLogColor.Message, showTime: false); } if (json.TryGetValue("equipment", out var equipmentValue) && equipmentValue is JArray equipmentJArray) { - AddLog("开局装备(横向):\n" + string.Join('\n', equipmentJArray.Select(i => (string?)i).Chunk(4).Select(i => string.Join(",", i))), UiLogColor.Message, showTime: false); + string equipmentLog = LocalizationHelper.GetString("InitialEquipmentHorizontal") + '\n'; + AddLog(equipmentLog + string.Join('\n', equipmentJArray.Select(i => (string?)i).Chunk(4).Select(i => string.Join(",", i))), UiLogColor.Message, showTime: false); } if (json.TryGetValue("strategy", out var strategyValue)) { - AddLog("开局策略:" + strategyValue, UiLogColor.Message, showTime: false); + string strategyLog = LocalizationHelper.GetString("InitialStrategy"); + AddLog(strategyLog + strategyValue, UiLogColor.Message, showTime: false); } } } From 067f86b2fcbcfcb06b6daae51d1de82f30faf62b Mon Sep 17 00:00:00 2001 From: ManicSteiner Date: Mon, 5 Aug 2024 22:51:23 +0800 Subject: [PATCH 6/7] perf: remove using globalization --- src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs index 5728854edd..2037d91d9f 100644 --- a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs @@ -30,7 +30,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Serilog; using Stylet; -using Windows.Globalization; using DataFormats = System.Windows.Forms.DataFormats; using Task = System.Threading.Tasks.Task; From 876ab235771dabe38229edfb225fce9dfd520a94 Mon Sep 17 00:00:00 2001 From: ManicSteiner Date: Sun, 18 Aug 2024 23:09:13 +0800 Subject: [PATCH 7/7] chore: revert ui perf (commit b3b9198) --- src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index 14ebb6aba0..574e47e44b 100755 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -4854,7 +4854,7 @@ namespace MaaWpfGui.ViewModels.UI get => _language; set { - if (!SetAndNotify(ref _language, value)) + if (value == _language) { return; } @@ -4894,6 +4894,8 @@ namespace MaaWpfGui.ViewModels.UI Bootstrapper.ShutdownAndRestartWithoutArgs(); } + SetAndNotify(ref _language, value); + return; string FormatText(string text, string key)