123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- 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("GameText"),
- a = t("BaseView"),
- n = t("ControllerConst"),
- r = (t("ViewConst"), t("BagConst")),
- l = t("GameConst"),
- h = t("MachineService"),
- c = t("MapService"),
- { ccclass: d, property: u, menu: p } = cc._decorator;
- t = class extends a.default {
- constructor() {
- super(...arguments),
- (this.nowIconSpr = null),
- (this.newIconSpr = null),
- (this.nowNameLab = null),
- (this.newNameLab = null),
- (this.rewardNumLab = null),
- (this.conditionRichText = null),
- (this.btn = null),
- (this.btnLab = null),
- (this.rewardNode = null),
- (this.rewardIcon = null),
- (this.mapId = -1),
- (this.bgType = 1);
- }
- open() {
- if ((super.open(), this.mapId != c.default.ins.curId)) {
- this.mapId = c.default.ins.curId;
- const e = c.default.ins.curCfg,
- i = this.mapId + 1;
- if (0 < e.clear_reward_suitcasekey_count) {
- (this.rewardNode.active = !0), (this.rewardNumLab.string = "x" + e.clear_reward_suitcasekey_count);
- const i = s.default.ControllerManager.applyFunc(
- n.ControllerConst.Item,
- r.BagConst.GET_ITEM,
- e.clear_reward_suitcasekey_idx
- );
- s.default.CommonUtils.setSpriteFrame(i.getItemPic(), this.rewardIcon);
- } else this.rewardNode.active = !1;
- var t = s.default.ConfigManager.getConfig("StageSet")[i];
- s.default.CommonUtils.setSpriteFrameByBundle(
- l.BundleType.MAP_ICON,
- "stage/" + e.stage_icon,
- this.nowIconSpr
- ),
- s.default.CommonUtils.setSpriteFrameByBundle(
- l.BundleType.MAP_ICON,
- "stage/" + t.stage_icon,
- this.newIconSpr
- ),
- (this.newNameLab.string = o.GameText.getTextByStr(t.stage_name)),
- (this.nowNameLab.string = o.GameText.getTextByStr(e.stage_name)),
- (this.conditionRichText.string = `<b><color=#b86860>\u6240\u6709\u5de5\u4f5c\u53f0\u9762\u8fbe\u5230</c><color=#6c9f64>${e.machine_max_lv}\u7b49\u7ea7</color><color=#b86860>\uff01\uff01</c></b>`),
- this.updateBtnState();
- }
- }
- initUI() {
- super.initUI();
- }
- updateBtnState() {
- var t = h.default.ins.isAllMachineMax();
- (this.btn.interactable = t), this.btnLab.setMaterial(0, t ? this.btn.normalMaterial : this.btn.grayMaterial);
- }
- onTouchBtn() {
- console.error('必须请求服务器接口...得到消息之后才可以判断是否下一关');
- setTimeout(() => {
- c.default.ins.switchMap(), this.closeView();
- }, 1000 * 2)
- }
- onTouchWorldMap() {
- s.default.ViewManager.open(54, !0);
- }
- };
- e([u(cc.Sprite)], t.prototype, "nowIconSpr", void 0),
- e([u(cc.Sprite)], t.prototype, "newIconSpr", void 0),
- e([u(cc.Label)], t.prototype, "nowNameLab", void 0),
- e([u(cc.Label)], t.prototype, "newNameLab", void 0),
- e([u(cc.Label)], t.prototype, "rewardNumLab", void 0),
- e([u(cc.RichText)], t.prototype, "conditionRichText", void 0),
- e([u(cc.Button)], t.prototype, "btn", void 0),
- e([u(cc.Label)], t.prototype, "btnLab", void 0),
- e([u(cc.Node)], t.prototype, "rewardNode", void 0),
- e([u(cc.Sprite)], t.prototype, "rewardIcon", void 0),
- (t = e([d], t)),
- (i.default = t);
|