fix(map): 修复卡牌描述逻辑的优先级顺序

调整卡牌描述的获取逻辑,先处理驻场技能卡的描述获取,再 fallback 到其他配置来源,修正原有的优先级混乱问题
This commit is contained in:
panFD
2026-06-20 12:42:45 +08:00
parent d456b2d61f
commit 107e7fde96
2 changed files with 7 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ import { HeroInfo } from "../common/config/heroSet";
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
import { smc } from "../common/SingletonModuleComp";
import { Hero } from "../hero/Hero";
import { FieldSkillType } from "../common/config/SkillSet";
import { FieldSkillType, FieldSkillSet } from "../common/config/SkillSet";
import { buildSkillDesc } from "../common/config/HeroSkillDesc";
import { GameEvent } from "../common/config/GameEvent";
import { oops } from "db://oops-framework/core/Oops";

View File

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