123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6"], function (_export, _context) {
- "use strict";
- var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, game, Prefab, ProgressBar, ch, gui, ch_start_pack, ResUtil, ModuleDef, SceneDef, _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _class3, _crd, ccclass, property, _preloadBundles, _preloadRes, _loadingText, _totalNum, Start;
- 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 _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
- function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
- function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
- function _reportPossibleCrUseOfch(extras) {
- _reporterNs.report("ch", "../ch/ch", _context.meta, extras);
- }
- function _reportPossibleCrUseOfgui(extras) {
- _reporterNs.report("gui", "../core/ui/ui", _context.meta, extras);
- }
- function _reportPossibleCrUseOfch_start_pack(extras) {
- _reporterNs.report("ch_start_pack", "../ch/start/ch_start_pack", _context.meta, extras);
- }
- function _reportPossibleCrUseOfResUtil(extras) {
- _reporterNs.report("ResUtil", "../core/util/ResUtil", _context.meta, extras);
- }
- function _reportPossibleCrUseOfModuleDef(extras) {
- _reporterNs.report("ModuleDef", "../Scripts/ModuleDef", _context.meta, extras);
- }
- function _reportPossibleCrUseOfSceneDef(extras) {
- _reporterNs.report("SceneDef", "../Scripts/SceneDef", _context.meta, extras);
- }
- return {
- setters: [function (_unresolved_) {
- _reporterNs = _unresolved_;
- }, function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- game = _cc.game;
- Prefab = _cc.Prefab;
- ProgressBar = _cc.ProgressBar;
- }, function (_unresolved_2) {
- ch = _unresolved_2.ch;
- }, function (_unresolved_3) {
- gui = _unresolved_3.gui;
- }, function (_unresolved_4) {
- ch_start_pack = _unresolved_4.ch_start_pack;
- }, function (_unresolved_5) {
- ResUtil = _unresolved_5.ResUtil;
- }, function (_unresolved_6) {
- ModuleDef = _unresolved_6.ModuleDef;
- }, function (_unresolved_7) {
- SceneDef = _unresolved_7.SceneDef;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "66e163GxmdDp7kaguqDvTVl", "Start", undefined);
- __checkObsolete__(['_decorator', 'game', 'Label', 'Prefab', 'Node', 'Slider', 'ProgressBar']);
- // import TableLoadUtil from '../core/util/TableLoadUtil';
- // import { TableUtil } from '../module_extra/table_ts/TableUtil';
- ({
- ccclass,
- property
- } = _decorator); //预加载模块
- _preloadBundles = [(_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).BASIC, (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).EXTRA, (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).GAME]; //预加载资源
- _preloadRes = [// { bundle: ModuleDef.EXTRA, url: 'ui_loading/UI_Loading' },
- {
- bundle: (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).BASIC,
- url: 'ui_alert/UI_Alert'
- }, {
- bundle: (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).BASIC,
- url: 'ui_waiting/UI_Waiting'
- }, {
- bundle: (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).BASIC,
- url: 'ui_notify/UI_Notify'
- } // { bundle: ModuleDef.Link, url: 'ui/main/UI_Main' },
- ]; //
- _loadingText = ['Loading.', 'Loading..', 'Loading...'];
- _totalNum = _preloadBundles.length + _preloadRes.length + 1;
- _export("Start", Start = (_dec = ccclass('Start'), _dec2 = property(ProgressBar), _dec3 = property({
- type: Prefab,
- displayName: 'ui初始预制体'
- }), _dec(_class = (_class2 = (_class3 = class Start extends (_crd && ch_start_pack === void 0 ? (_reportPossibleCrUseOfch_start_pack({
- error: Error()
- }), ch_start_pack) : ch_start_pack) {
- constructor() {
- super(...arguments);
- // @property(Label)
- // txtLoading: Label;
- // @property(Slider)
- // loadingSlider: Slider;
- _initializerDefineProperty(this, "loadingBar", _descriptor, this);
- this._percent = '1';
- this._numCurrentLoaded = 0;
- _initializerDefineProperty(this, "ui_prefab", _descriptor2, this);
- }
- onLoad() {
- Start.packId = this.pid;
- }
- start() {
- var _this = this;
- return _asyncToGenerator(function* () {
- console.log('Start');
- (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({
- error: Error()
- }), gui) : gui).init(_this.ui_prefab);
- game.frameRate = 61; // if (this.pid == 1) {
- // // seeg.onLoginRet(
- // // async (ret: { openid: string; white: boolean }) => {
- // // console.log(ret);
- // // await this.try_init(3);
- // // this.preloadBundle(0);
- // // }
- // // //(ret: { userId: number; openId: string; isTest: boolean; abTest: number }) => {
- // // //console.log(ret);
- // // //}
- // // )
- // // seeg.init({ gid: this.gid, loggerLevel: this.log, old: false });
- // } else {
- // await this.try_init(3);
- // this.preloadBundle(0);
- // }
- yield _this.try_init(3);
- _this.preloadBundle(0);
- })();
- }
- onResLoaded() {
- this._numCurrentLoaded++;
- console.log(this._numCurrentLoaded); // this._percent = ~~(this._numCurrentLoaded / _totalNum * 100) + '%';
- }
- preloadBundle(idx) {
- var _this2 = this;
- return _asyncToGenerator(function* () {
- yield (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
- error: Error()
- }), ResUtil) : ResUtil).loadBundle(_preloadBundles[idx]);
- (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({
- error: Error()
- }), ch) : ch).log.info('module:<' + _preloadBundles[idx] + '>loaded.');
- idx++;
- _this2.onResLoaded();
- if (idx < _preloadBundles.length) {
- _this2.preloadBundle(idx);
- } else {
- _this2.preloadRes(0);
- }
- })();
- }
- preloadRes(idx) {
- var _this3 = this;
- return _asyncToGenerator(function* () {
- var res = _preloadRes[idx];
- yield (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
- error: Error()
- }), ResUtil) : ResUtil).loadAsset(res.url, res.bundle);
- idx++;
- _this3.onResLoaded();
- if (idx < _preloadRes.length) {
- _this3.preloadRes(idx);
- } else {
- _this3.onPreloadingComplete();
- }
- })();
- }
- onPreloadingComplete() {
- var _this4 = this;
- return _asyncToGenerator(function* () {
- yield (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
- error: Error()
- }), ResUtil) : ResUtil).loadScene((_crd && SceneDef === void 0 ? (_reportPossibleCrUseOfSceneDef({
- error: Error()
- }), SceneDef) : SceneDef).Hall, (_crd && ModuleDef === void 0 ? (_reportPossibleCrUseOfModuleDef({
- error: Error()
- }), ModuleDef) : ModuleDef).GAME, true);
- _this4.onResLoaded();
- })();
- }
- update(deltaTime) {
- if (this._percent) {
- // this.txtLoading.string = 'Loading...' + this._percent;
- var sc = this._numCurrentLoaded / _totalNum;
- if (sc >= 1) {
- this.loadingBar.progress = sc;
- } else {
- this.loadingBar.progress = this._numCurrentLoaded / _totalNum;
- }
- } // else {
- // let idx = Math.floor(game.totalTime / 1000) % 3;
- // this.txtLoading.string = _loadingText[idx];
- // }
- }
- }, _class3.packId = void 0, _class3), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "loadingBar", [_dec2], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "ui_prefab", [_dec3], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- })), _class2)) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=677a1a0214bd517782a919e898d49c8d602eda93.js.map
|