diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ae15d93..b1a792d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -# 2.0 Alpha.5 +# 2.0 Alpha.6 + +* 一些已知Bug修复 +* `#面板练度统计` 样式微调 + +# 2.0 Alpha.1~5 * `#面板练度统计` 功能调整 * 在未绑定CK时,使用本地面板数据展示练度信息 @@ -6,10 +11,6 @@ * 重写角色数据获取逻辑,可能会导致一些角色信息类的查询异常,如遇问题请反馈 * `#刻晴`、`#老婆`等命令获取角色数据会使用本地面板数据做兜底 * MysApi内部逻辑重写 -* 一些已知Bug修复 - -# 2.0 Alpha.1~4 - * 重写`#刻晴`的角色卡片样式 * `#妮露天赋` 样式微调 * `#深渊配队`、`#戳一戳` 适配V3 diff --git a/README.md b/README.md index 1c29279a..9f8b9c8b 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,11 @@ V2-Yunzai在较长一段时间内会维持更新,进行一些Bugfix及更新 ### #更新面板 -`#更新面板` 依赖于面板查询API,面板服务由 http://enka.shinshin.moe/ 提供 +`#更新面板` 依赖于面板查询API,面板服务由 http://enka.network/ 提供 查询功能经Enka官方授权([issue#63](https://github.com/yoimiya-kokomi/miao-plugin/issues/63#issuecomment-1199348789)),感谢Enka提供的面板查询服务 -如果可以的话,也请在Patreon上支持Enka,或提供闲置的原神账户,具体可在[Enka官网](http://enka.shinshin.moe/) Discord联系 +如果可以的话,也请在Patreon上支持Enka,或提供闲置的原神账户,具体可在[Enka官网](http://enka.network/) Discord联系 [issue#63](https://github.com/yoimiya-kokomi/miao-plugin/issues/63#issuecomment-1199734496) : 国内网络如Enka服务访问不稳定,可尝试更换 [@MiniGrayGay](https://github.com/MiniGrayGay) 大佬提供的中转服务 复制`config/profile_default.js` diff --git a/apps/character/avatar-card.js b/apps/character/avatar-card.js index bacf41dd..1755128f 100644 --- a/apps/character/avatar-card.js +++ b/apps/character/avatar-card.js @@ -76,7 +76,7 @@ async function renderCard (e, ds, renderType = 'card') { mode: bg.mode, custom, data - }, { e, scale: 1.1, retMsgId: true }) + }, { e, scale: 1.4, retMsgId: true }) if (msgRes && msgRes.message_id) { // 如果消息发送成功,就将message_id和图片路径存起来,1小时过期 await redis.set(`miao:original-picture:${msgRes.message_id}`, bg.img, { EX: 3600 }) diff --git a/apps/character/character-img-upload.js b/apps/character/character-img-upload.js index 60744db3..136a6ef7 100644 --- a/apps/character/character-img-upload.js +++ b/apps/character/character-img-upload.js @@ -39,7 +39,7 @@ export async function uploadCharacterImg (e) { // 支持at图片添加,以及支持后发送 source = (await e.group.getChatHistory(e.source?.seq, 1)).pop() } else { - source = (await e.friend.getChatHistory(e.source?.time, 1)).pop() + source = (await e.friend.getChatHistory((e.source?.time + 1), 1)).pop() } if (source) { for (let val of source.message) { @@ -50,7 +50,7 @@ export async function uploadCharacterImg (e) { } if (imageMessages.length <= 0) { - e.reply('消息中未找到图片,请将要发送的图片与消息一同发送..') + e.reply('消息中未找到图片,请将要发送的图片与消息一同发送或引用要添加的图像..') return true } await saveImages(e, name, imageMessages) @@ -67,7 +67,12 @@ async function saveImages (e, name, imageMessages) { } let senderName = lodash.truncate(e.sender.card, { length: 8 }) let imgCount = 0 + let urlMap = {} for (let val of imageMessages) { + if (!val.url || urlMap[val.url]) { + continue + } + urlMap[val.url] = true const response = await fetch(val.url) if (!response.ok) { e.reply('图片下载失败。') @@ -96,8 +101,7 @@ async function saveImages (e, name, imageMessages) { console.log('unlink', err) }) } - fs.rename(imgPath, newImgPath, (err) => { - console.log('rename', err) + fs.rename(imgPath, newImgPath, () => { }) imgCount++ Bot.logger.mark(`添加成功: ${path}/${fileName}`) diff --git a/apps/character/profile-common.js b/apps/character/profile-common.js index 8591c03f..9b038848 100644 --- a/apps/character/profile-common.js +++ b/apps/character/profile-common.js @@ -30,13 +30,13 @@ export async function getTargetUid (e) { return nc.uid } } - uid = await redis.get(`genshin:id-uid:${qq}`) || await redis.get(`genshin:uid:${qq}`) + uid = await redis.get(`genshin:id-uid:${qq}`) || await redis.get(`Yz:genshin:mys:qq-uid:${qq}`) if (uid && uidReg.test(uid)) { return uid } } if (!Version.isV3) { - let botQQ = global.BotConfig ? global.BotConfig.account.qq : false + let botQQ = global?.Bot?.uin || global?.BotConfig?.account?.qq if (e.at && e.at !== botQQ) { uid = await getUid(e.at) if (uid) { diff --git a/apps/character/profile-stat.js b/apps/character/profile-stat.js index 0776eaf7..8f276843 100644 --- a/apps/character/profile-stat.js +++ b/apps/character/profile-stat.js @@ -36,7 +36,7 @@ export async function profileStat (e) { avatarRet = lodash.orderBy(avatarRet, sortKey) avatarRet = avatarRet.reverse() let talentNotice = '' - if (!avatars.isSelfCookie) { + if (!avatars.isSelfCookie || avatarRet.length <= 8) { talentNotice = '未绑定CK,信息可能展示不完全。回复#体力帮助获取CK配置帮助' } diff --git a/components/Data.js b/components/Data.js index cd9204c1..3fdafb03 100644 --- a/components/Data.js +++ b/components/Data.js @@ -194,6 +194,8 @@ let Data = { if (lodash.isString(arr)) { arr = arr.replace(/\s*(;|;|、|,)\s*/, ',') arr = arr.split(',') + } else if (lodash.isNumber(arr)) { + arr = [arr.toString()] } lodash.forEach(arr, (str, idx) => { if (!lodash.isUndefined(str)) { diff --git a/models/Avatar.js b/models/Avatar.js index 33862ad1..b637c57f 100644 --- a/models/Avatar.js +++ b/models/Avatar.js @@ -153,7 +153,7 @@ export default class Avatar extends Base { } } } - let ret = char.getAvatarTalent(talent, avatar.cons, 'original') + let ret = char.getAvatarTalent(talent, this.cons, 'original') ret.id = id return ret } diff --git a/models/ProfileArtis.js b/models/ProfileArtis.js index 81f21995..20767bfd 100644 --- a/models/ProfileArtis.js +++ b/models/ProfileArtis.js @@ -191,6 +191,7 @@ export default class ProfileArtis extends Base { attrs, classTitle: title, weight: attrWeight, + // 待删除 mark: lodash.mapValues(attrs, (ds) => ds.mark), maxMark } diff --git a/models/User.js b/models/User.js index 79530503..3ef4fa1e 100644 --- a/models/User.js +++ b/models/User.js @@ -13,10 +13,14 @@ class User extends Base { // 初始化用户 constructor (cfg) { super() + if (!cfg.id) { + return false + } let self = this._getCache(`user:${cfg.id}`) if (!self) { self = this } + self.id = cfg.id self.uid = cfg.uid || self.uid || '' self.ck = cfg.ck || cfg.cookie || self.ck || '' return self._cache() diff --git a/resources/character/character-card.html b/resources/character/character-card.html index fd391fbe..6f1216ac 100644 --- a/resources/character/character-card.html +++ b/resources/character/character-card.html @@ -12,7 +12,7 @@
{{data.sName}} {{if data.fetter}} {{/if}} - {{if data.cons}} {{data.cons}}命 {{/if}} + {{if typeof(data.cons)!=='undefined'}} {{data.cons}}命 {{/if}}
Uid:{{uid}} @@ -27,7 +27,7 @@
- {{w.name.length > 5 ? (w.abbr||w.name) : w.name}} + {{w.name.length > 4 ? (w.abbr||w.name) : w.name}}
Lv.{{w.leve || w.level}} 精{{w.affix}} diff --git a/resources/character/profile-stat.css b/resources/character/profile-stat.css index b57e6b22..122aa4ff 100644 --- a/resources/character/profile-stat.css +++ b/resources/character/profile-stat.css @@ -32,7 +32,6 @@ body { display: inline-block; width: 19px; padding: 0; - margin: 0; text-align: center; vertical-align: middle; font-size: 13px; @@ -48,21 +47,18 @@ body { } #profile-stat .level { border-radius: 3px 0 0 3px; - width: 32px; + width: 25px; + white-space: nowrap; + display: inline-block; } #profile-stat .level:before { content: "Lv"; -} -#profile-stat .level:before { display: inline-block; font-size: 12px; transform: scale(0.7); transform-origin: right 55%; margin-left: -3px; } -#profile-stat .level:before { - content: "Lv"; -} .cont { font-size: 14px; background: none; @@ -77,7 +73,7 @@ body { .cont .item-name { padding-left: 5px; text-align: left; - text-shadow: 0 0 1px #fff, 1px 1px 1px rgba(255, 255, 255, 0.5); + text-shadow: 0 0 1px rgba(255, 255, 255, 0.8); } .cont .tr.thead { background: rgba(0, 0, 0, 0.4); @@ -97,19 +93,34 @@ body { box-shadow: 0 0 1px 0 rgba(100, 100, 100, 0.8) inset; } .cont .tr .td.star1 { - background: rgba(255, 132, 132, 0.45); + background: rgba(200, 200, 200, 0.35); +} +.cont .tr .td.star1 .item-name { + color: #333; } .cont .tr .td.star2 { - background: rgba(168, 255, 133, 0.45); + background: rgba(168, 255, 133, 0.35); +} +.cont .tr .td.star2 .item-name { + color: #333; } .cont .tr .td.star3 { - background: rgba(137, 168, 255, 0.45); + background: rgba(137, 168, 255, 0.35); +} +.cont .tr .td.star3 .item-name { + color: #333; } .cont .tr .td.star4 { - background: rgba(195, 134, 255, 0.45); + background: rgba(195, 134, 255, 0.35); +} +.cont .tr .td.star4 .item-name { + color: #720465; } .cont .tr .td.star5 { - background: rgba(255, 212, 132, 0.45); + background: rgba(255, 212, 132, 0.35); +} +.cont .tr .td.star5 .item-name { + color: #6f4b00; } .cont .tr.thead { background: rgba(0, 0, 0, 0.5) !important; @@ -118,10 +129,10 @@ body { color: #d3bc8e !important; } .cont .tr:nth-child(odd) { - background: rgba(255, 255, 255, 0.55); + background: rgba(255, 255, 255, 0.85); } .cont .tr:nth-child(even) { - background: rgba(200, 200, 200, 0.55); + background: rgba(230, 230, 230, 0.85); } .cont .tr > div { text-align: center; @@ -135,7 +146,6 @@ body { } .cont .tr .td-idx { width: 30px; - padding-left: 5px; } .cont .tr .td-name { text-align: left; @@ -178,11 +188,15 @@ body { } .cont .tr .td-weapon { text-align: left; + padding-left: 3px; } -.cont .tr .td-weapon .lv { - text-align: right; - display: inline-block; - white-space: nowrap; +.cont .tr .td-weapon .level { + font-size: 12px; + transform: scale(0.9); +} +.cont .tr .td-weapon .cons { + transform: scale(0.8); + margin-right: -2px; } .cont .tr .td-weapon .weapon-icon { border-radius: 0; diff --git a/resources/character/profile-stat.less b/resources/character/profile-stat.less index 9412fb68..1e2c9f75 100644 --- a/resources/character/profile-stat.less +++ b/resources/character/profile-stat.less @@ -36,7 +36,6 @@ body { display: inline-block; width: 19px; padding: 0; - margin: 0; text-align: center; vertical-align: middle; font-size: 13px; @@ -55,24 +54,19 @@ body { .level { border-radius: 3px 0 0 3px; - width: 32px; + width: 25px; + white-space: nowrap; + display: inline-block; &:before { content: "Lv"; + display: inline-block; + font-size: 12px; + transform: scale(.7); + transform-origin: right 55%; + margin-left: -3px; } } - - .level:before { - display: inline-block; - font-size: 12px; - transform: scale(.7); - transform-origin: right 55%; - margin-left: -3px; - } - - .level:before { - content: "Lv"; - } } .cont { @@ -82,7 +76,7 @@ body { .item-name { padding-left: 5px; text-align: left; - text-shadow: 0 0 1px #fff, 1px 1px 1px rgba(255, 255, 255, .5); + text-shadow: 0 0 1px rgba(255, 255, 255, .8); } .tr.thead { @@ -107,16 +101,20 @@ body { box-shadow: 0 0 1px 0 rgba(100, 100, 100, .8) inset; } - .star(@s, @color) { + .star(@s, @color, @color2:#333) { .td.star@{s} { background: @color; + + .item-name { + color: @color2; + } } } - .star(1, rgba(255, 132, 132, 0.45)); - .star(2, rgba(168, 255, 133, 0.45)); - .star(3, rgba(137, 168, 255, 0.45)); - .star(4, rgba(195, 134, 255, 0.45)); - .star(5, rgba(255, 212, 132, 0.45)); + .star(1, rgba(200, 200, 200, 0.35)); + .star(2, rgba(168, 255, 133, 0.35)); + .star(3, rgba(137, 168, 255, 0.35)); + .star(4, rgba(195, 134, 255, 0.35), #720465); + .star(5, rgba(255, 212, 132, 0.35), #6f4b00); &.thead { background: rgba(0, 0, 0, 0.5) !important; @@ -127,11 +125,11 @@ body { } &:nth-child(odd) { - background: rgba(255, 255, 255, .55); + background: rgba(255, 255, 255, .85); } &:nth-child(even) { - background: rgba(200, 200, 200, .55); + background: rgba(230, 230, 230, .85); } & > div { @@ -148,7 +146,6 @@ body { .td-idx { width: 30px; - padding-left: 5px; } .td-name { @@ -160,7 +157,6 @@ body { width: 50px; } - .char-icon { width: 30px; height: 30px; @@ -204,12 +200,16 @@ body { .td-weapon { text-align: left; + padding-left: 3px; - .lv { + .level { + font-size: 12px; + transform: scale(.9); + } - text-align: right; - display: inline-block; - white-space: nowrap; + .cons { + transform: scale(.8); + margin-right: -2px; } .weapon-icon { diff --git a/resources/common/common.css b/resources/common/common.css index f2a66c76..4a52064e 100644 --- a/resources/common/common.css +++ b/resources/common/common.css @@ -79,7 +79,7 @@ body { text-shadow: 1px 1px 1px #333; } .copyright { - font-size: 16px; + font-size: 14px; text-align: center; color: #fff; position: relative; @@ -88,7 +88,6 @@ body { margin: 10px 0; } .copyright .version { - font-size: 13px; color: #d3bc8e; display: inline-block; padding: 0 3px; diff --git a/resources/common/common.less b/resources/common/common.less index 26a59762..23781224 100644 --- a/resources/common/common.less +++ b/resources/common/common.less @@ -87,7 +87,7 @@ body { } .copyright { - font-size: 16px; + font-size: 14px; text-align: center; color: #fff; position: relative; @@ -96,7 +96,6 @@ body { margin: 10px 0; .version { - font-size: 13px; color: #d3bc8e; display: inline-block; padding: 0 3px; diff --git a/resources/meta/weapons/calc.js b/resources/meta/weapons/calc.js index 939898fd..457b8ae7 100644 --- a/resources/meta/weapons/calc.js +++ b/resources/meta/weapons/calc.js @@ -257,12 +257,10 @@ let catalyst = { } }, 盈满之实: { - title: '满层提高元素精通[mastery],攻击力降低[_atkPct]%', - buffCount: 5, + title: '满层提高元素精通[mastery],攻击力降低25%', refine: { - mastery: step(24, 3), - _atkPct: step(5, 0), - atkPct: step(-5, 0) + mastery: step(24 * 5, 3), + atkPct: -25 } } }