Files
fc/dev/project/library/imports/d3/d3f9640b-1216-437f-a280-c44375487a78.js
T
2026-05-24 10:21:26 +08:00

109 lines
3.3 KiB
JavaScript

"use strict";
cc._RF.push(module, 'd3f96QLEhZDf6KAxEN1SHp4', 'cmp.item.inbag');
// Scripts/mod/backpack/cmps/cmp.item.inbag.js
"use strict";
var ItemBase = require("cmp.item.base");
var BackPackConst = require("backpack_const");
var HeroControl = require("hero_controller");
var BTT = BackPackConst.item_type;
cc.Class({
"extends": ItemBase,
properties: {
nodSplinter: {
"default": null,
type: cc.Node
}
},
freshAll: function freshAll() {
// 置空
if (nx.dt.objEmpty(this.info)) {
this.setEmpty();
return;
}
// 基本信息
this.setQuality(this.info.quality);
this.setIcon(this.info.icon);
this.setName(this.info.name);
this.setDescribe(this.info.desc);
this.setRareEft(this.info.mark);
// 角标
this.freshLT();
this.freshRT();
if (this.info.type == BTT.PARTNER_DEBRIS) {
var ifg = gdata("item_data", "data_unit6", this.info.item_id);
if (ifg) {
// console.log( "当前的碎片相关" + JSON.stringify( ifg ) );
var pfg = {};
if (nx.dt.arrEmpty(ifg.effect)) {
this.setCount(this.info.count);
this.setStars(this.info.stars || this.info.eqm_jie);
// pfg = {
// init_star : this.info.eqm_jie,
// quality : this.info.quality,
// }
nx.gui.setActive(this.nodSplinter, "", false);
// return;
} else {
pfg = game.configs.partner_data.data_partner_base[ifg.effect[0].val];
var star = nx.gui.find(this.nodSplinter, "star");
this.setCount(this.info.count);
if (!star) {
return;
}
if (!nx.dt.numPositive(pfg.init_star, false)) {
nx.gui.setSpriteFrame(star, "", null);
return;
}
var path = cc.path.join("coms/images", "star" + pfg.init_star);
nx.gui.setSpriteFrame(star, "", path);
var nod = nx.gui.find(this.nodSplinter, "qa");
if (nod) {
var pathsmall = pfg && pfg.quality != 1 ? "coms/images/mk_sqa" + pfg.quality : this.info.stars || null;
nx.gui.setSpriteFrame(nod, "", pathsmall);
}
nx.gui.setActive(this.nodSplinter, "", true);
}
}
} else {
// 星级/数量是否互斥
if (!this.mutexStarCount) {
this.setCount(this.info.count);
this.setStars(this.info.stars || this.info.eqm_jie);
} else {
if (this.ignoreOne && this.info.count <= 1) {
this.setCount(0);
this.setStars(this.info.stars || this.info.eqm_jie);
} else {
this.setCount(this.info.count);
this.setStars(0);
}
}
}
},
// 单设:数量
setCount: function setCount(_count) {
// 碎片获取合成配置,显示进度
if (this.nodCount && this.info && (this.info.type == BTT.PARTNER_DEBRIS || this.info.type == BTT.SKIN_DEBRIS)) {
var cfg = gdata("partner_data", "data_get_compound_info", this.info.item_id);
if (nx.dt.objNEmpty(cfg)) {
this.nodCount.string = _count + "/" + cfg.num;
return;
}
}
this._super(_count);
},
setEmpty: function setEmpty() {
this._super();
if (this.nodSplinter) {
nx.gui.setActive(this.nodSplinter, "", false);
}
if (this.imgRT) {
nx.gui.setActive(this.imgRT, "time", false);
}
}
});
cc._RF.pop();