Launcher.js 14.4 KB

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/script/game/Launcher.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'f191b3NyXtCubDaTGld/tHG', 'Launcher');
// script/game/Launcher.ts

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const GameConfig_1 = require("../GameConfig");
const UIManager_1 = require("../common/gameplay/managers/UIManager");
const AnimationUtils_1 = require("../common/utils/AnimationUtils");
const PlotManager_1 = require("../avg/PlotManager");
const simba_sdk_1 = require("simba-sdk");
const GameModelManager_1 = require("./model/GameModelManager");
const MainViewPresenter_1 = require("./ui/presenter/MainViewPresenter");
const CCDummyObjects_1 = require("../common/CCDummyObjects");
const AudioManager_1 = require("../common/gameplay/managers/AudioManager");
const { ccclass, property } = cc._decorator;
let Launcher = /** @class */ (() => {
    let Launcher = class Launcher extends cc.Component {
        constructor() {
            super(...arguments);
            this.progressBar = CCDummyObjects_1.DummyProgressBar;
            this.progressLabel = CCDummyObjects_1.DummyLabel;
            this.uiRootNode = CCDummyObjects_1.DummyNode;
            this.guideRootNode = CCDummyObjects_1.DummyNode;
            this.VerbRoot = CCDummyObjects_1.DummyNode;
        }
        onLoad() {
            let winSize = cc.winSize;
            if (winSize.width / winSize.height > 720 / 1280) {
                let canvas = this.node.getComponent(cc.Canvas);
                canvas.fitWidth = true;
                canvas.fitHeight = true;
            }
            //关闭fps展示
            cc.debug.setDisplayStats(GameConfig_1.GameConfig.showFPS);
            cc.macro.ENABLE_MULTI_TOUCH = false;
        }
        start() {
            this.initializeGame();
        }
        async initializeGame() {
            AudioManager_1.AudioManager.init("audio/bgm/", "audio/effect/", "audio/voice/");
            await UIManager_1.UIManager.init(this.uiRootNode);
            let mainViewPromise = UIManager_1.UIManager.pushPresenter(MainViewPresenter_1.default, undefined);
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.2);
            let ret = false;
            let tryCount = 0;
            while (!ret && tryCount < 3) {
                tryCount++;
                ret = await simba_sdk_1.SDK.init();
            }
            if (!ret) {
                // TODO show error alert
                console.error("SDK init failed.");
                return;
            }
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.4, 1, this.progressLabel);
            tryCount = 0;
            while (1) {
                try {
                    tryCount++;
                    await simba_sdk_1.SDK.login();
                    break;
                }
                catch (e) {
                    if (tryCount > 3) {
                        console.log("SDK login failed.");
                        return;
                    }
                }
            }
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.6, 1, this.progressLabel);
            await PlotManager_1.PlotManager.init();
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.8, 1, this.progressLabel);
            await PlotManager_1.PlotManager.start();
            // init game data
            await GameModelManager_1.GameModelManager.init();
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 1.0, 1, this.progressLabel);
            await (await mainViewPromise).start();
            this.node.getChildByName("Loading").active = false;
        }
        async startGame() {
        }
    };
    __decorate([
        property({ type: cc.ProgressBar, displayName: "进度条" })
    ], Launcher.prototype, "progressBar", void 0);
    __decorate([
        property({ type: cc.Label, displayName: "进度展示文本" })
    ], Launcher.prototype, "progressLabel", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "UI根结点" })
    ], Launcher.prototype, "uiRootNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "引导根结点" })
    ], Launcher.prototype, "guideRootNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: '转场根节点' })
    ], Launcher.prototype, "VerbRoot", void 0);
    Launcher = __decorate([
        ccclass
    ], Launcher);
    return Launcher;
})();
exports.default = Launcher;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvZ2FtZS9MYXVuY2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDhDQUEyQztBQUMzQyxxRUFBa0U7QUFDbEUsbUVBQWdFO0FBQ2hFLG9EQUFpRDtBQUNqRCx5Q0FBZ0M7QUFDaEMsK0RBQTREO0FBQzVELHdFQUFpRTtBQUNqRSw2REFBbUY7QUFDbkYsMkVBQXdFO0FBR3hFLE1BQU0sRUFBRSxPQUFPLEVBQUUsUUFBUSxFQUFFLEdBQUcsRUFBRSxDQUFDLFVBQVUsQ0FBQztBQUk1QztJQUFBLElBQXFCLFFBQVEsR0FBN0IsTUFBcUIsUUFBUyxTQUFRLEVBQUUsQ0FBQyxTQUFTO1FBQWxEOztZQUVJLGdCQUFXLEdBQW1CLGlDQUFnQixDQUFDO1lBRS9DLGtCQUFhLEdBQWEsMkJBQVUsQ0FBQztZQUdyQyxlQUFVLEdBQVksMEJBQVMsQ0FBQztZQUVoQyxrQkFBYSxHQUFZLDBCQUFTLENBQUM7WUFFbkMsYUFBUSxHQUFZLDBCQUFTLENBQUM7UUErRGxDLENBQUM7UUE3REcsTUFBTTtZQUNGLElBQUksT0FBTy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AgICAgICAgfVxuICAgICAgICBBbmltYXRpb25VdGlscy5hbmltYXRlUHJvZ3Jlc3ModGhpcy5wcm9ncmVzc0JhciwgMC40LCAxLCB0aGlzLnByb2dyZXNzTGFiZWwpO1xuICAgICAgICB0cnlDb3VudCA9IDA7XG4gICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHRyeUNvdW50Kys7XG4gICAgICAgICAgICAgICAgYXdhaXQgU0RLLmxvZ2luKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRyeUNvdW50ID4gMykge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIlNESyBsb2dpbiBmYWlsZWQuXCIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgQW5pbWF0aW9uVXRpbHMuYW5pbWF0ZVByb2dyZXNzKHRoaXMucHJvZ3Jlc3NCYXIsIDAuNiwgMSwgdGhpcy5wcm9ncmVzc0xhYmVsKTtcbiAgICAgICAgYXdhaXQgUGxvdE1hbmFnZXIuaW5pdCgpO1xuICAgICAgICBBbmltYXRpb25VdGlscy5hbmltYXRlUHJvZ3Jlc3ModGhpcy5wcm9ncmVzc0JhciwgMC44LCAxLCB0aGlzLnByb2dyZXNzTGFiZWwpO1xuICAgICAgICBhd2FpdCBQbG90TWFuYWdlci5zdGFydCgpO1xuICAgICAgICAvLyBpbml0IGdhbWUgZGF0YVxuICAgICAgICBhd2FpdCBHYW1lTW9kZWxNYW5hZ2VyLmluaXQoKTtcbiAgICAgICAgQW5pbWF0aW9uVXRpbHMuYW5pbWF0ZVByb2dyZXNzKHRoaXMucHJvZ3Jlc3NCYXIsIDEuMCwgMSwgdGhpcy5wcm9ncmVzc0xhYmVsKTtcbiAgICA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