import UIFullView from "../Core/BaseView/UIFullView";
import { ViewConst } from "../Core/ConstDefine/ViewConst";
import UIButton from "../Core/UI/UIButton";

export default class MenuView extends UIFullView{


    public paint:cc.Node;        //游戏画板
    public resultPaint:cc.Node;  //结束画板
    // public palette:cc.Node;      //调色板
    public choiceColor:cc.Node;  //色彩选择框
    public roleAnimation:dragonBones.ArmatureDisplay;//动画角色猫龙骨骼
    public btnSubmit:UIButton  //提交按钮*取消
    public btnColors:UIButton[]   //色彩按钮
    public colorItems:cc.Node[];    //要涂的色块对象。每个色块为一个节点。对节点进行改色    
    public btnRole:UIButton

    public getTypeName(): string {
        return ViewConst.MenuView;
    }

    protected async getChilds(){
        this.paint=this.getChildNode("main_area/paint");
        let colorArea=this.getChildNode("main_area/paint/alligator");
        this.colorItems=new Array();
        for(let i=0;i<colorArea.childrenCount;i++){
            let item=colorArea.children[i];
            this.colorItems[i]=item;
        }

        this.resultPaint=this.getChildNode("paint2");
        let palette=this.getChildNode("color_area");
        this.choiceColor=this.getChildNode("color_area/icon_choose");
        this.roleAnimation=this.getChildComp("bottom_area/coolcat",dragonBones.ArmatureDisplay);
        this.btnRole=new UIButton();
        this.btnRole.loadViewClone(this.getChildNode("bottom_area/BtnCoolCat"),false);
        this.btnSubmit=new UIButton();
        this.btnSubmit.loadViewClone(this.getChildNode("bottom_area/btn_submit"),false);
        this.btnColors=new Array();
        for(let i=0;i<palette.childrenCount;i++){
            let btn_node=palette.children[i];
            if(btn_node.active){
                let btnColor=new UIButton();
                btnColor.loadViewClone(btn_node,false);
                this.btnColors.push(btnColor);
            }
        }
    }    

    protected async onUpdateData(){
    }

    protected onOpen(){
    }
    protected onClose(){
    }
}