123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- var t = require;
- var e = module;
- var i = exports;
- e =
- (this && this.__decorate) ||
- function (t, e, i, s) {
- var o,
- a = arguments.length,
- n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
- else
- for (var r = t.length - 1; 0 <= r; r--)
- (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
- return 3 < a && n && Object.defineProperty(e, i, n), n;
- };
- Object.defineProperty(i, "__esModule", {value: !0});
- const s = t("App"),
- o = t("GameText"),
- a = t("BaseView"),
- n = t("LoadingController"),
- {ccclass: r, property: l} = cc._decorator;
- t = class extends a.default {
- constructor() {
- super(...arguments),
- (this.tipNode = null),
- (this.progressBar = null),
- (this.progressLabel = null),
- (this.targetPregress = 0),
- (this.curPregress = 0),
- (this.versionLab = null),
- (this.isDownHotFile = !1),
- (this.closeType = 2);
- }
- initUI() {
- super.initUI(),
- (this.curPregress = 0),
- this.targetPregress || (this.targetPregress = 0.1),
- (this.progressBar.progress = 0),
- (this.versionLab.string = s.default.Platform.getVersionStr());
- }
- showTipNode() {
- (this.tipNode.active = !0),
- this.tipNode.on(
- cc.Node.EventType.TOUCH_END,
- () => {
- this.tipNode.active = !1;
- },
- this
- );
- }
- initData() {
- this._tempData = s.default.GameDataMsr.tempData;
- }
- onProgress(t) {
- this.targetPregress = t;
- }
- onHotProgress(t, e, i) {
- isNaN(t) && (t = 0),
- (this.progressBar.progress = t),
- (this.progressLabel.string = `${o.GameText.getText(lang.loading_updating)} ${Math.floor(100 * t)}% (${(
- e / 1024
- ).toFixed(3)}KB / ${(i / 1024).toFixed(3)}KB)`);
- }
- checkHot() {
- this.progressLabel.string = o.GameText.getText(lang.loading_check_update);
- }
- open() {
- (this.enabled = !0), this._tempData.isCheckUpdate && (this.progressLabel.string = "0%");
- }
- update(t) {
- var e;
- this._tempData.isCheckUpdate &&
- ((e = this.targetPregress),
- this.curPregress < e &&
- ((this.curPregress += 0.08),
- this.curPregress > e && (this.curPregress = e),
- (this.progressBar.progress = this.curPregress),
- (this.progressLabel.string = Math.floor(100 * this.curPregress) + "%")),
- 1 <= this.curPregress && (this.applyFunc(n.LoadingConst.ProgressComplete), (this.enabled = !1)));
- }
- onTouchAgainGame() {
- cc.audioEngine.stopAll(), cc.game.restart();
- }
- };
- e([l({type: cc.Node})], t.prototype, "tipNode", void 0),
- e([l(cc.ProgressBar)], t.prototype, "progressBar", void 0),
- e([l(cc.Label)], t.prototype, "progressLabel", void 0),
- e([l(cc.Label)], t.prototype, "versionLab", void 0),
- (t = e([r], t)),
- (i.default = t);
|