1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- var t = require;
- var e = module;
- var i = exports;
- e =
- (this && this.__decorate) ||
- function (t, e, i, s) {
- var o,
- a = arguments.length,
- n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
- else
- for (var r = t.length - 1; 0 <= r; r--)
- (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
- return 3 < a && n && Object.defineProperty(e, i, n), n;
- };
- Object.defineProperty(i, "__esModule", {value: !0}), (i.CostumeBagEquipItem = void 0);
- const s = t("App"),
- o = (t("ViewConst"), t("MachineLvUpAni")),
- a = t("GameConst"),
- n = t("CostumeConst"),
- r = t("CostumeController"),
- l = t("CostumeBagItem"),
- {ccclass: h, property: c} = cc._decorator;
- t = class extends l.CostumeBagItem {
- constructor() {
- super(...arguments),
- (this.costLab = null),
- (this.lvUpRateLab = null),
- (this.lvUpBtn = null),
- (this.defaultIcon = null);
- }
- setData(t) {
- if (t) {
- (this.data = t),
- (this.lvLab.string = `Lv.${t.data.lv}/${t.gradeCfg.max_level}`),
- s.default.CommonUtils.setSpriteFrame(n.getRarityUrlByGrade(t.data.grade), this.bgSpr),
- s.default.CommonUtils.setSpriteFrameByBundle(a.BundleType.MAP_ICON, t.getIcon(), this.icon),
- s.default.CommonUtils.setSpriteFrameByBundle(a.BundleType.MAP_ICON, t.getTypeIcon(), this.typeIcon),
- (this.costLab.string = t.cost + ""),
- t.isMaxLv()
- ? ((this.lvUpRateLab.node.active = !1), (this.lvUpBtn.node.active = !1))
- : ((this.lvUpBtn.node.active = !0),
- (this.lvUpRateLab.node.active = !0),
- (this.lvUpRateLab.string = `+${t.gradeCfg.value_add}%`)),
- (this.lvLab.node.active =
- this.typeIcon.node.active =
- this.icon.node.active =
- this.costLab.node.active =
- !0),
- this.defaultIcon && (this.defaultIcon.active = !1),
- (this.arrowList.active = !0);
- var e = n.getGradeLv(t.data.grade);
- const i = this.arrowList.children;
- for (let t = 0; t < i.length; t++) i[t].active = t < e;
- } else
- (this.lvUpRateLab.node.active =
- this.lvLab.node.active =
- this.typeIcon.node.active =
- this.icon.node.active =
- this.lvUpBtn.node.active =
- this.costLab.node.active =
- !1),
- this.defaultIcon && (this.defaultIcon.active = !0),
- s.default.CommonUtils.setSpriteFrame(n.getRarityUrlByGrade(n.RarityType.none), this.bgSpr),
- (this.arrowList.active = !1);
- }
- onTouchLvUpBtn() {
- if (r.default.ins.lvUp(this.data.data.uuid)) {
- const e = this.node;
- let t = s.default.NodePoolMsr.machineLvUpAni.pop();
- e.addChild(t), t.getComponent(o.default).playAni();
- }
- }
- onTouchItem() {
- s.default.ViewManager.open(26, this.data);
- }
- };
- e([c(cc.Label)], t.prototype, "costLab", void 0),
- e([c(cc.Label)], t.prototype, "lvUpRateLab", void 0),
- e([c(cc.Button)], t.prototype, "lvUpBtn", void 0),
- e([c(cc.Node)], t.prototype, "defaultIcon", void 0),
- (t = e([h()], t)),
- (i.CostumeBagEquipItem = t);
|