"use strict"; cc._RF.push(module, '27150DiFCVFq6pSXu59ZO88', 'cmp.act.starorder.pv'); // Scripts/mod/acts/starorder/ui/cmp.act.starorder.pv.js "use strict"; /****************************************************************** * * 星界密令pv * ******************************************************************/ var BridgeWindow = require("bridge.window"); var StarorderMod = require("act.starorder.mod"); var NxSpine = require("nx.fx.spine"); var PathTool = require("pathtool"); cc.Class({ "extends": BridgeWindow, properties: { pvSp: { "default": null, type: NxSpine }, bookSp: { "default": null, type: NxSpine }, ndLoad: { "default": null, type: cc.Node } }, // 初始化 onLoad: function onLoad() { this.mod = StarorderMod.getInstance(); this.is_show = false; this.is_next = true; //允許進行下一步 this.step_num = 1; }, onOpenConfigs: function onOpenConfigs(_params) { var _this = this; var period = this.mod.getPeriod(); var pv_data = game.configs.holiday_star_hero_order_data.data_skin_act_list[period]; if (!pv_data) { return this.delayClose(); } this.ndLoad.active = true; var bar = 0; this.schedule(function () { bar += 1; if (bar >= 100) { bar = 100; } nx.gui.setString(_this.ndLoad, "num", bar + "%"); }, 0.15, cc.macro.REPEAT_FOREVER); this.playPvAction(pv_data); }, onPreClosed: function onPreClosed() {}, toNext: function toNext() { if (!this.is_next) return; if (this.step_num > 3) { return; } nx.gui.setActive(this, "txt", false); this.playPvAction(); }, playPvAction: function playPvAction(pv_data) { var _this2 = this; this.is_next = false; this.pvSp.node.scaleX = 0; if (this.is_show) { this.bookSp.action("action3", false, function (_key, _name) { if (_key == "complete") { _this2.bookSp.action("action", false, function (_key, _name) { if (_key == "complete") { _this2.bookSp.action("action2", true); if (_this2.step_num == 2) { _this2.pvSp.action("action2", true); } else if (_this2.step_num == 3) { _this2.pvSp.action("action3", true); } _this2.step_num++; _this2.pvSp.node.scaleX = 1; nx.gui.setActive(_this2, "txt", true); _this2.is_next = true; } }); } }); } else { this.is_show = true; this.bookSp.action("action", false, function (_key, _name) { if (_key == "complete") { _this2.bookSp.action("action2", true); var res_path = PathTool.getSpinePath(pv_data.skin_atc, "action", false); _this2.pvSp.load(res_path, function (_e) { if (_e) { return _this2.pvSp.stop(); } else { _this2.unscheduleAllCallbacks(); nx.gui.setString(_this2.ndLoad, "num", "100%"); _this2.ndLoad.active = false; _this2.pvSp.action("action1", true); _this2.pvSp.node.scaleX = 1; _this2.step_num++; nx.gui.setActive(_this2, "txt", true); _this2.is_next = true; } }); } }); } } }); cc._RF.pop();