feat: 更新 tasks.json

1. StartUp 任务在 EndOfAction 界面不再直接停止,而是一直点击返回直到主界面
2. 把 StartUp 相关的 task 放到一起
3. `set_times_limit("A")` 对 `B@A`、`B@...@A` 任务也生效
This commit is contained in:
zzyyyl
2022-10-04 02:07:29 +08:00
parent 92b694a46c
commit bbb2eda626
3 changed files with 305 additions and 277 deletions

View File

@@ -137,9 +137,21 @@ bool ProcessTask::_run()
int max_times = m_cur_task_ptr->max_times;
TimesLimitType limit_type = TimesLimitType::Pre;
if (auto iter = m_times_limit.find(cur_name); iter != m_times_limit.cend()) {
max_times = iter->second.times;
limit_type = iter->second.type;
{
std::string_view cur_base_name = cur_name;
while (true) {
if (auto iter = m_times_limit.find(cur_base_name.data()); iter != m_times_limit.cend()) {
max_times = iter->second.times;
limit_type = iter->second.type;
break;
}
if (size_t at_pos = cur_base_name.find('@'); at_pos == std::string::npos) {
break;
}
else {
cur_base_name = cur_base_name.substr(at_pos + 1);
}
}
}
if (limit_type == TimesLimitType::Pre && exec_times >= max_times) {