2025-04-24 17:03:28 +08:00

38 lines
793 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//已TS化測試無誤可刪除
import GameModel from "../ts/core/GameModel";
import GameUtil from "../ts/core/GameUtil";
import ItemUtil from "../ts/core/ItemUtil";
cc.Class({
extends: cc.Component,
properties: {
itemIcon: cc.Sprite,
nameLab: cc.Label,
petLevel: cc.Label,
onbattleIcon: cc.Node,
selectedNode: cc.Node,
},
onLoad() {
this.selectedNode.active = false;
this.itemInfo = null;
},
loadInfo(info, onbattle) {
this.itemInfo = info;
this.itemIcon.spriteFrame = ItemUtil.getItemIcon(info.resid);
this.nameLab.string = info.name;
GameUtil.setReliveLabel(this.petLevel,1,info.relive,info.level);
this.onbattleIcon.active = onbattle;
},
selected(){
this.selectedNode.active = true;
},
unSelected(){
this.selectedNode.active = false;
}
});