Skip to content

Commit

Permalink
Merge pull request #418 from EightyDollars/dev_shawn
Browse files Browse the repository at this point in the history
feat:增加雷电9的自动重启等功能
  • Loading branch information
ZhaoZuohong authored Nov 26, 2023
2 parents fa242dc + 8299c25 commit 352ceca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 71 deletions.
11 changes: 11 additions & 0 deletions arknights_mower/utils/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
class Simulator_Type(Enum):
Nox = "夜神"
MuMu12 = "MuMu12"
Leidian9 = "雷电9"
Waydroid = "Waydroid"


def restart_simulator(data, stop=True, start=True):
index = data["index"]
simulator_type = data["name"]
cmd = ""

if simulator_type in [
Simulator_Type.Nox.value,
Simulator_Type.MuMu12.value,
Simulator_Type.Leidian9.value,
Simulator_Type.Waydroid.value,
]:
if simulator_type == Simulator_Type.Nox.value:
Expand All @@ -31,6 +34,12 @@ def restart_simulator(data, stop=True, start=True):
cmd += "shutdown_player"
elif simulator_type == Simulator_Type.Waydroid.value:
cmd = "waydroid session stop"
elif simulator_type == Simulator_Type.Leidian9.value:
cmd = "ldconsole.exe quit --index "
if index >= 0:
cmd += f'{data["index"]} '
else:
cmd += '0'
if stop:
exec_cmd(cmd, data["simulator_folder"])
logger.info(f"关闭{simulator_type}模拟器")
Expand All @@ -41,6 +50,8 @@ def restart_simulator(data, stop=True, start=True):
cmd = cmd.replace(" shutdown_player", " launch_player")
elif simulator_type == Simulator_Type.Waydroid.value:
cmd = "waydroid show-full-ui"
elif simulator_type == Simulator_Type.Leidian9.value:
cmd = cmd.replace("quit", "launch")
if start:
exec_cmd(cmd, data["simulator_folder"])
logger.info(f"开始启动{simulator_type}模拟器,等待25秒钟")
Expand Down
80 changes: 9 additions & 71 deletions ui/src/components/Recruit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,66 +56,18 @@ const recruit_4 = ref('900')
</td>
</tr>
<tr>
<td>四星</td>
<td>
<n-radio-group name="recruit_4" v-model:value="recruit_4">
<n-space justify="start">
<n-radio value="900">9:00</n-radio>
</n-space>
</n-radio-group>
</td>
</tr>
<tr>
<td rowspan="2">五星</td>
<td>
<n-radio-group name="recruit_4" v-model:value="recruit_4">
<n-space justify="start">
<n-radio value="900">
邮件通知
<help-text>
<div>发送邮件通知,不自动选择</div>
</help-text>
</n-radio>
</n-space>
</n-radio-group>
</td>
</tr>
<tr>
<td>五星</td>
<td>
<n-radio-group name="recruit_auto_5" v-model:value="recruit_auto_5">
<n-space justify="start">
<n-radio :value="1">
自动选择
<help-text>
<div>自动选择五星tag</div>
</help-text>
手动
</n-radio>
<n-radio :value="2">
半自动选择
<help-text>
<div>只有一个选项时自动进行选择</div>
</help-text>
自动
</n-radio>
<n-radio :value="3">
手动选择
<help-text>
<div>不自动选择</div>
</help-text>
</n-radio>
</n-space>
</n-radio-group>
</td>
</tr>
<tr>
<td>六星</td>
<td>
<n-radio-group name="recruit_4" v-model:value="recruit_4">
<n-space justify="start">
<n-radio value="900">
邮件通知
<help-text>
<div>发送邮件通知,不自动选择</div>
</help-text>
仅标签唯一时自动选择
</n-radio>
</n-space>
</n-radio-group>
Expand All @@ -124,22 +76,9 @@ const recruit_4 = ref('900')
<tr>
<td>支援机械</td>
<td>
<n-radio-group name="recruit_robot" v-model:value="recruit_robot">
<n-space justify="start">
<n-radio :value="true">
邮件通知
<help-text>
<div>发送邮件通知,不自动选择</div>
</help-text>
</n-radio>
<n-radio :value="false">
忽略标签
<help-text>
<div>忽略支援机械标签,按策略自动刷新或选择标签</div>
</help-text>
</n-radio>
</n-space>
</n-radio-group>
<n-checkbox v-model:checked="recruit_robot">
保留标签
</n-checkbox>
</td>
</tr>
</tbody>
Expand All @@ -163,7 +102,7 @@ h4 {
.big-table {
margin-top: 10px;
max-width: 480px;
max-width: 320px;
th {
text-align: center;
Expand All @@ -177,12 +116,11 @@ h4 {
height: 24px;
&:nth-child(1) {
width: 60px;
width: 70px;
text-align: center;
}
&:nth-child(2) {
width: 420px;
text-align: center;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const simulator_types = [
{ label: '夜神', value: '夜神' },
{ label: 'MuMu模拟器12', value: 'MuMu12' },
{ label: 'Waydroid', value: 'Waydroid' },
{ label: '雷电模拟器9', value: '雷电9' },
{ label: '其它', value: '' }
]
Expand Down

0 comments on commit 352ceca

Please sign in to comment.