Skip to content

Commit

Permalink
feat: 默认关卡改为当前关卡/上次关卡自动识别
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Jul 25, 2022
1 parent 6d1a458 commit bb07197
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/en/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Try restarting your computer.

## Wrong recognition/program freezes after starting

Tip 1: The `Current Stage` of auto battle that costs Sanity requires you to go to the screen with the `Start` button. Please confirm they are not related.
Tip 1: The auto battle requires you to go to the screen with the `Start` button. Please confirm they are not related.
Tip 2: Follow the steps below until the problem is solved.

1. Confirm that your emulator is supported in the [List of the Supported Emulators](EMULATOR_SUPPORTS.md).
Expand Down
2 changes: 1 addition & 1 deletion docs/en/INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Appends a task.
// Corresponding task parameters
{
"enable": bool, // Whether to enable this task, optional, true by default
"stage": string, // Stage name, optional, by default "当前关卡". Editing in run-time is not supported.
"stage": string, // Stage name, optional, by default crrent / last stage. Editing in run-time is not supported.
"medicine": int, // Maximum number Sanity Potion used, optional, by default 0
"stone": int, // Maximum number of Originite Prime used, optional, by default 0
"times": int, // Maximum times, optional, by default infinite
Expand Down
2 changes: 1 addition & 1 deletion docs/常见问题.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _注意蓝叠安装完后,需要在模拟器设置中打开 `Android 调试桥

## 识别错误/任务开始后一直不动、没有反应

提示 1. 自动战斗功能 和 刷理智的 `当前关卡`,都是需要手动点到关卡页有 `开始行动` 按钮的地方再开始任务的。请确认不是这个问题~
提示 1. 自动战斗功能,是需要手动点到关卡页有 `开始行动` 按钮的地方再开始任务的。请确认不是这个问题~
提示 2. 依次进行,若问题解决,则无需往下

1. 请根据 [模拟器支持情况](模拟器支持.md) 确定您的模拟器是受支持的
Expand Down
2 changes: 1 addition & 1 deletion docs/集成文档.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TaskId ASSTAPI AsstAppendTask(AsstHandle handle, const char* type, const char* p
// 对应的任务参数
{
"enable": bool, // 是否启用本任务,可选,默认为 true
"stage": string, // 关卡名,可选,默认“当前关卡”。不支持运行中设置
"stage": string, // 关卡名,可选,默认为空,识别当前/上次的关卡。不支持运行中设置
"medicine": int, // 最大使用理智药数量,可选,默认 0
"stone": int, // 最大吃石头数量,可选,默认 0
"times": int, // 指定次数,可选,默认无穷大
Expand Down
15 changes: 6 additions & 9 deletions src/MeoAssistant/FightTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ asst::FightTask::FightTask(AsstCallback callback, void* callback_arg)
m_fight_task_ptr(std::make_shared<ProcessTask>(m_callback, m_callback_arg, TaskType))
{
// 进入选关界面(主界面的“终端”点进去)
m_start_up_task_ptr->set_tasks({ "StageBegin" })
.set_times_limit("GoLastBattle", 0)
m_start_up_task_ptr->
set_times_limit("GoLastBattle", 0)
.set_times_limit("StartButton1", 0)
.set_times_limit("StartButton2", 0)
.set_times_limit("MedicineConfirm", 0)
.set_times_limit("StoneConfirm", 0)
.set_times_limit("StageSNReturnFlag", 0)
.set_enable(false)
.set_ignore_error(false);

// 进入对应的关卡
Expand All @@ -29,7 +28,6 @@ asst::FightTask::FightTask(AsstCallback callback, void* callback_arg)
.set_times_limit("MedicineConfirm", 0)
.set_times_limit("StoneConfirm", 0)
.set_times_limit("StageSNReturnFlag", 0)
.set_enable(false)
.set_ignore_error(false);

// 开始战斗任务
Expand Down Expand Up @@ -71,14 +69,13 @@ bool asst::FightTask::set_params(const json::value& params)

if (!m_runned) {
if (stage.empty()) {
m_start_up_task_ptr->set_enable(false);
m_stage_task_ptr->set_enable(false);
m_start_up_task_ptr->set_tasks({ "UsePrts", "UsePrts-StageSN", "StartButton1", "StageBegin" });
m_stage_task_ptr->set_tasks({ "UsePrts", "UsePrts-StageSN", "StartButton1", "LastBattle" });
}
else {
m_start_up_task_ptr->set_enable(true);
m_stage_task_ptr->set_enable(true);
m_start_up_task_ptr->set_tasks({ "StageBegin" });
m_stage_task_ptr->set_tasks({ stage });
}
m_stage_task_ptr->set_tasks({ stage });
}

m_fight_task_ptr->set_times_limit("MedicineConfirm", medicine)
Expand Down
5 changes: 3 additions & 2 deletions src/MeoAsstGui/Resources/Localizations/en-us.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
<system:String x:Key="StageSelect">Stage</system:String>
<system:String x:Key="Amend">Amend</system:String>

<system:String x:Key="CurrentStage">Current Stage</system:String>
<system:String x:Key="LastBattle">Last Battle</system:String>
<system:String x:Key="DefaultStage">Cur/Last Stage</system:String>
<!--<system:String x:Key="CurrentStage">Current Stage</system:String>
<system:String x:Key="LastBattle">Last Battle</system:String>-->
<system:String x:Key="1-7">1-7</system:String>
<system:String x:Key="CE-6">CE-6</system:String>
<system:String x:Key="AP-5">AP-5</system:String>
Expand Down
5 changes: 3 additions & 2 deletions src/MeoAsstGui/Resources/Localizations/zh-cn.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
<system:String x:Key="StageSelect">关卡选择</system:String>
<system:String x:Key="Amend">修改</system:String>

<system:String x:Key="CurrentStage">当前关卡</system:String>
<system:String x:Key="LastBattle">上次作战</system:String>
<!--<system:String x:Key="CurrentStage">当前关卡</system:String>
<system:String x:Key="LastBattle">上次作战</system:String>-->
<system:String x:Key="DefaultStage">当前/上次</system:String>
<system:String x:Key="1-7">1-7</system:String>
<system:String x:Key="CE-6">龙门币-6/5</system:String>
<system:String x:Key="AP-5">红票-5</system:String>
Expand Down
2 changes: 1 addition & 1 deletion src/MeoAsstGui/UserControl/TimerSettingsUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource TextBlockDefault}" Text="仅填写小时数,将在整点时执行&#xA;注意:关卡选择不能为 '当前关卡'" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10" />
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource TextBlockDefault}" Text="仅填写小时数,将在整点时执行" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10" />

<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<CheckBox IsChecked="{Binding Timer1}" Content="定时 1" Margin="10" />
Expand Down
7 changes: 4 additions & 3 deletions src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ public void InitializeItems()

AllStageList = new List<CombData>
{
new CombData { Display = Localization.GetString("CurrentStage"), Value = string.Empty },
new CombData { Display = Localization.GetString("LastBattle"), Value = "LastBattle" },
new CombData { Display = Localization.GetString("DefaultStage"), Value = string.Empty },
//new CombData { Display = Localization.GetString("CurrentStage"), Value = string.Empty },
//new CombData { Display = Localization.GetString("LastBattle"), Value = "LastBattle" },

new CombData { Display = "1-7", Value = "1-7" },
new CombData { Display = Localization.GetString("CE-6"), Value = "CE-6" },
Expand Down Expand Up @@ -301,7 +302,7 @@ public void UpdateStageList()
}
if (!hasSavedValue)
{
Stage = "LastBattle";
Stage = "DefaultStage";
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Python/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def my_callback(msg, details, arg):

asst.append_task('StartUp')
asst.append_task('Fight', {
'stage': 'LastBattle',
'stage': '',
'report_to_penguin': True,
# 'penguin_id': '1234567'
})
Expand Down
2 changes: 1 addition & 1 deletion src/Python/timed_start/timed_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def job():
# asst.append_task('StartUp')
asst.append_task('Fight', {
'report_to_penguin': True,
'stage': 'LastBattle',
'stage': '',
# 'penguin_id': '1234567'
})
asst.append_task('Recruit', {
Expand Down

0 comments on commit bb07197

Please sign in to comment.