Skip to content

Commit

Permalink
葛朗台跑单设置
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Sep 28, 2023
1 parent 091cff5 commit acf0766
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arknights_mower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def initialize(tasks, scheduler=None):
base_scheduler.operators = {}
plan1 = {}
plan_config = PlanConfig(plan['conf']['rest_in_full'],plan['conf']['exhaust_require'], plan['conf']['resting_priority'], ling_xi= plan['conf']['ling_xi'],
workaholic=plan['conf']['workaholic'],max_resting_count= plan['conf']['max_resting_count'], free_blacklist=conf['free_blacklist'],resting_threshold=conf['resting_threshold'])
workaholic=plan['conf']['workaholic'],max_resting_count= plan['conf']['max_resting_count'], free_blacklist=conf['free_blacklist'],resting_threshold=conf['resting_threshold'], run_order_buffer_time=plan['run_order_grandet_mode']['buffer_time'] if plan['run_order_grandet_mode']['enable'] else -1)
for key in plan[plan['default']]:
plan1[key] = [Room(obj["agent"],obj["group"],obj["replacement"]) for obj in plan[plan['default']][key]['plans']]
# 默认任务
Expand Down
17 changes: 16 additions & 1 deletion ui/src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const {
resting_threshold,
tap_to_launch_game,
exit_game_when_idle,
screenshot
screenshot,
run_order_grandet_mode
} = storeToRefs(config_store)
const { operators } = storeToRefs(plan_store)
Expand Down Expand Up @@ -201,10 +202,24 @@ function render_label(option) {
<help-text>
<div>推荐范围5-10</div>
<div>可填小数</div>
<div>单位:分钟</div>
</help-text>
</template>
<n-input-number v-model:value="run_order_delay" />
</n-form-item>
<n-form-item :show-label="false">
<n-checkbox v-model:checked="run_order_grandet_mode.enable">葛朗台跑单</n-checkbox>
</n-form-item>
<n-form-item v-if="run_order_grandet_mode.enable">
<template #label>
<span>葛朗台缓冲时间</span>
<help-text>
<div>推荐范围:15-30</div>
<div>单位:秒</div>
</help-text>
</template>
<n-input-number v-model:value="run_order_grandet_mode.buffer_time" />
</n-form-item>
<n-form-item>
<template #label>
<span>无人机使用房间</span>
Expand Down
11 changes: 8 additions & 3 deletions ui/src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const useConfigStore = defineStore('config', () => {
const recruit_only_4 = ref(false)
const recruitment_time = ref(false)
const recruit_robot = ref(true)
const run_order_grandet_mode = ref({})

async function load_shop() {
const response = await axios.get(`${import.meta.env.VITE_HTTP_URL}/shop`)
Expand Down Expand Up @@ -121,6 +122,7 @@ export const useConfigStore = defineStore('config', () => {
recruit_only_4.value = response.data.recruit_only_4
recruitment_time.value = response.data.recruitment_time
recruit_robot.value = response.data.recruit_robot
run_order_grandet_mode.value = response.data.run_order_grandet_mode
}

function build_config() {
Expand Down Expand Up @@ -177,7 +179,8 @@ export const useConfigStore = defineStore('config', () => {
recruit_enable: recruit_enable.value,
recruit_only_4: recruit_only_4.value,
recruitment_time: recruitment_time.value,
recruit_robot: recruit_robot.value
recruit_robot: recruit_robot.value,
run_order_grandet_mode: run_order_grandet_mode.value
}
}

Expand Down Expand Up @@ -230,7 +233,8 @@ export const useConfigStore = defineStore('config', () => {
recruitment_time,
recruit_robot,
skland_enable,
skland_info
skland_info,
run_order_grandet_mode
],
() => {
axios.post(`${import.meta.env.VITE_HTTP_URL}/conf`, build_config())
Expand Down Expand Up @@ -291,6 +295,7 @@ export const useConfigStore = defineStore('config', () => {
recruitment_time,
recruit_robot,
skland_enable,
skland_info
skland_info,
run_order_grandet_mode
}
})

0 comments on commit acf0766

Please sign in to comment.