| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3"], function (_export, _context) {
- "use strict";
- var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, oops, ecs, CCVMParentComp, _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);
- }
- 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;
- }],
- 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-06 14:56:34
- */
- __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.loadRes();
- }
- /** 加载资源 */
- 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);
- // await ModuleUtil.addViewUiAsync(smc.account, StartViewComp, UIID.Start);
- // ModuleUtil.removeViewUi(this.ent, LoadingViewComp, UIID.Loading);
- // 初始化帐号模块
- // smc.account.connect();
- //初始化剩下的东西
- })();
- }
- reset() {}
- }) || _class) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=107d1fe45334c44eb3ff42ed28e116dc4109601e.js.map
|