一些已知Bug修复,#面板练度统计 样式微调

This commit is contained in:
yoimiya-kokomi 2022-09-24 05:59:30 +08:00
parent 6b3aa006a9
commit cab038a0b9
16 changed files with 98 additions and 76 deletions

View File

@ -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

View File

@ -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`

View File

@ -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 })

View File

@ -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}`)

View File

@ -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) {

View File

@ -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信息可能展示不完全。回复<span>#体力帮助</span>获取CK配置帮助'
}

View File

@ -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)) {

View File

@ -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
}

View File

@ -191,6 +191,7 @@ export default class ProfileArtis extends Base {
attrs,
classTitle: title,
weight: attrWeight,
// 待删除
mark: lodash.mapValues(attrs, (ds) => ds.mark),
maxMark
}

View File

@ -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()

View File

@ -12,7 +12,7 @@
<div class="char-name">
<strong>{{data.sName}}</strong>
{{if data.fetter}} <span class="fetter fetter{{data.fetter}}"></span> {{/if}}
{{if data.cons}} <span class="cons cons-{{data.cons}}">{{data.cons}}命</span> {{/if}}
{{if typeof(data.cons)!=='undefined'}} <span class="cons cons-{{data.cons}}">{{data.cons}}命</span> {{/if}}
</div>
<div class="char-lv">
<span>Uid:{{uid}}</span>
@ -27,7 +27,7 @@
<div class="cont weapon-cont left-line">
<img class="img" src="{{_res_path}}{{w.img}}"/>
<div class="weapon-info">
<strong>{{w.name.length > 5 ? (w.abbr||w.name) : w.name}}</strong>
<strong>{{w.name.length > 4 ? (w.abbr||w.name) : w.name}}</strong>
<div class="star star-{{w.star}}"></div>
<span>Lv.{{w.leve || w.level}} <span
class="affix affix-{{w.affix}}">精{{w.affix}}</span></span>

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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
}
}
}