mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-25 17:35:34 +00:00
角色相关命令在V3下会使用V3的角色别名一同查询
This commit is contained in:
parent
cddabfa913
commit
c103d680f0
@ -17,6 +17,8 @@ let elemMap = {}
|
||||
// 元素名
|
||||
let elemTitleMap = {}
|
||||
|
||||
let gsCfg
|
||||
|
||||
async function init () {
|
||||
let { sysCfg, diyCfg } = await Data.importCfg('character')
|
||||
lodash.forEach([diyCfg.customCharacters, sysCfg.characters], (roleIds) => {
|
||||
@ -50,6 +52,9 @@ async function init () {
|
||||
})
|
||||
})
|
||||
abbrMap = sysCfg.abbr
|
||||
|
||||
gsCfg = await Data.importDefault('plugins/genshin/model/gsCfg.js', 'root')
|
||||
console.log(gsCfg)
|
||||
}
|
||||
|
||||
await init()
|
||||
@ -94,6 +99,13 @@ const CharId = {
|
||||
if (aliasMap[ds]) {
|
||||
return ret(aliasMap[ds])
|
||||
}
|
||||
// 调用V3方法匹配
|
||||
if (gsCfg && gsCfg.getRole) {
|
||||
let roleRet = gsCfg.getRole(ds)
|
||||
if (roleRet.name && aliasMap[roleRet.name]) {
|
||||
return ret(aliasMap[roleRet.name])
|
||||
}
|
||||
}
|
||||
// 无匹配结果
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user