Ejemplo n.º 1
0
 private void ChangCardHandler(VoHttp vo)
 {
     doudoduodu = false;
     if ((bool)(vo.data) && cX != -1 && cY != -1)
     {
         ((userModel.card_group [cX] as object[]) [cY]) = MediatorItemShipInfo.changeCID;
         cardModel.SetData();
         c1.selectedIndex = cX;
         Tab_Change();
     }
     isMove = false;
     MediatorItemShipInfo.changeCID = "";
     MediatorItemShipInfo.CID       = "";
     cX = -1;
     cY = -1;
     IsChangeType(false);
 }
Ejemplo n.º 2
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_COMSHIPINFO);

        sim           = (Dictionary <string, object>)(DataManager.inst.systemSimple ["card_attr_info"]);
        cardModel     = ModelManager.inst.cardModel;
        tips          = (object[])cardModel.shipinfo_cardData [cardModel.shipinfo_callinID];
        card          = cardModel.shipinfo_cvo;
        card.cardData = cardModel.shipinfo_cardData;
        cardModel.SetData();
        title = this.GetChild("n4").asTextField;
        list  = this.GetChild("n1").asList;

        title.text              = Tools.GetMessageById(cardModel.shipinfo_title);
        list.itemRenderer       = onListRander;
        list.numItems           = tips.Length;
        list.foldInvisibleItems = true;
        list.ResizeToFit(tips.Length);
        group.height = list.height + 80;
        this.height  = list.height + 80;
    }
Ejemplo n.º 3
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_ITEMSHIP);
        cardModel = ModelManager.inst.cardModel;
        userModel = ModelManager.inst.userModel;
//		this.x = cardModel.v2.x;
        this.y = cardModel.v2.y;
//		Log.debug ("xxx-" + this.x + " yyy-" + this.y);
//		return;
//		view.x = 103;
//		view.y = 40;
//		view.width = ModelManager.inst.gameModel.width;
//		isFirst = true;
        cardModel.SetData();
        cfg            = DataManager.inst.systemSimple;
        userCard       = ModelManager.inst.userModel.card;
        oldred         = (int)userModel.records [Config.ASSET_REDBAGCOIN] < 0 ? 0 : (int)userModel.records [Config.ASSET_REDBAGCOIN];
        list           = this.GetChild("n28").asList; //Tools.FindChild<L_List> (this.thiss, "L_List");
        list1          = this.GetChild("n23").asList; //Tools.FindChild<L_List> (this.thiss, "L_ListZu");
        list2          = this.GetChild("n31").asList; //Tools.FindChild<L_List> (this.thiss, "L_List2");
        L_Label        = this.GetChild("n25").asTextField;
        l_mycardNum    = this.GetChild("n16").asTextField;
        c_card         = this.GetChild("n24") as ComCard;
        btn_clear      = this.GetChild("n26").asButton;
        btn_clear.text = Tools.GetMessageById("24126");
        btn_clear.onClick.Add(OnClearChangeHandler);
//		gui1 = this.GetChild ("n30").asImage;
//		gui0 = view.GetChild ("n29").asImage;
        this.GetChild("n25").asTextField.text = Tools.GetMessageById("24124");
        g_have    = this.GetChild("n27").asGroup;
        c1        = this.GetController("c1");
        cardinfo  = this.GetChild("n40").asGroup;
        cardGroup = this.GetChild("n47").asGroup;

        c1.onChanged.Add(Tab_Change);
        c1.onChangeTip.Add(Tab_ChangeTip);
        canChangeGroup = userModel.GetUnlcok(Config.UNLOCK_CARDGROUP, this.GetChild("n3").asButton);
        userModel.GetUnlcok(Config.UNLOCK_CARDGROUP, this.GetChild("n4").asButton);
        userModel.GetUnlcok(Config.UNLOCK_CARDGROUP, this.GetChild("n5").asButton);

        Dictionary <string, object> cfg1 = (Dictionary <string, object>)DataManager.inst.systemSimple ["unlock"];

        object[] i = (object[])cfg1 [Config.UNLOCK_CARDGROUP];
        msg = Tools.GetMessageById("14028", new string[] { i [0].ToString() });

        c1.changeObj.Add(this.GetChild("n3").asButton);
        c1.changeObj.Add(this.GetChild("n4").asButton);
        c1.changeObj.Add(this.GetChild("n5").asButton);

        list1.itemRenderer = List_Render1;
        list.itemRenderer  = List_Render;
        list2.itemRenderer = List_Render2;

        l_mycardNum.text = Tools.GetMessageColor(Tools.GetMessageById("17010", new string[] {
            userCard.Keys.Count + "",
            DataManager.inst.GetCardNumByLv(ModelManager.inst.userModel.effort_lv) + ""
        }), new string[] { "F8DD2CFF" });
        this.GetChild("n9").asTextField.text  = Tools.GetMessageById("24127");
        this.GetChild("n14").asTextField.text = Tools.GetMessageById("24128");

        IsChangeType(false);

        this.AddGlobalListener(MainEvent.CARD_CHANGE, OnChangeCallBack);
        this.AddGlobalListener(MainEvent.CARD_LEVELUP, OnlevelUp);
        this.AddGlobalListener(MainEvent.LEVEL_UP_USER, OnUserLevelup);
//		this.AddGlobalListener (MainEvent.JUMP_COINGOLDEXPGET, OnJumpFunction);

        if ((int)userModel.records ["card_group_index"] == 0)
        {
            Tab_Change();
        }
        else
        {
            c1.selectedIndex = (int)userModel.records ["card_group_index"];
        }
        cardModel.teamIndex = c1.selectedIndex;
        cardModel.UpdataMyCardData();

        if (GuideManager.inst.Check("1:0"))         //引导开始 升级卡牌
        {
            List_Render1(0, this.GetChild("n46"));
            GuideManager.inst.Next();
            GuideManager.inst.Show(this);
        }
//		else if(GuideManager.inst.Check ("2:0")){
//			GuideManager.inst.Clear ();
//			GuideManager.inst.Show (this);
//		}
        else
        {
            this.RemoveChild(this.GetChild("n46"));
        }
    }