feat(界面): 为MissionCardComp添加关闭按钮和物品价格显示

在MissionCardComp组件中添加关闭按钮属性btnClose,并在显示物品卡片时增加价格信息显示。修改卡片描述逻辑,当卡片类型为物品且存在价格时,在描述后追加价格信息。
This commit is contained in:
panw
2026-01-05 09:56:44 +08:00
parent e576d19255
commit 9cf75a0d96
3 changed files with 1920 additions and 1394 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "a29f50fa-c2f5-4516-b108-ac1ae313c0c3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -29,6 +29,9 @@ export class MissionCardComp extends CCComp {
@property(Node)
card4:Node = null!
@property(Node)
btnClose: Node = null!
card1_data:any = null!
card2_data:any = null!
card3_data:any = null!
@@ -148,7 +151,12 @@ export class MissionCardComp extends CCComp {
let info = card.getChildByName("info")?.getChildByName("Label")
if(info){
// 根据类型显示不同描述目前天赋用desc
info.getComponent(Label)!.string = data.desc || "";
let desc = data.desc || "";
// 如果是物品,显示价格
if (this.curCardType === CardType.Potion && data.price) {
desc += `\n价格: ${data.price}`;
}
info.getComponent(Label)!.string = desc;
}
}