refactor(ItemListComp): 简化道具列表显示逻辑
1. 移除未使用的SkillSet导入 2. 优化药剂类道具的文本显示处理,合并多余的字段隐藏逻辑 3. 更新图标解析注释,移除过时的SkillSet引用
This commit is contained in:
@@ -19,7 +19,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { CardConfig, CardTriggerType, CKind } from "../common/config/CardSet";
|
||||
import { EquipPoolList } from "../common/config/EquipSet";
|
||||
import { FieldSkillSet, SkillSet } from "../common/config/SkillSet";
|
||||
import { FieldSkillSet } from "../common/config/SkillSet";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { getCardIconId, setSpriteFrame } from "../common/CardIconHelper";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
@@ -186,22 +186,17 @@ export class ItemListComp extends CCComp {
|
||||
}
|
||||
}
|
||||
} else if (isPotion) {
|
||||
// 商品:显示技能描述 + info
|
||||
const skillConfig = this.cardData.skill ? SkillSet[this.cardData.skill] : null;
|
||||
const skillInfo = skillConfig?.info || "";
|
||||
// 商品:仅显示卡牌 info
|
||||
const cardInfo = this.cardData.info || "";
|
||||
|
||||
if (fieldLabels[0]) {
|
||||
fieldLabels[0].string = cardInfo;
|
||||
fieldLabels[0].node.active = !!cardInfo;
|
||||
}
|
||||
if (fieldLabels[1]) {
|
||||
fieldLabels[1].string = skillInfo;
|
||||
fieldLabels[1].node.active = !!skillInfo && skillInfo !== cardInfo;
|
||||
}
|
||||
if (fieldLabels[2]) {
|
||||
fieldLabels[2].string = "";
|
||||
fieldLabels[2].node.active = false;
|
||||
for (let i = 1; i < fieldLabels.length; i++) {
|
||||
if (!fieldLabels[i]) continue;
|
||||
fieldLabels[i].string = "";
|
||||
fieldLabels[i].node.active = false;
|
||||
}
|
||||
} else {
|
||||
// 其他类型:显示 info
|
||||
@@ -212,7 +207,7 @@ export class ItemListComp extends CCComp {
|
||||
}
|
||||
}
|
||||
|
||||
// 图标(共享工具解析:cardData.icon → FieldSkillSet → SkillSet)
|
||||
// 图标(共享工具解析:cardData.icon → FieldSkillSet)
|
||||
if (this.icon_node) {
|
||||
const iconId = getCardIconId(this.cardData);
|
||||
if (iconId) {
|
||||
|
||||
Reference in New Issue
Block a user