Skip to content

Commit

Permalink
添加Maa自动吃过期药选项,调整周计划布局
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Sep 30, 2023
1 parent ea57daf commit e2a70a1
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 22 deletions.
1 change: 1 addition & 0 deletions arknights_mower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def set_maa_options(base_scheduler):
maa_config['maa_path'] = conf['maa_path']
maa_config['maa_adb_path'] = conf['maa_adb_path']
maa_config['maa_adb'] = conf['adb']
maa_config['expiring_medicine'] = conf['maa_expiring_medicine']
maa_config['weekly_plan'] = conf['maa_weekly_plan']
maa_config['roguelike'] = conf['maa_rg_enable'] == 1 and conf['maa_long_task_type'] == 'rogue'
maa_config['rogue_theme'] = conf['maa_rg_theme']
Expand Down
2 changes: 1 addition & 1 deletion arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,7 @@ def append_maa_task(self, type):
'penguin_id': '',
'DrGrandet': False,
'server': 'CN',
'expiring_medicine': 9999
'expiring_medicine': 999 if self.maa_config['expiring_medicine'] else 0,
})
self.stages.append(stage)
elif type == 'Mall':
Expand Down
1 change: 1 addition & 0 deletions arknights_mower/templates/conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ maa_enable: 0
maa_rg_enable: 0
maa_long_task_type: rogue
maa_path: D:\MAA-v4.13.0-win-x64
maa_expiring_medicine: true
maa_weekly_plan:
- medicine: 0
stage: ['']
Expand Down
1 change: 1 addition & 0 deletions diy.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"sleep_min": "",
"sleep_max": "",
"expiring_medicine": True,
"weekly_plan": [{"weekday": "周一", "stage": ['PR-A-2'], "medicine": 0},
{"weekday": "周二", "stage": ['Annihilation', 'PR-B-2'], "medicine": 0},
{"weekday": "周三", "stage": ['Annihilation', 'PR-D-2'], "medicine": 0},
Expand Down
59 changes: 38 additions & 21 deletions ui/src/components/MaaWeekly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { storeToRefs } from 'pinia'
import { useConfigStore } from '@/stores/config'
const store = useConfigStore()
const { maa_weekly_plan, maa_enable } = storeToRefs(store)
const { maa_weekly_plan, maa_enable, maa_expiring_medicine } = storeToRefs(store)
import { NTag } from 'naive-ui'
import { h } from 'vue'
import { h, inject } from 'vue'
const mobile = inject('mobile')
function render_tag({ option, handleClose }) {
return h(
Expand Down Expand Up @@ -77,7 +79,6 @@ function create_tag(label) {
<div class="card-title">Maa周计划</div>
<help-text>
<p>理智药的数量表示“每次调用Maa时吃多少”,不是“每天吃多少”。</p>
<p>48 小时内过期的理智药会自动使用。</p>
<p>“每天”从凌晨四点开始,与游戏内一致。</p>
<span>关卡填写说明:</span>
<ul>
Expand Down Expand Up @@ -119,12 +120,36 @@ function create_tag(label) {
</help-text>
</n-checkbox>
</template>
<n-form
:label-placement="mobile ? 'top' : 'left'"
:show-feedback="false"
label-width="72"
label-align="left"
>
<n-form-item :show-label="false">
<n-checkbox v-model:checked="maa_expiring_medicine">
自动使用48小时内过期的理智药
</n-checkbox>
</n-form-item>
</n-form>
<n-button
text
tag="a"
href="https://m.prts.wiki/w/%E5%85%B3%E5%8D%A1%E4%B8%80%E8%A7%88/%E8%B5%84%E6%BA%90%E6%94%B6%E9%9B%86"
target="_blank"
type="primary"
class="prts-wiki-link"
>
PRTS.wiki:关卡一览/资源收集
</n-button>
<table>
<tr>
<th></th>
<th>关卡</th>
<th>每次吃药</th>
</tr>
<tr v-for="plan in maa_weekly_plan" :key="plan.weekday">
<td>
<n-h4>{{ plan.weekday }}</n-h4>
</td>
<td>关卡</td>
<td>{{ plan.weekday }}</td>
<td>
<n-select
v-model:value="plan.stage"
Expand All @@ -137,7 +162,6 @@ function create_tag(label) {
:on-create="create_tag"
/>
</td>
<td>理智药</td>
<td>
<n-input-number v-model:value="plan.medicine" :min="0" />
</td>
Expand Down Expand Up @@ -167,27 +191,20 @@ table {
td {
&:nth-child(1) {
width: 40px;
}
&:nth-child(2) {
width: 32px;
text-align: left;
}
&:nth-child(3) {
padding-right: 8px;
}
&:nth-child(4) {
width: 50px;
}
&:nth-child(5) {
width: 90px;
width: 80px;
}
}
}
.tag-mr {
margin-right: 4px;
}
.prts-wiki-link {
margin: 8px 0;
}
</style>
5 changes: 5 additions & 0 deletions ui/src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const useConfigStore = defineStore('config', () => {
const maa_adb_path = ref('')
const maa_enable = ref(false)
const maa_path = ref('')
const maa_expiring_medicine = ref(true)
const maa_weekly_plan = ref([])
const maa_weekly_plan1 = ref([])
const maa_rg_enable = ref(0)
Expand Down Expand Up @@ -81,6 +82,7 @@ export const useConfigStore = defineStore('config', () => {
maa_path.value = response.data.maa_path
maa_rg_enable.value = response.data.maa_rg_enable == 1
maa_long_task_type.value = response.data.maa_long_task_type
maa_expiring_medicine.value = response.data.maa_expiring_medicine
maa_weekly_plan.value = response.data.maa_weekly_plan
maa_weekly_plan1.value = response.data.maa_weekly_plan1
mail_enable.value = response.data.mail_enable != 0
Expand Down Expand Up @@ -139,6 +141,7 @@ export const useConfigStore = defineStore('config', () => {
maa_path: maa_path.value,
maa_rg_enable: maa_rg_enable.value ? 1 : 0,
maa_long_task_type: maa_long_task_type.value,
maa_expiring_medicine: maa_expiring_medicine.value,
maa_weekly_plan: maa_weekly_plan.value,
maa_weekly_plan1: maa_weekly_plan1.value,
mail_enable: mail_enable.value ? 1 : 0,
Expand Down Expand Up @@ -195,6 +198,7 @@ export const useConfigStore = defineStore('config', () => {
maa_adb_path,
maa_enable,
maa_path,
maa_expiring_medicine,
maa_weekly_plan,
maa_weekly_plan1,
maa_rg_enable,
Expand Down Expand Up @@ -255,6 +259,7 @@ export const useConfigStore = defineStore('config', () => {
maa_path,
maa_rg_enable,
maa_long_task_type,
maa_expiring_medicine,
maa_weekly_plan,
maa_weekly_plan1,
mail_enable,
Expand Down

0 comments on commit e2a70a1

Please sign in to comment.