From b4b5faf2ba32064bc1923f0cc91e770cfe61c2a9 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 20 Nov 2022 05:22:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=88=98=E6=96=97=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks.json | 2 +- .../Task/Sub/BattleProcessTask.cpp | 2 +- src/MeoAsstGui/ViewModels/CopilotViewModel.cs | 19 +++++++------------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/resource/tasks.json b/resource/tasks.json index 714af1b7df..d383cbd709 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -6248,7 +6248,7 @@ "BattleOperCooling": { "template": "empty.png", "specialParams": [ - 1000 + 1500 ], "specialParams_Doc": "这个任务中作为符合range的像素点数量阈值", "rectMove": [ diff --git a/src/MeoAssistant/Task/Sub/BattleProcessTask.cpp b/src/MeoAssistant/Task/Sub/BattleProcessTask.cpp index d4a37a340e..4a87a91845 100644 --- a/src/MeoAssistant/Task/Sub/BattleProcessTask.cpp +++ b/src/MeoAssistant/Task/Sub/BattleProcessTask.cpp @@ -362,7 +362,6 @@ bool asst::BattleProcessTask::do_action(size_t action_index) return false; } const auto& next_action = m_copilot_data.actions.at(action_index + 1); - m_in_bullet_time = true; if (next_action.type == BattleActionType::Deploy) { ret = oper_deploy(next_action, true); } @@ -377,6 +376,7 @@ bool asst::BattleProcessTask::do_action(size_t action_index) Log.error("Bullte time 's next step is not deploy, skill or retreat!"); return false; } + m_in_bullet_time = true; } break; case BattleActionType::SkillUsage: { auto& oper_info = m_group_to_oper_mapping[action.group_name]; diff --git a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs index c7326492bc..3cdf24cbd4 100644 --- a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs +++ b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs @@ -213,7 +213,6 @@ namespace MeoAsstGui } private string _curStageName = string.Empty; - private string _curCopilotData = string.Empty; private bool _isDataFromWeb = false; private const string TempCopilotFile = "resource/_temp_copilot.json"; @@ -221,7 +220,6 @@ namespace MeoAsstGui { try { - _curCopilotData = string.Empty; var json = (JObject)JsonConvert.DeserializeObject(jsonStr); if (json == null) { @@ -312,7 +310,12 @@ namespace MeoAsstGui AddLog(string.Format("共 {0} 名干员", count), UILogColor.Message); _curStageName = json["stage_name"].ToString(); - _curCopilotData = json.ToString(); + if (_isDataFromWeb) + { + File.Delete(TempCopilotFile); + File.WriteAllText(TempCopilotFile, json.ToString()); + } + AddLog( "\n\n" + Localization.GetString("CopilotTip") + "\n\n" + @@ -419,15 +422,7 @@ namespace MeoAsstGui AddLog(errMsg, UILogColor.Error); } - if (!_isDataFromWeb) - { - UpdateFileDoc(Filename); - } - - File.Delete(TempCopilotFile); - File.WriteAllText(TempCopilotFile, _curCopilotData); - - bool ret = asstProxy.AsstStartCopilot(_curStageName, TempCopilotFile, Form); + bool ret = asstProxy.AsstStartCopilot(_curStageName, _isDataFromWeb ? TempCopilotFile : Filename, Form); if (ret) { AddLog("Star Burst Stream!");