DebugViewImpl.ts 1.61 KB
import { DymmyEditBox, DummyRichText } from "../../../../common/CCDummyObjects";
import { CCPureView } from "../../../../common/classbase/CCViewBase";
import { RegView } from "../../PresenterCCViewFactory";
import { DebugView, DebugViewProps, DebugViewType } from "../type/DebugView";


const { ccclass, property } = cc._decorator;
@ccclass
@RegView(DebugViewType, "prefab/ui/DebugView")

export class DebugViewImpl extends CCPureView<DebugViewProps> implements DebugView {

    @property(cc.RichText)
    playerIdlabel: cc.RichText = DummyRichText;
    @property(cc.EditBox)
    catFoodNumber: cc.EditBox = DymmyEditBox;
    @property(cc.EditBox)
    cannedNumber: cc.EditBox = DymmyEditBox;

    onLoad() {
        this.bindProp("playerID", this.playerIdlabel, "string");
    }

    onCopyIdBtnClick() {
        this._props.onCopyIdBtnClickCallback();
    }

    onClearRecordBtnClick() {
        this._props.onClearRecordBtnClickCallback();
    }

    onCopyRecordBtnClick() {
        this._props.onCopyRecordBtnClickCallback();
    }

    onYouHuaBtnClick() {
        this._props.onYouHuaBtnClickCallback();
    }

    onShouBiaoBtnClick() {
        this._props.onShouBiaoBtnClickCallback();
    }

    onCatFoodBtnClick() {
        this._props.onCatFoodBtnClickCallback(Number(this.catFoodNumber.string));
    }

    onCannedBtnClick() {
        this._props.onCannedBtnClickCallback(Number(this.cannedNumber.string));
    }

    onClearSuitShareRecordBtnClick() {
        this._props.onClearSuitShareRecordBtnClickCallback();
    }

    onCloseBtnClick() {
        this.close();
    }
}