var t = require; var e = module; var i = exports; var s, 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; }, o = (this && this.__awaiter) || function (t, n, r, l) { return new (r = r || Promise)(function (i, e) { function s(t) { try { a(l.next(t)); } catch (t) { e(t); } } function o(t) { try { a(l.throw(t)); } catch (t) { e(t); } } function a(t) { var e; t.done ? i(t.value) : ((e = t.value) instanceof r ? e : new r(function (t) { t(e); }) ).then(s, o); } a((l = l.apply(t, n || [])).next()); }); }; Object.defineProperty(i, "__esModule", {value: !0}), (i.DebugUI = void 0); const a = t("App"), n = t("List"), r = t("BaseView"), l = t("Toast"), h = t("ControllerConst"), c = t("NotificationConst"), d = (t("ViewConst"), t("BagController")), u = t("CostumeController"), p = t("BuffConst"), f = t("BuffMgr"), g = t("MyBigLong"), m = t("CurrencyService"), _ = t("MachineService"), y = t("MapService"), v = t("StageUpgradeService"), U = t("GuideModel"), {ccclass: Z, property: C} = cc._decorator; t = s = class extends r.default { constructor() { super(...arguments), (this.toggleBtn = null), (this.uiNode = null), (this.editBox1 = null), (this.debugNode = null), (this.isMove = !1), (this.itemList = null), (this.itemDatas = null), (this.tempNode = null); } initUI() { super.initUI(), (this.uiNode = this.node.getChildByName("uiNode")), (this.toggleBtn = this.node.getChildByName("toggleBtn").getComponent(cc.Toggle)), (this.uiNode.active = !1), this.toggleBtn.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this); } onAutoCollection(t, e) { a.default.SettingManager.autoCollection = t.isChecked ? 1 : 0; } removeAllPet() {} onChange() { this.uiNode.active = this.toggleBtn.isChecked; } onTouchMove(t) { t = this.toggleBtn.node.parent.convertToNodeSpaceAR(t.getLocation()); (this.toggleBtn.node.position = t), (this.isMove = !0); } showFps() { cc.debug.setDisplayStats(!cc.debug.isDisplayStats()); } onSaveData() { return o(this, void 0, void 0, function* () { a.default.Platform.saveData(); }); } showMap() { a.default.NotificationCenter.dispatch(s.SHOW_MAP); } onChangeIsDrawPhy() {} clearData() { return o(this, void 0, void 0, function* () { var t = a.default.GameDataMsr.playerInfo.token, e = a.default.GameDataMsr.playerInfo.timestamp; a.default.SaveManage.clear(), a.default.SaveManage.clearAllItem(), (a.default.GameDataMsr.playerInfo.token = null), t && ((e = yield a.default.Http.post( a.default.ConfigManager.gameConf.serverInfos.interface + "/api/user/file", {api_token: t, file: a.default.StringUtil.zipStr(""), loginTime: e}, 1 )), (e = JSON.parse(e)), console.log("======清理存档:", e)); }); } onSubmitBtn(t) { const e = t.target.parent.getChildByName("EditBox").getComponent(cc.EditBox).string; var i; e && (!(i = e.match(/(-?)(\d+)([a-z]{2}|M|K|T|B)?/)) || (-1 !== (t = [ "", "K", "M", "B", "T", "aa", "ab", "ac", "ad", "ae", "af", "ag", "ah", "ai", "aj", "ak", "al", "am", "an", "ao", "ap", "aq", "ar", "as", "at", "au", "av", "aw", "ax", "ay", "az", "ba", "bb", "bc", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bk", "bl", "bm", "bn", "bo", "bp", "bq", "br", "bs", "bt", "bu", "bv", "bw", "bx", "by", "bz", "ca", "cb", "cc", "cd", "ce", "cf", "cg", "ch", "ci", "cj", "ck", "cl", "cm", "cn", "co", "cp", "cq", "cr", "cs", "ct", "cu", "cv", "cw", "cx", "cy", "cz" ].indexOf(i[3])) && ((t = g.default.tempNum.init(parseInt(i[2]), 3 * t)), i[1] ? m.default.ins.checkMoneyEnough(t.value) ? m.default.ins.moneyChange(-t.value) : (m.default.ins.mapSaveData.money = 0) : m.default.ins.moneyChange(t.value), a.default.NotificationCenter.dispatch(c.NotificationConst.UPDATE_MONEY)))); } addSupperBuff(t) { var t = t.target.parent.getChildByName("EditBox").getComponent(cc.EditBox), e = parseInt(t.string) || 60; for (const i in p.BuffIndex) { const s = parseInt(i); if (!isNaN(parseInt(i))) { let t = 400; p.BuffIndex.COOK_SPEED === s && (t = 20), f.default.ins.addGlobalBuff({ buffIndex: s, buffValue: t, buffEndTime: a.default.DateUtils.Now() + 1e3 * e }); } } } addDiamond(t) { (t = t.target.parent.getChildByName("EditBox").getComponent(cc.EditBox)), (t = parseInt(t.string)); isNaN(t) || m.default.ins.diamondChange(t); } onOpenArchiveonMgrView() { a.default.ViewManager.open(5), (this.toggleBtn.isChecked = !this.toggleBtn.isChecked), this.onChange(); } addItem(t) { var e = t.target.getChildByName("EditBox1").getComponent(cc.EditBox), t = t.target.getChildByName("EditBox2").getComponent(cc.EditBox), e = parseInt(e.string), t = parseInt(t.string); d.default.ins.addItem(e, t); } useItem(t) { var e = t.target.getChildByName("EditBox1").getComponent(cc.EditBox), t = t.target.getChildByName("EditBox2").getComponent(cc.EditBox), e = parseInt(e.string), t = parseInt(t.string); d.default.ins.useItem(e, t); } Skiptheboot() { a.default.ControllerManager.applyFunc(h.ControllerConst.Guide, U.GuideConst.SKIN_GUIDE, !0); } onTouchSendLog() { var t; return o(this, void 0, void 0, function* () { a.default.EasyLoading.showLoadingByTime(15), (yield Log.getInstance().sendToNative( null === (t = null === (t = a.default.GameDataMsr) || void 0 === t ? void 0 : t.playerInfo) || void 0 === t ? void 0 : t.id )) && l.default.launch("发送日志成功!"), a.default.EasyLoading.hideLoading(); }); } startRecordNodeTouch() { (this.toggleBtn.isChecked = !this.toggleBtn.isChecked), this.onChange(), a.default.ControllerManager.applyFunc(h.ControllerConst.Guide, U.GuideConst.START_RECORD); } stopRecordNodeTouch() { (this.toggleBtn.isChecked = !this.toggleBtn.isChecked), this.onChange(), a.default.ControllerManager.applyFunc(h.ControllerConst.Guide, U.GuideConst.STOP_RECORD); } playRecordNodeTouch(t, e) { (this.toggleBtn.isChecked = !this.toggleBtn.isChecked), this.onChange(), a.default.ControllerManager.applyFunc(h.ControllerConst.Guide, U.GuideConst.PLAY_RECORD); } onTouchStartGuideBtn() { var t = this.editBox1.string; a.default.ControllerManager.applyFunc(h.ControllerConst.Guide, U.GuideConst.OPEN_GUIDE, t ? parseInt(t) : null), (this.toggleBtn.isChecked = !this.toggleBtn.isChecked), this.onChange(); } setGuideStep(t) { (t = t.target.getComponentInChildren(cc.EditBox)), (t = parseInt(t.string)); isNaN(t) || a.default.ControllerManager.applyFunc(h.ControllerConst.Guide, U.GuideConst.SET_STEP, t); } hideDebugBtn() { this.debugNode.opacity = 0; } showDebugBtn() { this.debugNode.opacity = 100; } initItemList() { Log.trace("initItemList"); var t = Object.values( MaterialController.ins.model.getServiceByType(MaterialType.SCENEITEM).getAllConfig() ).filter(t => { if ( !( t.id.toFixed().startsWith("127") || t.id.toFixed().startsWith("12097") || t.id.toFixed().startsWith("12912") || t.id.toFixed().startsWith("12913") || t.id.toFixed().startsWith("12906") || t.id.toFixed().startsWith("12999") || t.id.toFixed().startsWith("12602") ) ) return t.id.toFixed().endsWith("001") || !t.isSynthetic ? t : void 0; }); (this.itemDatas = t), (this.itemList.numItems = t.length); } onTouchAddItem(t, e) { let i = t.target.parent.getChildByName("EditBox").getComponent(cc.EditBox), s = parseInt(e), o = parseInt(i.string), a = new MaterialData(); (a.id = s), (a.count = o), (a.type = Math.floor(s / 1e6)), MaterialController.ins.addMaterials([a]); } showItemList() { (this.itemList.node.parent.active = !this.itemList.node.parent.active), this.itemList.numItems || this.initItemList(); } onRenderItem(t, e) { e = this.itemDatas[e]; t.getChildByName("ItemLab").getComponent(cc.RichText).string = `${e.name}(${e.id})${e.quality}`; let i = t.getChildByName("AddButton").getComponent(cc.Button); t.getChildByName("icon").getComponent(MaterialShowIcon).setData(e.id, !1), (i.clickEvents[0].customEventData = e.id + ""); } closeTimeCheck() { localStorage.setItem("TimeCheck", "1"); } openTimeCheck() { localStorage.removeItem("TimeCheck"); } onReStartGame() { a.default.Platform.resetGame(); } onTestNotOrder(e) { return o(this, void 0, void 0, function* () { var t = e.target.parent.getChildByName("EditBox").getComponent(cc.EditBox), t = yield a.default.Http.requestAsync( a.default.ConfigManager.gameConf.serverInfos.interface + "/Interface/midas/not_received_order.php", {token: t.string} ), t = JSON.parse(t); if (0 === t.code) { const e = a.default.Platform.getProductConfigById(t.data[0].gid); console.log("+=========未消耗订单: ", t, e); } }); } onTestRecharge(e) { return o(this, void 0, void 0, function* () { var t = e.target.parent.getChildByName("EditBox").getComponent(cc.EditBox); t.string && (a.default.Platform.playerSpendMoney = parseInt(t.string)); }); } onTouchRechargeToggle() { this.rechargeToggel.isChecked ? (cc.sys.localStorage.setItem("vipTest", "vip"), console.log("========不同步服务器充值额度")) : (cc.sys.localStorage.removeItem("vipTest"), console.log("========同步服务器充值额度")); } onEnterMap(t) { t = t.target.parent.getChildByName("EditBox").getComponent(cc.EditBox); Log.trace("box:", t.string), y.default.ins.loadMap(parseInt(t.string), !0); } onUnlockAllAbilityType(t) { v.default.ins.unlockAll(); } addCostume(t) { var e = t.target.parent.getChildByName("EditBox1").getComponent(cc.EditBox), t = t.target.parent.getChildByName("EditBox2").getComponent(cc.EditBox), e = parseInt(e.string), t = parseInt(t.string); u.default.ins.createNewCostume(e, t); } showIdleRate(i) { return o(this, void 0, void 0, function* () { let t = i.target.parent.getChildByName("Label").getComponent(cc.Label), e = _.default.ins.getIdleRate(); (t.string = e < 1e3 ? e.toString() : g.default.toString(e)), a.default.Platform.buy("test"); }); } }; (t.className = "DebugUI"), (t.SHOW_MAP = "SHOW_MAP"), e([C(cc.EditBox)], t.prototype, "editBox1", void 0), e([C(cc.Node)], t.prototype, "debugNode", void 0), e([C({type: n.default})], t.prototype, "itemList", void 0), (t = s = e([Z], t)), (i.DebugUI = t = s);