fix(map): 修复卡牌描述逻辑的优先级顺序
调整卡牌描述的获取逻辑,先处理驻场技能卡的描述获取,再 fallback 到其他配置来源,修正原有的优先级混乱问题
This commit is contained in:
@@ -260,11 +260,14 @@ export class SCardComp extends CCComp {
|
||||
|
||||
if (this.info_node) {
|
||||
this.info_node.active = true;
|
||||
// 描述优先级:卡牌显式配置 > 关联技能 > 驻场技能 > 卡牌数据兜底
|
||||
let desc = skillCard?.info || skill?.info || this.cardData?.info || "";
|
||||
if (!desc && this.cardData.field && this.cardData.field.length > 0) {
|
||||
// 驻场技能卡描述取 FieldSkillSet;其他卡牌取卡牌/技能配置
|
||||
let desc = "";
|
||||
if (this.cardData.field && this.cardData.field.length > 0) {
|
||||
desc = FieldSkillSet[this.cardData.field[0]]?.info || "";
|
||||
}
|
||||
if (!desc) {
|
||||
desc = skillCard?.info || skill?.info || this.cardData?.info || "";
|
||||
}
|
||||
// 与 HlistComp 保持一致:优先查找名为 "info" 的子节点上的 Label
|
||||
const infoLabel = this.info_node.getChildByName("info")?.getComponent(Label)
|
||||
|| this.info_node.getComponent(Label)
|
||||
|
||||
Reference in New Issue
Block a user