123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- var t = require;
- var e = module;
- var i = exports;
- Object.defineProperty(i, "__esModule", {value: !0});
- const h = t("App");
- (cc.ProgressBar.prototype.stopRunToAction = function () {
- this.__cbRunToAction && (this.unschedule(this.__cbRunToAction), (this.__cbRunToAction = null));
- }),
- (cc.ProgressBar.prototype.runTo = function (a, n, r = !1) {
- var l = this;
- return new Promise(function (e) {
- var i,
- s,
- t,
- o = l.progress;
- a != o
- ? isNaN(a) ||
- (0 == n || isNaN(n)
- ? ((l.progress = a), e())
- : ((i = a > l.progress),
- l.stopRunToAction(),
- (s = (a - o) / n),
- (t = function (t) {
- o += s * t;
- t = i ? a <= o : o <= a;
- (l.progress = r ? Math.abs(o) - Math.floor(Math.abs(o)) : o.limit(0, 1)),
- t &&
- ((t = a),
- r && (t = Math.abs(t) - Math.floor(Math.abs(t))),
- (l.progress = t),
- l.unscheduleAllCallbacks(),
- e());
- }),
- l.schedule(t, 0, cc.macro.REPEAT_FOREVER),
- (l.__cbRunToAction = t)))
- : e();
- });
- }),
- (cc.Label.prototype.numberTo = function (t, e, i, s) {
- var o,
- a,
- n = this,
- r = null == t ? parseInt(this.string) : t;
- (r = isNaN(r) ? 0 : r) != e &&
- ((this.string = s ? s(r) : r + ""),
- (o = (e - r) / i),
- (a = r < e),
- this.stopNumberAction(),
- (this.__cbNumberTo = i =
- function (t) {
- (r += o * t),
- (n.string = s ? s(r) : r + ""),
- a != r < e && (n.unscheduleAllCallbacks(), (n.string = s ? s(e) : e + ""));
- }),
- this.schedule(i, 0, cc.macro.REPEAT_FOREVER));
- }),
- (cc.Label.prototype.stopNumberAction = function () {
- this.__cbNumberTo && (this.unschedule(this.__cbNumberTo), (this.__cbNumberTo = null));
- }),
- (cc.Label.prototype.timeCounter = function (t, e = 1, i, s, o) {
- var a = this;
- (t /= 1e3), (this.string = i ? i(t) : t + ""), this.stopTimeCounterAction();
- var n,
- r = h.default.DateUtils.Now(),
- l = function () {
- (n = Math.round(t - (h.default.DateUtils.Now() - r) / 1e3)),
- (a.string = i ? i(n) : n + ""),
- o && o(n),
- n <= 0 && (s && s(), a.unschedule(l));
- };
- return (this.__cbTimeCounter = l), this.schedule(l, e, cc.macro.REPEAT_FOREVER), l(), l;
- }),
- (cc.Label.prototype.stopTimeCounterAction = function () {
- this.__cbTimeCounter && (this.unschedule(this.__cbTimeCounter), (this.__cbTimeCounter = null));
- });
|