12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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 s = t("App"),
- o = t("SwitchFrame"),
- a = t("MyBigLong"),
- n = t("StageUpgradeService"),
- { ccclass: r, property: l, menu: h } = cc._decorator;
- t = class extends cc.Component {
- constructor() {
- super(...arguments),
- (this.content = null),
- (this.titleLab = null),
- (this.descLab = null),
- (this.iconSpr = null),
- (this.costBtn = null),
- (this.costLab = null),
- (this.switchFrame = null),
- (this.data = null),
- (this.isShow = !1),
- (this.isDestroy = !0);
- }
- setData(t) {
- (this.data = t), (this.isShow = !1);
- }
- updtaeBtnState() {
- var t = this.data.canBuy();
- (this.costBtn.interactable = t),
- this.costLab.setMaterial(0, t ? this.costBtn.normalMaterial : this.costBtn.grayMaterial);
- }
- show() {
- var t;
- (this.content.active = !0),
- this.isShow ||
- ((this.isShow = !0),
- (this.titleLab.string = this.data.title),
- (this.descLab.string = this.data.desc),
- (this.costLab.string = a.default.toString(this.data.cost)),
- (t = this.data.getIconUrl()) ?
- s.default.CommonUtils.setSpriteFrame(t, this.iconSpr) :
- ((this.iconSpr.spriteFrame = this.data.getFoodImg().spriteFrame),
- this.switchFrame &&
- ((this.switchFrame.node.active = !0),
- this.data.cfg.ability_type == n.AbilityType.menuprofit ?
- (this.switchFrame.frameIndex = 0) :
- this.data.cfg.ability_type == n.AbilityType.fastermenu ?
- (this.switchFrame.frameIndex = 1) :
- (this.switchFrame.node.active = !1)))),
- this.updtaeBtnState();
- }
- hide() {
- this.content.active = !1;
- }
- onTouchCostBtn() {
- var t = this.costBtn.node.convertToWorldSpaceAR(cc.Vec2.ZERO);
- n.default.ins.buy(this.data.cfg.order, !1, t) &&
- this.isDestroy &&
- (this.node.removeFromParent(), this.node.destroy());
- }
- };
- e([l(cc.Node)], t.prototype, "content", void 0),
- e([l(cc.Label)], t.prototype, "titleLab", void 0),
- e([l(cc.Label)], t.prototype, "descLab", void 0),
- e([l(cc.Sprite)], t.prototype, "iconSpr", void 0),
- e([l(cc.Button)], t.prototype, "costBtn", void 0),
- e([l(cc.Label)], t.prototype, "costLab", void 0),
- e([l(o.default)], t.prototype, "switchFrame", void 0),
- (t = e([r], t)),
- (i.default = t);
|