From 5f6f78018829926d2cbf3da887396bb4a60634c2 Mon Sep 17 00:00:00 2001 From: zzyyyl Date: Mon, 2 Oct 2023 18:02:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=A4=9A=E5=9B=BE?= =?UTF-8?q?=E5=8D=95=E9=98=88=E5=80=BC=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks.json | 12 ++---------- src/MaaCore/Config/TaskData.cpp | 4 +++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/resource/tasks.json b/resource/tasks.json index 9bd1c8f0c3..6312fe2d29 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -4706,11 +4706,7 @@ "TaskSami.png" ], "cache": false, - "templThreshold": [ - 0.7, - 0.7, - 0.7 - ], + "templThreshold": 0.7, "action": "ClickSelf", "roi": [ 700, @@ -4909,11 +4905,7 @@ "FriendsSami.png" ], "cache": false, - "templThreshold": [ - 0.7, - 0.7, - 0.7 - ], + "templThreshold": 0.7, "action": "ClickSelf", "roi": [ 250, diff --git a/src/MaaCore/Config/TaskData.cpp b/src/MaaCore/Config/TaskData.cpp index 0b7e00056f..06524d644b 100644 --- a/src/MaaCore/Config/TaskData.cpp +++ b/src/MaaCore/Config/TaskData.cpp @@ -776,7 +776,9 @@ asst::TaskData::taskptr_t asst::TaskData::generate_match_task_info(std::string_v default_ptr->templ_thresholds.back()); } else if (threshold_opt->is_number()) { - match_task_info_ptr->templ_thresholds = { threshold_opt->as_double() }; + // 单个数值时,所有模板都使用这个阈值 + match_task_info_ptr->templ_thresholds.resize(match_task_info_ptr->templ_names.size(), + threshold_opt->as_double()); } else if (threshold_opt->is_array()) { ranges::copy(threshold_opt->as_array() | views::transform(&ranges::range_value_t::as_double),