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