From c103d680f0e4ac854090c18847f12e2d212f102b Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Mon, 3 Oct 2022 04:02:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=9B=B8=E5=85=B3=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=9C=A8V3=E4=B8=8B=E4=BC=9A=E4=BD=BF=E7=94=A8V3?= =?UTF-8?q?=E7=9A=84=E8=A7=92=E8=89=B2=E5=88=AB=E5=90=8D=E4=B8=80=E5=90=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/character-lib/CharId.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/models/character-lib/CharId.js b/models/character-lib/CharId.js index 56c326d5..8e7823fb 100644 --- a/models/character-lib/CharId.js +++ b/models/character-lib/CharId.js @@ -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 }