From 9922c7beea357f6ef087f549b1404f11893383e8 Mon Sep 17 00:00:00 2001 From: Horror Proton <107091537+horror-proton@users.noreply.github.com> Date: Sun, 7 Aug 2022 21:17:58 +0800 Subject: [PATCH 1/4] fix: fix a typo in YoStarEN ocr replace rules --- resource/global/YoStarEN/resource/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/global/YoStarEN/resource/tasks.json b/resource/global/YoStarEN/resource/tasks.json index d3c359bee9..71c3b6e32d 100644 --- a/resource/global/YoStarEN/resource/tasks.json +++ b/resource/global/YoStarEN/resource/tasks.json @@ -210,7 +210,7 @@ "位移" ], [ - "Crowd Control", + "Crowd-Control", "控场" ], [ From 671e609a181c644dd65a17a9d5f5407da8af1e72 Mon Sep 17 00:00:00 2001 From: Dusk_NM02 Date: Sun, 7 Aug 2022 21:58:48 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E5=90=AF=E5=8A=A8UI=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=BE=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E4=BE=BF=E4=BA=8E=E6=AD=A3=E7=A1=AE=E5=8A=A0?= =?UTF-8?q?=E8=BD=BDDLL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/Bootstrapper.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MeoAsstGui/Bootstrapper.cs b/src/MeoAsstGui/Bootstrapper.cs index 4d6e2c7f3c..5017b63546 100644 --- a/src/MeoAsstGui/Bootstrapper.cs +++ b/src/MeoAsstGui/Bootstrapper.cs @@ -55,6 +55,7 @@ namespace MeoAsstGui /// 初始化些啥自己加。 protected override void OnStart() { + System.IO.Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); base.OnStart(); ViewStatusStorage.Load(); Localization.Load(); From 149ee6853a5f61748744a07139e1ba61612449d0 Mon Sep 17 00:00:00 2001 From: cglcv <35825310+cglcv@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:45:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=99=A8=E7=9A=84=E9=80=BB=E8=BE=91=20(#1479?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/TaskQueueViewModel.cs | 59 ++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs b/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs index 9e23dce44a..1ca4ad5d03 100644 --- a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs +++ b/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs @@ -16,6 +16,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows; @@ -958,6 +959,60 @@ namespace MeoAsstGui settings.RoguelikeSquad, settings.RoguelikeRoles, settings.RoguelikeCoreChar); } + [DllImport("user32.dll", EntryPoint = "FindWindow")] + private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + + [DllImport("User32.dll", CharSet = CharSet.Auto)] + private static extern int GetWindowThreadProcessId(IntPtr hwnd, out int id); + + /// + /// Kills emulator by Window hwnd. + /// + /// Whether the operation is successful. + public bool killEumlatorbyWindow() + { + IntPtr hwnd; + int pid = 0; + var windowname = new[] { "BlueStacks App Player", "BlueStacks", "明日方舟 - MuMu模拟器", "夜神模拟器", "逍遥模拟器", "明日方舟" }; + Process emulator; + foreach (string i in windowname) + { + hwnd = FindWindow(null, i); + if (hwnd != IntPtr.Zero) + { + GetWindowThreadProcessId(hwnd, out pid); + break; + } + } + + if (pid != 0) + { + emulator = Process.GetProcessById(pid); + emulator.CloseMainWindow(); + if (!emulator.HasExited) + { + try + { + emulator.Kill(); + } + catch + { + return killEmulator(); + } + + return true; + } + else + { + return true; + } + } + else + { + return killEmulator(); + } + } + /// /// Kills emulator. /// @@ -1104,7 +1159,7 @@ namespace MeoAsstGui break; case ActionType.ExitEmulator: - if (!killEmulator()) + if (!killEumlatorbyWindow()) { AddLog(Localization.GetString("CloseEmulatorFailed"), "DarkRed"); } @@ -1112,7 +1167,7 @@ namespace MeoAsstGui break; case ActionType.ExitEmulatorAndSelf: - if (!killEmulator()) + if (!killEumlatorbyWindow()) { AddLog(Localization.GetString("CloseEmulatorFailed"), "DarkRed"); } From 5e979c277aafd6afec1b3c5ed1ea6d5e92536da6 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 8 Aug 2022 09:44:00 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E6=89=93=E5=89=BF=E7=81=AD=E6=97=B6=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E5=8B=BE=E9=80=89`=E5=85=A8=E6=9D=83=E5=A7=94=E6=89=98`?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resource/tasks.json b/resource/tasks.json index 3c7f249fca..17de7fe155 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -1557,9 +1557,9 @@ "algorithm": "JustReturn", "action": "DoNothing", "next": [ + "UsePrts-Annihilation", "UsePrts", "UsePrts-StageSN", - "UsePrts-Annihilation", "StartButton1", "PRTS3", "PRTS", @@ -1679,6 +1679,7 @@ ], "cache": false, "next": [ + "UsePrts-Annihilation", "StartButton1" ] }, @@ -2445,9 +2446,9 @@ ], "action": "ClickSelf", "next": [ + "UsePrts-Annihilation", "UsePrts", "UsePrts-StageSN", - "UsePrts-Annihilation", "StartButton1" ] },