feat(card): 添加卡牌等级视觉区分与配置调整

- 在卡牌预制件中新增背景(BG_node)、普通边框(NF_node)和高阶边框(HF_node)节点
- 根据卡牌等级和英雄等级动态显示对应的背景和边框样式
- 调整卡牌等级枚举定义,移除LV6并重命名为CardLV
- 为CardConfig接口添加card_lv字段以支持独立卡牌等级
- 优化buff提示框的布局和字体大小
This commit is contained in:
panw
2026-04-02 16:31:06 +08:00
parent 588c935c18
commit a14513dcdf
7 changed files with 3963 additions and 1687 deletions

View File

@@ -382,6 +382,24 @@ export class CardComp extends CCComp {
});
}
const cardLvStr = `lv${this.cardData.lv}`;
if (this.BG_node) {
this.BG_node.children.forEach(child => {
child.active = (child.name === cardLvStr);
});
}
const isHighLevel = (this.cardData.hero_lv ?? 0) > 1 || (this.cardData.card_lv ?? 0) > 1;
if (this.HF_node) this.HF_node.active = isHighLevel;
if (this.NF_node) this.NF_node.active = !isHighLevel;
const activeFrameNode = isHighLevel ? this.HF_node : this.NF_node;
if (activeFrameNode) {
activeFrameNode.children.forEach(child => {
child.active = (child.name === cardLvStr);
});
}
if(this.card_type===CardType.Hero){
const hero = HeroInfo[this.card_uuid];
const heroLv = Math.max(1, Math.floor(this.cardData.hero_lv ?? hero?.lv ?? 1));
@@ -468,6 +486,11 @@ export class CardComp extends CCComp {
child.active = false;
});
}
if (this.BG_node) {
this.BG_node.children.forEach(child => child.active = false);
}
if (this.HF_node) this.HF_node.active = false;
if (this.NF_node) this.NF_node.active = false;
this.clearIconAnimation(this.icon_node as Node);
const sprite = this.icon_node?.getComponent(Sprite) || this.icon_node?.getComponentInChildren(Sprite);
if (sprite) sprite.spriteFrame = null;

View File

@@ -18,6 +18,13 @@ export class HInfoComp extends CCComp {
icon_node=null!
@property(Node)
sell_node=null!
@property(Node)
NF_node=null!
@property(Node)
HF_node=null!
private eid: number = 0;
private model: HeroAttrsComp | null = null;
private apLabel: Label | null = null;