ExtraPlotViewImpl.ts 1.06 KB
import { DummyNode } from "../../../../common/CCDummyObjects";
import { CCPureView } from "../../../../common/classbase/CCViewBase";
import { RegView } from "../../PresenterCCViewFactory";
import { ExtraPlotView, ExtraPlotViewProps, ExtraPlotViewType } from "../type/ExtraPlotView";

const { ccclass, property } = cc._decorator;

@ccclass
@RegView(ExtraPlotViewType, "prefab/ui/ExtraPlotView")
export class ExtraPlotViewImpl extends CCPureView<ExtraPlotViewProps> implements ExtraPlotView {

    @property({ type: [cc.Node], displayName: "Countdown node" })
    markButtonNodes: cc.Node[] = [];

    @property({ type: cc.Node, displayName: "Mask node" })
    maskNode: cc.Node = DummyNode;

    getMarkButtonNodes(): cc.Node[] {
        return this.markButtonNodes;
    }

    getMaskNode(): cc.Node {
        return this.maskNode;
    }

    onMarkButtonClick(event, customEventData) {
        let tabbarId = Number(customEventData);
        this._props.onMarkButtonClickCallback(tabbarId);
    }
    
    onCloseButtonClick() {
        this._props.onCloseButtonClickCallback();
    }
}