123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- 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});
- const a = t("App"),
- s = t("BaseView"),
- o = t("EffectUtils"),
- n = t("BagController"),
- r = t("GameConst"),
- l = t("CostumeConst"),
- h = t("CostumeController"),
- {ccclass: c, property: d} = cc._decorator;
- t = class extends s.default {
- constructor() {
- super(...arguments),
- (this.qualitySpr = null),
- (this.curItemBgSpr = null),
- (this.curIconSpr = null),
- (this.curCostumeTypeSpr = null),
- (this.curArrowListNode = null),
- (this.nextItemBgSpr = null),
- (this.nextIconSpr = null),
- (this.nextCostumeTypeSpr = null),
- (this.nextArrowListNode = null),
- (this.curMaxLvLab = null),
- (this.nextMaxLvLab = null),
- (this.curMaxRateLab = null),
- (this.nextMaxRateLab = null),
- (this.descRichText = null),
- (this.bottomNode = null),
- (this.costBtnNode = null),
- (this.costLabLab = null),
- (this.diamondIcon = null),
- (this.bgType = 1),
- (this.item = null),
- (this.nextItem = null);
- }
- initUI() {
- super.initUI();
- }
- open(t, e) {
- super.open(),
- (this.item = t),
- (this.nextItem = t.getGradeItemByGrade(e)),
- this.item.data.grade + 1 == e && this.item.canUpgradeGrade()
- ? ((this.bottomNode.active = !0),
- (this.costLabLab.string = this.item.gradeCfg.upgrade_grade_cost.toString()))
- : (this.bottomNode.active = !1),
- this.updateUI();
- }
- updateUI() {
- (this.curMaxLvLab.string = this.item.gradeCfg.max_level.toString()),
- (this.curMaxRateLab.string = "+" + this.item.getMaxLvValue() + "%"),
- a.default.CommonUtils.setSpriteFrameByBundle(r.BundleType.MAP_ICON, this.item.getIcon(), this.curIconSpr),
- a.default.CommonUtils.setSpriteFrameByBundle(
- r.BundleType.MAP_ICON,
- this.item.getTypeIcon(),
- this.curCostumeTypeSpr
- ),
- a.default.CommonUtils.setSpriteFrame(l.getRarityUrlByGrade(this.item.data.grade), this.curItemBgSpr);
- var e = l.getGradeLv(this.item.data.grade);
- const i = this.curArrowListNode.children;
- for (let t = 0; t < i.length; t++) i[t].active = t < e;
- (this.nextMaxLvLab.string = this.nextItem.gradeCfg.max_level.toString()),
- (this.nextMaxRateLab.string = "+" + this.nextItem.getMaxLvValue() + "%"),
- a.default.CommonUtils.setSpriteFrameByBundle(
- r.BundleType.MAP_ICON,
- this.nextItem.getIcon(),
- this.nextIconSpr
- ),
- a.default.CommonUtils.setSpriteFrameByBundle(
- r.BundleType.MAP_ICON,
- this.nextItem.getTypeIcon(),
- this.nextCostumeTypeSpr
- ),
- a.default.CommonUtils.setSpriteFrame(l.getRarityUrlByGrade(this.nextItem.data.grade), this.nextItemBgSpr);
- var s = l.getGradeLv(this.item.data.grade);
- const o = this.curArrowListNode.children;
- for (let t = 0; t < o.length; t++) o[t].active = t < s;
- (this.descRichText.string = this.item.getCurMaxSpecialAbilityStr(this.nextItem.data.grade)),
- a.default.CommonUtils.setSpriteFrame(l.getGradeBgByGrade(this.nextItem.data.grade), this.qualitySpr);
- }
- playDiamonAni(t) {
- const e = a.default.ViewManager.uiRoot;
- var i = this.node.convertToWorldSpaceAR(cc.Vec2.ZERO),
- i = e.convertToNodeSpaceAR(i),
- s = this.diamondIcon.convertToWorldSpaceAR(cc.Vec2.ZERO),
- s = e.convertToNodeSpaceAR(s);
- o.default.instance.playMoneyAni(i, s, n.CostType.diamond, e, t);
- }
- onToucUpgradeBtn() {
- var t = this.item.getLvCost(this.item.data.lv);
- h.default.ins.upgradeGrade(this.item.data.uuid) && (this.closeView(), this.playDiamonAni(t));
- }
- };
- e([d({type: cc.Sprite})], t.prototype, "qualitySpr", void 0),
- e([d({type: cc.Sprite})], t.prototype, "curItemBgSpr", void 0),
- e([d({type: cc.Sprite})], t.prototype, "curIconSpr", void 0),
- e([d({type: cc.Sprite})], t.prototype, "curCostumeTypeSpr", void 0),
- e([d({type: cc.Node})], t.prototype, "curArrowListNode", void 0),
- e([d({type: cc.Sprite})], t.prototype, "nextItemBgSpr", void 0),
- e([d({type: cc.Sprite})], t.prototype, "nextIconSpr", void 0),
- e([d({type: cc.Sprite})], t.prototype, "nextCostumeTypeSpr", void 0),
- e([d({type: cc.Node})], t.prototype, "nextArrowListNode", void 0),
- e([d({type: cc.Label})], t.prototype, "curMaxLvLab", void 0),
- e([d({type: cc.Label})], t.prototype, "nextMaxLvLab", void 0),
- e([d({type: cc.Label})], t.prototype, "curMaxRateLab", void 0),
- e([d({type: cc.Label})], t.prototype, "nextMaxRateLab", void 0),
- e([d({type: cc.RichText})], t.prototype, "descRichText", void 0),
- e([d({type: cc.Node})], t.prototype, "bottomNode", void 0),
- e([d({type: cc.Node})], t.prototype, "costBtnNode", void 0),
- e([d({type: cc.Label})], t.prototype, "costLabLab", void 0),
- e([d(cc.Node)], t.prototype, "diamondIcon", void 0),
- (t = e([c], t)),
- (i.default = t);
|