新增*遗器列表

This commit is contained in:
Aluxes 2024-04-04 00:35:06 +08:00
parent b72dfe187e
commit 3ac9ef6aaf
No known key found for this signature in database
GPG Key ID: 6696152F9C003087
4 changed files with 25 additions and 12 deletions

View File

@ -66,7 +66,7 @@ app.reg({
artisList: {
name: '面板圣遗物列表',
fn: profileArtisList,
rule: /^#圣遗物列表\s*(\d{9,10})?$/
rule: /^#(星铁|原神)?(圣遗物|遗器)列表\s*(\d{9,10})?$/
},
profileStat: {

View File

@ -51,20 +51,23 @@ export async function profileArtis (e) {
* 圣遗物列表
* */
export async function profileArtisList (e) {
let game = /星铁|遗器/.test(e.msg) ? 'sr' : 'gs'
e.isSr = game
let uid = await getTargetUid(e)
if (!uid) {
return true
}
let artis = []
let player = Player.create(uid)
let player = Player.create(uid, game)
player.forEachAvatar((avatar) => {
let profile = avatar.getProfile()
if (!profile) {
return true
}
let name = profile.name
let char = Character.get(name)
let char = Character.get(name, game)
if (!profile.hasData || !profile.hasArtis()) {
return true
}
@ -78,7 +81,8 @@ export async function profileArtisList (e) {
})
if (artis.length === 0) {
e.reply('请先获取角色面板数据后再查看圣遗物列表...')
let artisName = game === 'gs' ? '圣遗物' : '遗器'
e.reply(`请先获取角色面板数据后再查看${artisName}列表...`)
await profileHelp(e)
return true
}
@ -86,7 +90,7 @@ export async function profileArtisList (e) {
artis = artis.reverse()
let number = Cfg.get('artisNumber', 28)
artis = artis.slice(0, `${number}`)
let artisKeyTitle = Artifact.getArtisKeyTitle()
let artisKeyTitle = Artifact.getArtisKeyTitle(game)
// 渲染图像
return await Common.render('character/artis-list', {

View File

@ -1,20 +1,24 @@
.container {
width: 790px;
}
.uid {
margin: 20px 10px 10px;
text-shadow: 0 0 3px #000, 2px 2px 4px rgba(0, 0, 0, 0.7);
text-align: right;
color: #fff;
}
.artis {
width: 790px;
}
.artis .item {
height: 190px;
margin-bottom: 10px;
overflow: hidden;
}
.artis .item .avatar {
position: absolute;
right: 0;
@ -25,13 +29,16 @@
overflow: hidden;
z-index: 3;
}
.artis .item.arti .arti-icon {
right: 10px;
width: 75px;
height: 75px;
}
.artis .item .avatar img {
max-width: 100%;
max-height: 100%;
}
/*# sourceMappingURL=artis-list.css.map */

View File

@ -1,8 +1,8 @@
{{extend elemLayout}}
{{block 'css'}}
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/profile-detail.css"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/artis-list.css"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/profile-detail.css" />
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/artis-list.css" />
{{/block}}
{{block 'main'}}
@ -14,7 +14,7 @@
<div class="item arti">
{{if ds && ds.name && ds.main && ds.main.key && ds.main.key!="undefined"}}
<div class="avatar">
<img src="{{_res_path}}{{ds.side}}" onerror="whenError(this)"/>
<img src="{{_res_path}}{{ds.side}}" onerror="whenError(this)" />
</div>
<div class="arti-icon">
<div class="img" style="background-image:url({{_res_path}}{{ds.img}})"></div>
@ -24,14 +24,16 @@
<span class="mark mark-{{ds.markClass}}"><span>{{ds.mark}}分</span> - {{ds.markClass}}</span>
</div>
<ul class="detail attr">
<li class="arti-main"><span class="title">{{artisKeyTitle[ds.main?.key]}}</span><span class="val">+{{ds.main?.value}}</span>
<li class="arti-main"><span class="title">{{artisKeyTitle[ds.main?.key]}}</span><span
class="val">+{{ds.main?.value}}</span>
</li>
{{each ds.attrs attr}}
{{if attr && attr.key}}
<li class="{{ds.charWeight[attr.key]*1 > 79.9 ?`great`:(ds.charWeight[attr.key]*1>0 ? `useful`:`nouse`)}}">
<span class="title">{{if attr.eff}}<i class="eff">{{attr.eff || ''}}</i>{{/if}}{{if attr.upNum}}<i
class="up-num up-{{attr.upNum}}"></i>{{/if}}{{artisKeyTitle[attr.key]}}</span>
<span class="val">+{{attr.value}}</span></li>
class="up-num up-{{attr.upNum}}"></i>{{/if}}{{artisKeyTitle[attr.key]}}</span>
<span class="val">+{{attr.value}}</span>
</li>
{{/if}}
{{/each}}
</ul>