feat(aklive2d): many changes

- generalized env_generator
- fixed content_processor
- updated config to add fields
- removed redundant fields in config
This commit is contained in:
Haoyu Xu
2023-02-25 21:36:54 -05:00
parent e98bf8d7ea
commit 7e2a2a1d40
35 changed files with 220 additions and 141 deletions

View File

@@ -2,5 +2,19 @@ import path from 'path'
import { read } from './yaml.js'
export default function () {
return read(path.join(__projetRoot, 'config.yaml'))
return process(read(path.join(__projetRoot, 'config.yaml')))
}
function process(config) {
for (const [operatorName, operator] of Object.entries(config.operators)) {
// add title
operator.title = `${config.share.title["en-US"]}${operator.codename["en-US"]} - ${config.share.title["zh-CN"]}${operator.codename["zh-CN"]}`
// add type
operator.type = operator.codename["zh-CN"].includes('·') ? 'operator' : 'skin'
// add link
operator.link = operatorName
}
return config
}