适配Miao-Yunzai v3.1.3的部分修改

This commit is contained in:
Kokomi 2023-11-08 03:07:56 +08:00
parent 7dadd6bd15
commit f4438789b8
4 changed files with 11 additions and 2 deletions

View File

@ -123,7 +123,12 @@ let Avatar = {
if (e?.runtime?.gsCfg) { if (e?.runtime?.gsCfg) {
let gsCfg = e?.runtime?.gsCfg let gsCfg = e?.runtime?.gsCfg
Meta.addAliasFn('gs', 'char', (txt) => { 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) { if (roleRet.name) {
return roleRet.name return roleRet.name
} }

View File

@ -123,6 +123,9 @@ class MetaData {
const MetaFn = (fnKey) => { const MetaFn = (fnKey) => {
return (game, type, args = '') => { return (game, type, args = '') => {
if (!game) {
game = 'gs'
}
let meta = Meta.create(game, type) let meta = Meta.create(game, type)
return meta[fnKey](args) return meta[fnKey](args)
} }
@ -154,7 +157,7 @@ const Meta = {
// 在各个游戏内匹配以传入的game优先 // 在各个游戏内匹配以传入的game优先
matchGame (game = 'gs', type, txt) { matchGame (game = 'gs', type, txt) {
txt = lodash.trim(txt + '').toLowerCase() 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) { for (let currGame of games) {
let id = Meta.getId(currGame, type, txt) let id = Meta.getId(currGame, type, txt)
if (id) { if (id) {

View File

@ -145,6 +145,7 @@ const CharImg = {
add(`cons${i}`, `imgs/cons-${i}`) add(`cons${i}`, `imgs/cons-${i}`)
} }
} }
imgs.banner = 'meta-sr/character/common/imgs/banner.webp'
imgs.cons3 = imgs[talentCons[3]] imgs.cons3 = imgs[talentCons[3]]
imgs.cons5 = imgs[talentCons[5]] imgs.cons5 = imgs[talentCons[5]]
return imgs return imgs

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB