093f4e84-92fd-43e0-a556-0abc9863dfc7.js 4.92 KB
"use strict";
cc._RF.push(module, '093f46Ekv1D4KVWCryYY9/H', 'DateCountViewImpl');
// script/game/ui/view/impl/DateCountViewImpl.ts

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DateCountViewImpl = void 0;
const DateCountView_1 = require("../type/DateCountView");
const CCViewBase_1 = require("../../../../common/classbase/CCViewBase");
const PresenterCCViewFactory_1 = require("../../PresenterCCViewFactory");
const CCDummyObjects_1 = require("../../../../common/CCDummyObjects");
const simba_cc_resutils_1 = require("simba-cc-resutils");
const { ccclass, property } = cc._decorator;
let DateCountViewImpl = /** @class */ (() => {
    let DateCountViewImpl = class DateCountViewImpl extends CCViewBase_1.CCPureView {
        constructor() {
            super(...arguments);
            this.progressTipSpr = CCDummyObjects_1.DummySprite;
            this.preNumberSpr = CCDummyObjects_1.DummySprite;
            this.curNumberSpr = CCDummyObjects_1.DummySprite;
            this.skinSpr = CCDummyObjects_1.DummySprite;
            this.numberNode = CCDummyObjects_1.DummyNode;
            this.skinNameLabel = CCDummyObjects_1.DummyRichText;
            this.kaNode = CCDummyObjects_1.DummyNode;
            this._resumPosY = -120;
            this._moveTmpPosY = -10;
            this._actLifeCycle = 2;
            this._rotationStep = -60;
            this.runMoveAction = () => {
                this.numberNode.y = this._resumPosY;
                cc.tween(this.numberNode).to(this._actLifeCycle, { y: this._moveTmpPosY }, { easing: 'backInOut' }).start();
            };
            this.resumeMoveAction = () => {
                this.numberNode.y = this._resumPosY;
            };
        }
        onLoad() {
            this.bindProp("skinSprPath", async (value) => {
                if (value && "" !== value.trim() && !value.endsWith("/")) {
                    this.skinSpr.spriteFrame = await simba_cc_resutils_1.ResUtils.loadRes(value, cc.SpriteFrame);
                }
            });
            this.bindProp("progressTipSprPath", async (value) => {
                if (value && "" !== value.trim() && !value.endsWith("/")) {
                    this.progressTipSpr.spriteFrame = await simba_cc_resutils_1.ResUtils.loadRes(value, cc.SpriteFrame);
                }
            });
            this.bindProp("preNumberSprPath", async (value) => {
                if (value && "" !== value.trim() && !value.endsWith("/")) {
                    this.preNumberSpr.spriteFrame = await simba_cc_resutils_1.ResUtils.loadRes(value, cc.SpriteFrame);
                }
            });
            this.bindProp("curNumberSprPath", async (value) => {
                if (value && "" !== value.trim() && !value.endsWith("/")) {
                    this.curNumberSpr.spriteFrame = await simba_cc_resutils_1.ResUtils.loadRes(value, cc.SpriteFrame);
                }
            });
            this.bindProp("skinName", async (value) => {
                this.skinNameLabel.string = value;
            });
        }
        onEnable() {
            this.kaNodeAnim();
        }
        kaNodeAnim() {
            cc.tween(this.kaNode).by(this._actLifeCycle, { angle: this._rotationStep }).repeatForever().start();
        }
        closeAction() {
            if (this._props.canClose) {
                this.close();
                // GameModelManager.checkAutoPopView();
            }
        }
    };
    __decorate([
        property(cc.Sprite)
    ], DateCountViewImpl.prototype, "progressTipSpr", void 0);
    __decorate([
        property(cc.Sprite)
    ], DateCountViewImpl.prototype, "preNumberSpr", void 0);
    __decorate([
        property(cc.Sprite)
    ], DateCountViewImpl.prototype, "curNumberSpr", void 0);
    __decorate([
        property(cc.Sprite)
    ], DateCountViewImpl.prototype, "skinSpr", void 0);
    __decorate([
        property(cc.Node)
    ], DateCountViewImpl.prototype, "numberNode", void 0);
    __decorate([
        property(cc.RichText)
    ], DateCountViewImpl.prototype, "skinNameLabel", void 0);
    __decorate([
        property(cc.Node)
    ], DateCountViewImpl.prototype, "kaNode", void 0);
    DateCountViewImpl = __decorate([
        ccclass,
        PresenterCCViewFactory_1.RegView(DateCountView_1.DateCountViewType, "prefab/ui/DateCountView")
    ], DateCountViewImpl);
    return DateCountViewImpl;
})();
exports.DateCountViewImpl = DateCountViewImpl;

cc._RF.pop();