From 9b7a51056dcdeb253c7ab9de4909c8143fc9dc33 Mon Sep 17 00:00:00 2001 From: Helloworld <1326521+LYZhelloworld@users.noreply.github.com> Date: Sat, 20 Aug 2022 13:52:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=EF=BC=8C=E6=B6=88?= =?UTF-8?q?=E9=99=A4=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/Helper/AsstProxy.cs | 24 +++++++++---------- src/MeoAsstGui/ViewModels/CopilotViewModel.cs | 10 ++++---- .../ViewModels/SettingsViewModel.cs | 5 +++- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/MeoAsstGui/Helper/AsstProxy.cs b/src/MeoAsstGui/Helper/AsstProxy.cs index e898f1d239..9d18843551 100644 --- a/src/MeoAsstGui/Helper/AsstProxy.cs +++ b/src/MeoAsstGui/Helper/AsstProxy.cs @@ -141,7 +141,7 @@ namespace MeoAsstGui } bool loaded = true; - if (settingsModel.ClientType == String.Empty + if (settingsModel.ClientType == string.Empty || settingsModel.ClientType == "Official" || settingsModel.ClientType == "Bilibili") { // The resources of Official and Bilibili are the same @@ -168,7 +168,7 @@ namespace MeoAsstGui if (loaded) { - if (settingsModel.ClientType == String.Empty) + if (settingsModel.ClientType == string.Empty) { _curResource = "Official"; } @@ -240,7 +240,7 @@ namespace MeoAsstGui } int len = lstrlenA(ptr); - Byte[] bytes = new Byte[len + 1]; + byte[] bytes = new byte[len + 1]; Marshal.Copy(ptr, bytes, 0, len + 1); return enc.GetString(bytes); } @@ -714,7 +714,7 @@ namespace MeoAsstGui int level = (int)subTaskDetails["level"]; if (level >= 5) { - using (var toast = new ToastNotification(String.Format(Localization.GetString("RecruitmentOfStar"), level))) + using (var toast = new ToastNotification(string.Format(Localization.GetString("RecruitmentOfStar"), level))) { toast.AppendContentText(new string('★', level)).ShowRecruit(row: 2); } @@ -726,16 +726,16 @@ namespace MeoAsstGui mainModel.AddLog(level + " ★ Tags", LogColor.Info); } - //bool robot = (bool)subTaskDetails["robot"]; - //if (robot) - //{ + // bool robot = (bool)subTaskDetails["robot"]; + // if (robot) + // { // using (var toast = new ToastNotification(Localization.GetString("RecruitmentOfBot"))) // { // toast.AppendContentText(new string('★', 1)).ShowRecruitRobot(row: 2); // } - // mainModel.AddLog(1 + " ★ Tag", LogColor.RobotOperator, "Bold"); - //} + // mainModel.AddLog(1 + " ★ Tag", LogColor.RobotOperator, "Bold"); + // } } break; @@ -788,7 +788,7 @@ namespace MeoAsstGui case "PenguinId": { var settings = _container.Get(); - if (settings.PenguinId == String.Empty) + if (settings.PenguinId == string.Empty) { string id = subTaskDetails["id"].ToString(); settings.PenguinId = id; @@ -916,8 +916,8 @@ namespace MeoAsstGui return true; } - if (settings.AdbPath == String.Empty || - settings.ConnectAddress == String.Empty) + if (settings.AdbPath == string.Empty || + settings.ConnectAddress == string.Empty) { if (!settings.RefreshAdbConfig(ref error)) { diff --git a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs index 69c18230c4..b515a1c8bd 100644 --- a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs +++ b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs @@ -59,7 +59,6 @@ namespace MeoAsstGui Localization.GetString("CopilotTip2") + "\n\n" + Localization.GetString("CopilotTip3") + "\n\n" + Localization.GetString("CopilotTip4"), - //Localization.GetString("CopilotTip5"), LogColor.Message); } @@ -296,7 +295,6 @@ namespace MeoAsstGui Localization.GetString("CopilotTip2") + "\n\n" + Localization.GetString("CopilotTip3") + "\n\n" + Localization.GetString("CopilotTip4")); - //Localization.GetString("CopilotTip5")); } catch (Exception) { @@ -368,11 +366,11 @@ namespace MeoAsstGui public async void Start() { ClearLog(); - //if (_form) - //{ - // AddLog(Localization.GetString("AutoSquadTip"), LogColor.Message); - //} + // if (_form) + // { + // AddLog(Localization.GetString("AutoSquadTip"), LogColor.Message); + // } AddLog(Localization.GetString("ConnectingToEmulator")); var asstProxy = _container.Get(); diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index 5e91964e5b..f5e8665270 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -431,7 +431,7 @@ namespace MeoAsstGui private readonly Dictionary ServerMapping = new Dictionary { - { String.Empty, "CN" }, + { string.Empty, "CN" }, { "Official", "CN" }, { "Bilibili", "CN" }, { "YoStarEN", "EN" }, @@ -440,6 +440,9 @@ namespace MeoAsstGui { "txwy", "CN_TW" }, }; + /// + /// Gets server type. + /// public string ServerType { get