mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-04-01 06:09:50 +08:00
feat(auto-tools): 添加锄地队伍配置功能
- 新增 HoeGround.json 配置文件用于存储锄地队伍映射 - 实现基于 JSON 的锄地队伍配置支持 - 添加 UID 过滤的锄地队伍映射功能 - 优化 PathOrder.json 默认配置结构 - 移除调试代码并完善配置加载日志
This commit is contained in:
@@ -35,6 +35,8 @@ const json_path_name = {
|
||||
RefreshSettings: `${config_root}\\RefreshSettings.json`,
|
||||
pathJsonByUid: `${config_root}\\path-json-by-uid.json`,
|
||||
PathOrder: `${config_root}\\PathOrder.json`,
|
||||
HoeGround: `${config_root}\\HoeGround.json`,
|
||||
|
||||
}
|
||||
// 定义记录文件的路径
|
||||
// let RecordText = `${config_root}\\record.json`
|
||||
@@ -591,17 +593,27 @@ async function initRun(config_run) {
|
||||
}
|
||||
|
||||
let groups = groupByParentAndName(matchedPaths);
|
||||
|
||||
//锄地队对应
|
||||
try {
|
||||
const teamHoeGroundStr = settings.team_hoe_ground || "parentName->name=key"
|
||||
teamHoeGroundStr.split(",").forEach(item => {
|
||||
const [key, order] = item.split("=");
|
||||
team.HoeGroundMap.set(key, parseInt(order))
|
||||
const [key, team_name] = item.split("=");
|
||||
team.HoeGroundMap.set(key, team_name)
|
||||
})
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try{
|
||||
// {
|
||||
// uid:"",
|
||||
// parent_name:"",
|
||||
// name:"",
|
||||
// team_name:""
|
||||
// } json支持
|
||||
const teamHoeGroundList = JSON.parse(file.readTextSync(json_path_name.HoeGround)) ?? [{ uid: "", parent_name: "", name: "", team_name: ""}]
|
||||
teamHoeGroundList.filter(item => item.uid === Record.uid).forEach(item => team.HoeGroundMap.set(`${item.parent_name}->${item.name}`, item.team_name))
|
||||
log.info(`{0}加载完成`, json_path_name.HoeGround)
|
||||
} catch (e) {
|
||||
}
|
||||
// 排序
|
||||
const orderMap = new Map()
|
||||
try {
|
||||
@@ -612,7 +624,6 @@ async function initRun(config_run) {
|
||||
orderMap.set(key, parseInt(order))
|
||||
})
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -622,11 +633,10 @@ async function initRun(config_run) {
|
||||
// name:"",
|
||||
// order:0
|
||||
// } json支持
|
||||
const orderList = JSON.parse(file.readTextSync(json_path_name.PathOrder)) ?? []
|
||||
const orderList = JSON.parse(file.readTextSync(json_path_name.PathOrder)) ?? [{ uid: "", parent_name: "", name: "", order: 0 }]
|
||||
orderList.filter(item => item.uid === Record.uid).forEach(item => orderMap.set(`${item.parent_name}->${item.name}`, item.order))
|
||||
log.info(`{0}加载完成`, json_path_name.PathOrder)
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
groups.sort((a, b) => {
|
||||
@@ -655,11 +665,6 @@ async function initRun(config_run) {
|
||||
'log-needRunMap.json',
|
||||
JSON.stringify([...needRunMap])
|
||||
);
|
||||
// needRunMap.set(as_name, {
|
||||
// paths: matchedPaths,
|
||||
// as_name: as_name,
|
||||
// name: settingsName //多选项 名称 如 treeLevel_0_0
|
||||
// });
|
||||
}
|
||||
log.info("[执行前配置完成] needRunMap.size={0}", needRunMap.size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user