| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8"], function (_export, _context) {
- "use strict";
- var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, oops, ecs, CCVMParentComp, ModuleUtil, smc, UIID, GameEvent, EliminateViewComp, _dec, _dec2, _class, _crd, ccclass, property, LoadingViewComp;
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
- function _reportPossibleCrUseOfoops(extras) {
- _reporterNs.report("oops", "../../../../../extensions/oops-plugin-framework/assets/core/Oops", _context.meta, extras);
- }
- function _reportPossibleCrUseOfecs(extras) {
- _reporterNs.report("ecs", "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS", _context.meta, extras);
- }
- function _reportPossibleCrUseOfCCVMParentComp(extras) {
- _reporterNs.report("CCVMParentComp", "../../../../../extensions/oops-plugin-framework/assets/module/common/CCVMParentComp", _context.meta, extras);
- }
- function _reportPossibleCrUseOfModuleUtil(extras) {
- _reporterNs.report("ModuleUtil", "../../../../../extensions/oops-plugin-framework/assets/module/common/ModuleUtil", _context.meta, extras);
- }
- function _reportPossibleCrUseOfsmc(extras) {
- _reporterNs.report("smc", "../../common/SingletonModuleComp", _context.meta, extras);
- }
- function _reportPossibleCrUseOfUIID(extras) {
- _reporterNs.report("UIID", "../../common/config/GameUIConfig", _context.meta, extras);
- }
- function _reportPossibleCrUseOfGameEvent(extras) {
- _reporterNs.report("GameEvent", "../../common/config/GameEvent", _context.meta, extras);
- }
- function _reportPossibleCrUseOfEliminateViewComp(extras) {
- _reporterNs.report("EliminateViewComp", "../../eliminate/view/EliminateViewComp", _context.meta, extras);
- }
- return {
- setters: [function (_unresolved_) {
- _reporterNs = _unresolved_;
- }, function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- }, function (_unresolved_2) {
- oops = _unresolved_2.oops;
- }, function (_unresolved_3) {
- ecs = _unresolved_3.ecs;
- }, function (_unresolved_4) {
- CCVMParentComp = _unresolved_4.CCVMParentComp;
- }, function (_unresolved_5) {
- ModuleUtil = _unresolved_5.ModuleUtil;
- }, function (_unresolved_6) {
- smc = _unresolved_6.smc;
- }, function (_unresolved_7) {
- UIID = _unresolved_7.UIID;
- }, function (_unresolved_8) {
- GameEvent = _unresolved_8.GameEvent;
- }, function (_unresolved_9) {
- EliminateViewComp = _unresolved_9.EliminateViewComp;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "92429ykTnxFCrcGyW58JWjj", "LoadingViewComp", undefined);
- /*
- * @Author: dgflash
- * @Date: 2021-07-03 16:13:17
- * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-13 14:43:57
- */
- __checkObsolete__(['_decorator']);
- ({
- ccclass,
- property
- } = _decorator);
- /** 游戏资源加载 */
- _export("LoadingViewComp", LoadingViewComp = (_dec = ccclass('LoadingViewComp'), _dec2 = (_crd && ecs === void 0 ? (_reportPossibleCrUseOfecs({
- error: Error()
- }), ecs) : ecs).register('LoadingView', false), _dec(_class = _dec2(_class = class LoadingViewComp extends (_crd && CCVMParentComp === void 0 ? (_reportPossibleCrUseOfCCVMParentComp({
- error: Error()
- }), CCVMParentComp) : CCVMParentComp) {
- constructor() {
- super(...arguments);
- /** VM 组件绑定数据 */
- this.data = {
- /** 加载资源当前进度 */
- finished: 0,
- /** 加载资源最大进度 */
- total: 0,
- /** 加载资源进度比例值 */
- progress: "0",
- /** 加载流程中提示文本 */
- prompt: ""
- };
- this.progress = 0;
- }
- start() {
- this.enter();
- }
- enter() {
- this.addEvent();
- this.loadRes();
- }
- addEvent() {
- this.on((_crd && GameEvent === void 0 ? (_reportPossibleCrUseOfGameEvent({
- error: Error()
- }), GameEvent) : GameEvent).LoginSuccess, this.onHandler, this);
- }
- onHandler(event, args) {
- switch (event) {
- case (_crd && GameEvent === void 0 ? (_reportPossibleCrUseOfGameEvent({
- error: Error()
- }), GameEvent) : GameEvent).LoginSuccess:
- // 加载流程结束,移除加载提示界面
- console.log("加载流程结束,移除加载提示界面");
- this.ent.remove(LoadingViewComp);
- break;
- }
- }
- /** 加载资源 */
- loadRes() {
- var _this = this;
- return _asyncToGenerator(function* () {
- _this.data.progress = 0;
- yield _this.loadCustom();
- _this.loadGameRes();
- })();
- }
- /** 加载游戏本地JSON数据(自定义内容) */
- loadCustom() {
- // 加载游戏本地JSON数据的多语言提示文本
- this.data.prompt = (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
- error: Error()
- }), oops) : oops).language.getLangByID("loading_load_json");
- }
- /** 加载初始游戏内容资源 */
- loadGameRes() {
- // 加载初始游戏内容资源的多语言提示文本
- this.data.prompt = (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
- error: Error()
- }), oops) : oops).language.getLangByID("loading_load_game");
- (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
- error: Error()
- }), oops) : oops).res.loadDir("game", this.onProgressCallback.bind(this), this.onCompleteCallback.bind(this));
- }
- /** 加载进度事件 */
- onProgressCallback(finished, total, item) {
- this.data.finished = finished;
- this.data.total = total;
- var progress = finished / total;
- if (progress > this.progress) {
- this.progress = progress;
- this.data.progress = (progress * 100).toFixed(2);
- }
- }
- /** 加载完成事件 */
- onCompleteCallback() {
- var _this2 = this;
- return _asyncToGenerator(function* () {
- // 获取用户信息的多语言提示文本
- _this2.data.prompt = (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
- error: Error()
- }), oops) : oops).language.getLangByID("loading_load_player"); // await ModuleUtil.addViewUiAsync(smc.account, DemoViewComp, UIID.Demo);
- yield (_crd && ModuleUtil === void 0 ? (_reportPossibleCrUseOfModuleUtil({
- error: Error()
- }), ModuleUtil) : ModuleUtil).addViewUiAsync((_crd && smc === void 0 ? (_reportPossibleCrUseOfsmc({
- error: Error()
- }), smc) : smc).account, _crd && EliminateViewComp === void 0 ? (_reportPossibleCrUseOfEliminateViewComp({
- error: Error()
- }), EliminateViewComp) : EliminateViewComp, (_crd && UIID === void 0 ? (_reportPossibleCrUseOfUIID({
- error: Error()
- }), UIID) : UIID).Game);
- (_crd && ModuleUtil === void 0 ? (_reportPossibleCrUseOfModuleUtil({
- error: Error()
- }), ModuleUtil) : ModuleUtil).removeViewUi(_this2.ent, LoadingViewComp, (_crd && UIID === void 0 ? (_reportPossibleCrUseOfUIID({
- error: Error()
- }), UIID) : UIID).Loading); // 初始化帐号模块
- // smc.account.connect();
- //初始化剩下的东西
- //这做正式逻辑
- })();
- }
- reset() {}
- }) || _class) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=107d1fe45334c44eb3ff42ed28e116dc4109601e.js.map
|