%深渊增加耗时显示 close #85

This commit is contained in:
UCPr 2025-04-26 00:57:15 +08:00
parent 5a0ecd278a
commit a134543639
5 changed files with 23 additions and 11 deletions

View file

@ -13,7 +13,7 @@ export class Card extends ZZZPlugin {
priority: _.get(settings.getConfig('priority'), 'card', 70), priority: _.get(settings.getConfig('priority'), 'card', 70),
rule: [ rule: [
{ {
reg: `${rulePrefix}(card|卡片|个人信息)$`, reg: `${rulePrefix}(card|卡片|个人信息|角色)$`,
fnc: 'card', fnc: 'card',
}, },
], ],

View file

@ -176,6 +176,8 @@ export class ChallengeNode {
/** @type {MonsterInfo} */ /** @type {MonsterInfo} */
this.monster_info = this.monster_info =
data?.monster_info && new MonsterInfo(data.monster_info); data?.monster_info && new MonsterInfo(data.monster_info);
/** @type {number} */
this.battle_time = data.battle_time;
} }
async get_assets() { async get_assets() {
@ -192,6 +194,12 @@ export class ChallengeNode {
return element.IDToElement(type); return element.IDToElement(type);
}); });
} }
get formattedTime() {
const seconds = this.battle_time % 60;
const minutes = Math.floor(this.battle_time / 60);
return `${minutes ? minutes + '分' : ''}${seconds + '秒'}`;
}
} }
/** /**

View file

@ -119,14 +119,15 @@
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
.card .item-card .team .info .label { .card .item-card .team .info .label {
margin-right: auto;
padding: 0 0.5em; padding: 0 0.5em;
} }
.card .item-card .team .info .time { .card .item-card .team .info .spent, .card .item-card .team .info .time {
background-color: rgba(23, 135, 255, 0.2); color: #ddd;
font-size: 0.8em;
padding: 0 0.2em; padding: 0 0.2em;
font-size: 0.7em; }
color: rgba(255, 255, 255, 0.8); .card .item-card .team .info .spent {
margin-right: auto;
} }
.card .item-card .team .info .advantage { .card .item-card .team .info .advantage {
display: flex; display: flex;

View file

@ -49,6 +49,7 @@
<div class="team"> <div class="team">
<div class="info"> <div class="info">
<div class="label">队伍1</div> <div class="label">队伍1</div>
<div class="spent">耗时:{{floor.node_1.formattedTime}}</div>
<div class="time">{{floor.formattedTime}}</div> <div class="time">{{floor.formattedTime}}</div>
<div class="advantage"> <div class="advantage">
<span>有利</span> <span>有利</span>
@ -93,6 +94,7 @@
<div class="team"> <div class="team">
<div class="info"> <div class="info">
<div class="label">队伍2</div> <div class="label">队伍2</div>
<div class="spent">耗时:{{floor.node_2.formattedTime}}</div>
<div class="time">{{floor.formattedTime}}</div> <div class="time">{{floor.formattedTime}}</div>
<div class="advantage"> <div class="advantage">
<span>有利</span> <span>有利</span>

View file

@ -118,14 +118,15 @@
align-items: center; align-items: center;
margin-bottom: 0.5em; margin-bottom: 0.5em;
.label { .label {
margin-right: auto;
padding: 0 0.5em; padding: 0 0.5em;
} }
.time { .spent, .time {
background-color: rgba(23, 135, 255, 0.2); color: #ddd;
font-size: 0.8em;
padding: 0 0.2em; padding: 0 0.2em;
font-size: 0.7em; }
color: rgba(255, 255, 255, 0.8); .spent {
margin-right: auto;
} }
.advantage { .advantage {
display: flex; display: flex;