修正一些已知问题

This commit is contained in:
Kokomi 2023-04-01 04:03:05 +08:00
parent 10d9784a6e
commit 48705666cb
6 changed files with 32 additions and 11 deletions

View File

@ -51,8 +51,10 @@ const ProfileList = {
async render (e) {
let uid = await getTargetUid(e)
if (!uid) {
e._replyNeedUid || e.reply('请先发送【#绑定+你的UID】来绑定查询目标')
return true
}
let isSelfUid = false
if (e.runtime) {
let uids = e.runtime?.user?.ckUids || []

View File

@ -1,4 +1,4 @@
import { Character, ProfileRank, ProfileDmg, Player } from '../../models/index.js'
import { Character, ProfileRank, ProfileDmg, Player } from '#miao.models'
import ProfileDetail from './ProfileDetail.js'
import { Data, Common, Format } from '#miao'
import lodash from 'lodash'
@ -202,7 +202,7 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) {
if (uid) {
let userInfo = await ProfileRank.getUidInfo(uid)
if (userInfo && userInfo.qq) {
let member = e.group?.pickMember(userInfo.qq * 1)
let member = e.group?.pickMember(userInfo.qq)
let img = member?.getAvatarUrl(140)
if (img) {
tmp.qqFace = img
@ -225,15 +225,13 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) {
}
let title
if (char) {
if (mode === 'mark') {
title = `#${char.name}${'圣遗物评分'}排行`
}
if (mode === 'crit') {
title = `#${char.name}${'双爆副词条'}排行`
}
if (mode === 'valid') {
title = `#${char.name}${'加权有效词条'}排行`
let modeTitleMap = {
dmg: '',
mark: '圣遗物评分',
crit: '双爆副词条',
valid: '加权有效词条'
}
title = `#${char.name}${modeTitleMap[mode]}排行`
list = lodash.sortBy(list, mode === 'dmg' ? '_dmg' : '_mark').reverse()
} else {
title = `#${mode === 'mark' ? '最高分' : '最强'}排行`

View File

@ -1,20 +1,31 @@
import fs from 'fs'
import lodash from 'lodash'
import cfgData from './cfg/CfgData.js'
import { Version } from '#miao'
const _path = process.cwd()
const _cfgPath = `${_path}/plugins/miao-plugin/components/`
let cfg = {}
let miaoCfg = {}
try {
cfg = await cfgData.getCfg()
cfgData.saveCfg(cfg)
lodash.forEach(cfgData.getCfgSchemaMap(), (cm) => {
if (cm.miao) {
miaoCfg[cm.cfgKey] = true
}
})
} catch (e) {
// do nth
}
let Cfg = {
get (rote) {
if (Version.isMiao && miaoCfg[rote]) {
return true
}
return lodash.get(cfg, rote)
},
set (rote, val) {

View File

@ -18,7 +18,7 @@
<li class="cfg-li">
<div class="cfg-line">
{{cfgItem.title}}
{{if !cfgItem.miao}}
{{if !(cfgItem.miao && isMiao) }}
<span class="cfg-hint"> #喵喵设置{{cfgItem.key}}
{{if cfgItem.type==='num'}} {{cfgItem.def}}{{else}} 开启/关闭{{/if}}
</span>

View File

@ -366,6 +366,7 @@ const buffs = {
2: attr('dmg', 15, '草'),
4: {
title: '元素战技或元素爆发命中敌人后使命中目标的草元素抗性降低30%',
check: ({ element }) => element === '草',
data: {
kx: 30
}

View File

@ -433,4 +433,13 @@ export const poolDetail = [{
char4: ['米卡', '砂糖', '迪奥娜'],
weapon5: ['息灾', '雾切之回光'],
weapon4: ['暗巷的酒与诗', '祭礼剑', '钟剑', '西风长枪', '西风猎弓']
}, {
version: '3.6',
half: '上半',
from: '2023-04-12 06:00:00',
to: '2023-05-02 17:59:59',
char5: ['妮露', '纳西妲'],
char4: ['米卡', '砂糖', '迪奥娜'], // 待更新
weapon5: ['圣显之钥', '千夜浮梦'],
weapon4: ['暗巷的酒与诗', '祭礼剑', '钟剑', '西风长枪', '西风猎弓'] // 待更新
}]