perf: 优化 自动战斗-战斗列表 跳过战斗后剧情的逻辑 (#6430)

This commit is contained in:
MistEO
2023-09-18 15:20:52 +08:00
committed by GitHub
5 changed files with 21 additions and 12 deletions

View File

@@ -13131,14 +13131,25 @@
163
]
},
"Copilot@ClickCornerUntilFailedOrThreeStars": {
"Copilot@ClickCornerUntilEndOfAction": {
"algorithm": "JustReturn",
"action": "DoNothing",
"maxTimes": 30,
"exceededNext": [
"Copilot@EndOfAction"
],
"next": [
"Copilot@SkipThePreBattlePlot",
"Copilot@EndOfAction",
"Copilot@ClickCornerBeforeThreeStars"
]
},
"Copilot@SkipThePreBattlePlotConfirm": {
"template": "SkipThePreBattlePlotConfirm.png",
"next": [
"Copilot@ClickCornerUntilEndOfAction"
]
},
"Copilot@EndOfAction": {
"template": "EndOfAction.png",
"action": "DoNothing",
@@ -13159,7 +13170,7 @@
"Doc": "三星之前",
"baseTask": "Copilot@ClickCornerUntilStartButton",
"next": [
"Copilot@ClickCornerUntilFailedOrThreeStars"
"Copilot@ClickCornerUntilEndOfAction"
]
},
"Copilot@ClickCornerUntilStartButton": {

View File

@@ -133,7 +133,13 @@ bool asst::CopilotTask::set_params(const json::value& params)
m_formation_task_ptr->set_support_unit_name(std::move(support_unit_name));
size_t loop_times = params.get("loop_times", 1);
if (loop_times > 1) {
if (need_navigate) {
// 如果没三星就中止
Task.get<OcrTaskInfo>("Copilot@BattleStartPreFlag")->text.emplace_back(m_navigate_name);
m_stop_task_ptr->set_tasks({ "Copilot@ClickCornerUntilEndOfAction" });
m_stop_task_ptr->set_enable(true);
}
else if (loop_times > 1) {
m_stop_task_ptr->set_tasks({ "ClickCornerUntilStartButton" });
m_stop_task_ptr->set_enable(true);
@@ -145,12 +151,6 @@ bool asst::CopilotTask::set_params(const json::value& params)
m_subtasks.insert(m_subtasks.end(), m_subtasks.begin(), raw_end);
}
}
else if (need_navigate) {
// 如果没三星就中止
Task.get<OcrTaskInfo>("Copilot@BattleStartPreFlag")->text.emplace_back(m_navigate_name);
m_stop_task_ptr->set_tasks({ "Copilot@ClickCornerUntilFailedOrThreeStars" });
m_stop_task_ptr->set_enable(true);
}
return true;
}

View File

@@ -242,7 +242,6 @@
<userControl:RoguelikeSettingsUserControl
s:View.ActionTarget="{Binding DataContext, RelativeSource={RelativeSource Self}}"
DataContext="{Binding TaskSettingDataContext}"
IsEnabled="{Binding Idle}"
Visibility="{c:Binding TaskSettingVisibilities.AutoRoguelike}" />
</hc:SimpleStackPanel>
</hc:ScrollViewer>

View File

@@ -310,7 +310,6 @@
<StackPanel
s:View.ActionTarget="{Binding DataContext, RelativeSource={RelativeSource Self}}"
DataContext="{Binding TaskSettingDataContext}"
IsEnabled="{Binding Idle}"
Visibility="{c:Binding TaskSettingVisibilities.EnableAdvancedSettings}">
<CheckBox
Margin="0,10"

View File

@@ -17,7 +17,7 @@
d:DesignWidth="220"
mc:Ignorable="d">
<StackPanel>
<StackPanel Visibility="{c:Binding !TaskSettingVisibilities.EnableAdvancedSettings}">
<StackPanel IsEnabled="{Binding Idle}" Visibility="{c:Binding !TaskSettingVisibilities.EnableAdvancedSettings}">
<ComboBox
Margin="0,5"
hc:InfoElement.Title="{DynamicResource RoguelikeTheme}"