商店商品++

This commit is contained in:
2025-08-20 23:27:32 +08:00
parent 77075b2650
commit 0a654d130a
12 changed files with 5836 additions and 3641 deletions

View File

@@ -41,21 +41,23 @@ export class GoodsComp extends Component {
}
private update_btn( ){
if(smc.shop.goods_count[this.goods_count_key]<=0){
this.node.getChildByName("ad").active=false
this.node.getChildByName("free").active=false
this.node.getChildByName("cast").active=false
this.node.getChildByName("nothing").active=true
this.node.getChildByName("btn").getChildByName("ad").active=false
this.node.getChildByName("btn").getChildByName("free").active=false
this.node.getChildByName("btn").getChildByName("diamond").active=false
this.node.getChildByName("btn").getChildByName("gold").active=false
this.node.getChildByName("btn").getChildByName("nothing").active=true
this.node.getChildByName("btn").getComponent(Sprite).grayscale=true
return
}
this.node.getChildByName("nothing").active=false
this.node.getChildByName("btn").getChildByName("nothing").active=false
this.node.getChildByName("btn").getComponent(Sprite).grayscale=false
this.node.getChildByName("ad").active=this.goodsData.c_type==CType.AD
this.node.getChildByName("free").active=this.goodsData.c_type==CType.FREE
this.node.getChildByName("cast").active=this.goodsData.c_type==(CType.DIAMOND||CType.GOLD)
this.node.getChildByName("cast").getChildByName("diamond").active=this.goodsData.c_type==CType.DIAMOND
this.node.getChildByName("cast").getChildByName("gold").active=this.goodsData.c_type==CType.GOLD
this.node.getChildByName("cast").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(this.goodsData.cast)
this.node.getChildByName("btn").getChildByName("ad").active=this.goodsData.c_type==CType.AD
this.node.getChildByName("btn").getChildByName("free").active=this.goodsData.c_type==CType.FREE
this.node.getChildByName("btn").getChildByName("diamond").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(this.goodsData.cast)
this.node.getChildByName("btn").getChildByName("gold").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(this.goodsData.cast)
this.node.getChildByName("btn").getChildByName("diamond").active=this.goodsData.c_type==CType.DIAMOND
this.node.getChildByName("btn").getChildByName("gold").active=this.goodsData.c_type==CType.GOLD
}
/**
* 更新图标