From 12da3b36d8b20d015050b4a5d65baec2db1eaadd Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:03:40 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E6=8F=8F=E8=BF=B0=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E5=89=8D=20return=20=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Res/Localizations/en-us.xaml | 2 +- src/MaaWpfGui/Res/Localizations/ja-jp.xaml | 2 +- src/MaaWpfGui/Res/Localizations/ko-kr.xaml | 2 +- src/MaaWpfGui/Res/Localizations/zh-cn.xaml | 2 +- src/MaaWpfGui/Res/Localizations/zh-tw.xaml | 2 +- .../ViewModels/UI/TaskQueueViewModel.cs | 21 ++++++++++--------- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index 06a2691719..089b5df161 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -519,7 +519,7 @@ As of now (V9.1.28), the emulator version only supports 720P, 900P, and 1080P re It's Sunday: don't forget about Annihilation - UI and Core versions mismatch: {0} and {1}, which may result in unpredictable behavior. Please refrain from manually replacing files. + UI and Core versions mismatch: {0} and {1}, which may cause unpredictable behavior. Please do not manually replace files or occupy files during updates.\n\nPlease download the full package and overwrite the contents of the current folder. Connecting to emulator…… Unselected task Running…… diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index 19daa3a817..977b7d6e30 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -522,7 +522,7 @@ C:\\leidian\\LDPlayer9 日曜です。殲滅作戦は忘れてないですか〜 - UI と Core のバージョンが一致しません: {0} および {1}、予測不可能な動作の原因となる可能性があります。ファイルを手動で置換しないでください。 + UI と Core のバージョンが一致しません: {0} と {1}、予測不可能な動作を引き起こす可能性があります。ファイルを手動で置き換えたり、更新中にファイルを占有しないでください。\n\n完全なパッケージをダウンロードして、現在のフォルダーの内容を上書きしてください。 エミュレータ接続中…… タスクが選択されていません 動作中…… diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index 2354f4c017..dd32a013cb 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -522,7 +522,7 @@ C:\\leidian\\LDPlayer9 일요일입니다. 섬멸 작전을 잊지 마세요~ - UI 및 Core 버전 불일치: {0} 및 {1}로 인해 문제가 발생할 수 있습니다. 파일을 수동으로 교체하지 마세요 + UI와 Core 버전이 일치하지 않습니다: {0} 및 {1}, 예측할 수 없는 동작을 유발할 수 있습니다. 파일을 수동으로 교체하거나 업데이트 중에 파일을 점유하지 마십시오.\n\n전체 패키지를 다운로드하여 현재 폴더의 내용을 덮어쓰십시오. 에뮬레이터에 연결 중…… 선택된 작업이 없습니다 실행 중…… diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 7469f3d8fb..40552ba92f 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -521,7 +521,7 @@ C:\\leidian\\LDPlayer9。\n 周日了,记得打剿灭哦~ - UI 和 Core 版本不一致: {0} 和 {1},可能导致不可预测的行为,请勿手动替换文件。 + UI 和 Core 版本不一致: {0} 和 {1},可能导致不可预测的行为,请勿手动替换文件或者在更新时占用文件。\n\n请下载完整包并覆盖当前文件夹下的内容。 正在连接模拟器…… 未选择任务 正在运行中…… diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index 7fc0355cf4..eca3707917 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -521,7 +521,7 @@ C:\\leidian\\LDPlayer9。\n 週日了,記得打剿滅喔 ~ - UI 和 Core 版本不一致: {0} 和 {1},可能導致不可預測的行為,請勿手動替換文件。 + UI 和 Core 版本不一致: {0} 和 {1},可能導致不可預測的行為,請勿手動替換文件或者在更新時佔用文件。\n\n請下載完整包並覆蓋當前文件夾下的內容。 正在連接模擬器…… 未選擇任務 正在運行中…… diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs index 7cadadb231..fc169d88b5 100644 --- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs @@ -1152,16 +1152,6 @@ namespace MaaWpfGui.ViewModels.UI return; } - MainTasksCompletedCount = 0; - - _runningState.SetIdle(false); - - // 虽然更改时已经保存过了,不过保险起见在点击开始之后再次保存任务和基建列表 - TaskItemSelectionChanged(); - Instances.SettingsViewModel.InfrastOrderSelectionChanged(); - - InfrastTaskRunning = true; - ClearLog(); var buildDateTimeLong = SettingsViewModel.BuildDateTimeCurrentCultureString; @@ -1178,6 +1168,17 @@ namespace MaaWpfGui.ViewModels.UI return; } + MainTasksCompletedCount = 0; + + // 所有提前 return 都要放在 _runningState.SetIdle(false) 之前,否则会导致无法再次点击开始 + _runningState.SetIdle(false); + + // 虽然更改时已经保存过了,不过保险起见在点击开始之后再次保存任务和基建列表 + TaskItemSelectionChanged(); + Instances.SettingsViewModel.InfrastOrderSelectionChanged(); + + InfrastTaskRunning = true; + await Task.Run(() => Instances.SettingsViewModel.RunScript("StartsWithScript")); AddLog(LocalizationHelper.GetString("ConnectingToEmulator"));