From 1c4fe42117c0cbba809f2058688f2592ac08e26f Mon Sep 17 00:00:00 2001 From: pan Date: Fri, 31 Jul 2026 10:59:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ItemListComp):=20=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E9=81=93=E5=85=B7=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 移除未使用的SkillSet导入 2. 优化药剂类道具的文本显示处理,合并多余的字段隐藏逻辑 3. 更新图标解析注释,移除过时的SkillSet引用 --- assets/script/game/map/ItemListComp.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/assets/script/game/map/ItemListComp.ts b/assets/script/game/map/ItemListComp.ts index faa03e71..cf5d2b6a 100644 --- a/assets/script/game/map/ItemListComp.ts +++ b/assets/script/game/map/ItemListComp.ts @@ -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) {