mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-24 17:19:25 +00:00
适配Miao-Yunzai v3.1.3的部分修改
This commit is contained in:
parent
7dadd6bd15
commit
f4438789b8
@ -123,7 +123,12 @@ let Avatar = {
|
||||
if (e?.runtime?.gsCfg) {
|
||||
let gsCfg = e?.runtime?.gsCfg
|
||||
Meta.addAliasFn('gs', 'char', (txt) => {
|
||||
let roleRet = gsCfg.getRole(txt)
|
||||
let roleRet
|
||||
if (gsCfg._getRole) {
|
||||
roleRet = gsCfg._getRole(txt)
|
||||
} else {
|
||||
roleRet = gsCfg.getRole(txt)
|
||||
}
|
||||
if (roleRet.name) {
|
||||
return roleRet.name
|
||||
}
|
||||
|
@ -123,6 +123,9 @@ class MetaData {
|
||||
|
||||
const MetaFn = (fnKey) => {
|
||||
return (game, type, args = '') => {
|
||||
if (!game) {
|
||||
game = 'gs'
|
||||
}
|
||||
let meta = Meta.create(game, type)
|
||||
return meta[fnKey](args)
|
||||
}
|
||||
@ -154,7 +157,7 @@ const Meta = {
|
||||
// 在各个游戏内匹配,以传入的game优先
|
||||
matchGame (game = 'gs', type, txt) {
|
||||
txt = lodash.trim(txt + '').toLowerCase()
|
||||
let games = game === 'gs' ? ['gs', 'sr'] : ['sr', 'gs']
|
||||
let games = (!game || game === 'gs') ? ['gs', 'sr'] : ['sr', 'gs']
|
||||
for (let currGame of games) {
|
||||
let id = Meta.getId(currGame, type, txt)
|
||||
if (id) {
|
||||
|
@ -145,6 +145,7 @@ const CharImg = {
|
||||
add(`cons${i}`, `imgs/cons-${i}`)
|
||||
}
|
||||
}
|
||||
imgs.banner = 'meta-sr/character/common/imgs/banner.webp'
|
||||
imgs.cons3 = imgs[talentCons[3]]
|
||||
imgs.cons5 = imgs[talentCons[5]]
|
||||
return imgs
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 9.0 KiB |
Loading…
Reference in New Issue
Block a user