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C,IAAI,EAAE,CAAC;YAC9B,+BAAc,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAC7E,MAAM,CAAC,MAAM,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;QACvD,CAAC;QAED,KAAK,CAAC,SAAS;QAEf,CAAC;KACJ,CAAA;IArEG;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;iDACR;IAE/C;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;mDACf;IAGrC;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;gDAClB;IAEhC;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;mDACf;IATlB,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAuE5B;IAAD,eAAC;KAAA;kBAvEoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["import { GameConfig } from \"../GameConfig\";\nimport { UIManager } from \"../common/gameplay/managers/UIManager\";\nimport { AnimationUtils } from \"../common/utils/AnimationUtils\";\nimport { PlotManager } from \"../avg/PlotManager\";\nimport { SDK } from \"simba-sdk\";\nimport { GameModelManager } from \"./model/GameModelManager\";\nimport MainViewPresenter from \"./ui/presenter/MainViewPresenter\";\nimport { DummyLabel, DummyNode, DummyProgressBar } from \"../common/CCDummyObjects\";\nimport { AudioManager } from \"../common/gameplay/managers/AudioManager\";\n\nconst { ccclass, property } = cc._decorator;\n\n\n@ccclass\nexport default class Launcher extends cc.Component {\n    @property({ type: cc.ProgressBar, displayName: \"进度条\" })\n    progressBar: cc.ProgressBar = DummyProgressBar;\n    @property({ type: cc.Label, displayName: \"进度展示文本\" })\n    progressLabel: cc.Label = DummyLabel;\n\n    @property({ type: cc.Node, displayName: \"UI根结点\" })\n    uiRootNode: cc.Node = DummyNode;\n    @property({ type: cc.Node, displayName: \"引导根结点\" })\n    guideRootNode: cc.Node = DummyNode;\n\n    onLoad() {\n        let winSize = cc.winSize;\n        if (winSize.width / winSize.height > 720 / 1280) {\n            let canvas = this.node.getComponent(cc.Canvas);\n            canvas.fitWidth = true;\n            canvas.fitHeight = true;\n        }\n        //关闭fps展示\n        cc.debug.setDisplayStats(GameConfig.showFPS);\n        cc.macro.ENABLE_MULTI_TOUCH = false;\n    }\n\n    start() {\n        this.initializeGame();\n    }\n\n    async initializeGame() {\n        AudioManager.init(\"audio/bgm/\", \"audio/effect/\", \"audio/voice/\")\n        await UIManager.init(this.uiRootNode!);\n        let mainViewPromise = UIManager.pushPresenter(MainViewPresenter, undefined);\n        AnimationUtils.animateProgress(this.progressBar!, 0.2);\n        let ret = false;\n        let tryCount = 0;\n        while (!ret && tryCount < 3) {\n            tryCount++;\n            ret = await SDK.init();\n        }\n        if (!ret) {\n            // TODO show error alert\n            console.error(\"SDK init failed.\");\n            return;\n        }\n        AnimationUtils.animateProgress(this.progressBar, 0.4, 1, this.progressLabel);\n        tryCount = 0;\n        while (1) {\n            try {\n                tryCount++;\n                await SDK.login();\n                break;\n            } catch (e) {\n                if (tryCount > 3) {\n                    console.log(\"SDK login failed.\");\n                    return;\n                }\n            }\n        }\n        AnimationUtils.animateProgress(this.progressBar, 0.6, 1, this.progressLabel);\n        await PlotManager.init();\n        AnimationUtils.animateProgress(this.progressBar, 0.8, 1, this.progressLabel);\n        await PlotManager.start();\n        // init game data\n        await GameModelManager.init();\n        AnimationUtils.animateProgress(this.progressBar, 1.0, 1, this.progressLabel);\n        await (await mainViewPromise).start();\n        this.node.getChildByName(\"Loading\").active = false;\n    }\n\n    async startGame() {\n\n    }\n}"]}