Skip to content

Commit

Permalink
feat: 支持关闭游戏 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO authored Oct 9, 2023
2 parents eaa5397 + 513db9c commit 2e88d91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions assets/resource/pipeline/shutdown.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"Close1999": {
"action": "StopApp"
}
}
8 changes: 6 additions & 2 deletions source/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ bool proc_argv(int argc, char** argv, bool& debug, std::string& adb, std::string
<< std::endl
<< utf8_to_crt("选择任务,会自动登录,但不会启动模拟器") << std::endl
<< std::endl
<< utf8_to_crt("1. 启动游戏\n"
<< utf8_to_crt("0. 关闭游戏\n"
"1. 启动游戏\n"
"2. 收取荒原\n"
"3. 领取奖励\n"
"4. 每日心相(意志解析)\n"
Expand Down Expand Up @@ -389,6 +390,9 @@ bool proc_argv(int argc, char** argv, bool& debug, std::string& adb, std::string
task_obj.name = "MyTask" + std::to_string(index++);

switch (id) {
case 0:
task_obj.type = "Close1999";
break;
case 1:
task_obj.type = "StartUp";
break;
Expand Down Expand Up @@ -485,7 +489,7 @@ void save_config(const std::string& adb, const std::string& adb_address, int& cl
tasks_array.emplace(std::move(task_obj));
}
config["tasks"] = std::move(tasks_array);
config["tasks_Doc"] = "要执行的任务 StartUp, Wilderness, Psychube, Awards, Combat";
config["tasks_Doc"] = "要执行的任务 StartUp, Wilderness, Psychube, Awards, Combat, Close1999";

config["touch"] = (ctrl_type & MaaAdbControllerType_Touch_Mask) >> 0;
config["touch_Doc"] = "点击方式:1: Adb, 2: MiniTouch, 3: MaaTouch";
Expand Down

0 comments on commit 2e88d91

Please sign in to comment.