Exemple #1
0
    private void OnUserLevelup(MainEvent e)
    {
        oldred         = (int)ModelManager.inst.userModel.records [Config.ASSET_REDBAGCOIN] < 0 ? 0 : (int)ModelManager.inst.userModel.records [Config.ASSET_REDBAGCOIN];
        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);
//		userModel.GetUnlcok (Config.UNLOCK_CARDGROUP, this.GetChild("n6").asButton);
//		userModel.GetUnlcok (Config.UNLOCK_CARDGROUP, this.GetChild("n7").asButton);
    }
Exemple #2
0
 private void On_Root_ChangeTips(EventContext data)
 {
     if (Convert.ToInt32(data.data) == 1)
     {
         userModel.GetUnlcok(Config.UNLOCK_MAIL_REWARD, null, true);
     }
     else if (Convert.ToInt32(data.data) == 2)
     {
         userModel.GetUnlcok(Config.UNLOCK_MALL_HELP, null, true);
     }
 }
 private void Tab_Change_Check(EventContext context)
 {
     if (Convert.ToInt32(context.data) == 2)
     {
         userModel.GetUnlcok(Config.UNLOCK_SHARD, null, true);
     }
 }
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_INVITE, false);         //Tools.GetMessageById ("25032")

        fightModel = ModelManager.inst.fightModel;
        userModel  = ModelManager.inst.userModel;

        this.GetChild("n7").text = Tools.GetMessageById("25036", new string[] { "0" });
        check = this.GetChild("n6").asButton;
        check.onClick.Add(Check_Click);
        //
        btn_Close = this.GetChild("close").asButton;
        btn_Close.onClick.Add(this.Close);
        BaseMediator.emptyBg = this.GetChild("n26");
//		this.GetChild ("n1").text = Tools.GetMessageById ("25041");
//		this.GetChild ("n3").text = Tools.GetMessageById ("25042");
//		this.GetChild ("n2").text = Tools.GetMessageById ("25043");
//		this.GetChild ("n4").text = Tools.GetMessageById ("25044");
        this.GetChild("n10").text = Tools.GetMessageById("25045");

        btn_Invite = this.GetChild("n8").asButton;
        btn_Invite.onClick.Add(Invite_Click);
        btn_Invite.text = Tools.GetMessageById("25063");
//		this.GetChild ("n20").asButton.onClick.Add (BtnCheck_Click);
        list = this.GetChild("n9").asList;
        list.onChangeNum.Add(this.CheckListNum);
        list.itemRenderer = ItemRender;
        list.SetVirtual();

        //InitTopBar (new string[]{Tools.GetMessageById ("25041"),Tools.GetMessageById ("25042"),Tools.GetMessageById ("25043"),Tools.GetMessageById ("25044")});

        if (!userModel.GetUnlcok(Config.UNLOCK_GUILD))
        {
            InitTopBar(new string[] { Tools.GetMessageById("25041"), Tools.GetMessageById("25042"), "", Tools.GetMessageById("25044") });
        }
        else
        {
            InitTopBar(new string[] { Tools.GetMessageById("25041"), Tools.GetMessageById("25042"), Tools.GetMessageById("25043"), Tools.GetMessageById("25044") });
        }
        tabC1 = this.GetController("c1");
//		tabC2 = c1;
        tabC1.onChanged.Add(C1_Change);
        if (fightModel.inviteIndex != -1)
        {
            tabC1.selectedIndex    = fightModel.inviteIndex;
            fightModel.inviteIndex = -1;
        }
        else
        {
            C1_Change();
        }

        this.AddGlobalListener(MainEvent.SOCKET_CLOSE, (MainEvent e) =>
        {
            this.Close();
        });
    }
Exemple #5
0
    private void SHOW_USER(MainEvent e)
    {
        bool isOk = userModel.GetUnlcok(Config.UNLOCK_HEAD, null, true);

        if (!isOk)
        {
            return;
        }
        object[] obs = (object[])e.data;
        Dictionary <string, object> dd = new Dictionary <string, object> ();

        dd ["fuid"] = obs [1].ToString();
        NetHttp.inst.Send(NetBase.HTTP_FUSERGET, dd, (VoHttp vo) =>
        {
            if (vo.data != null)
            {
                roleModel.SetTabSelect(obs);
                roleModel.otherInfo = (Dictionary <string, object>)vo.data;
                ViewManager.inst.ShowScene <MediatorRoleRoot> ();
            }
        });
    }
Exemple #6
0
    private void Change_Click()
    {
        bool isOk = userModel.GetUnlcok(Config.UNLOCK_FREEMATCH2, null, true);

        if (!isOk)
        {
            return;
        }
        NetSocket.inst.AddListener(NetBase.SOCKET_CHANGEMODE, (VoSocket vo) =>
        {
            NetSocket.inst.RemoveListener(NetBase.SOCKET_CHANGEMODE);
            Log.debug("模式更换 - " + vo.data.ToString());
        });

        Dictionary <string, object> data = new Dictionary <string, object> ();

        data ["new_mode"] = fightModel.freeType == 1 ? 2 : 1;
        NetSocket.inst.Send(NetBase.SOCKET_CHANGEMODE, data);
    }
    private void OnRender(int index, GObject item)
    {
        GComponent start   = item.asCom.GetChild("n8").asCom;
        GLoader    change  = item.asCom.GetChild("n9").asLoader;
        GTextField num     = item.asCom.GetChild("n1").asTextField;
        GButton    head    = item.asCom.GetChild("n2").asCom.GetChild("n0").asButton;
        GTextField name    = item.asCom.GetChild("n4").asTextField;
        GTextField guild   = item.asCom.GetChild("n5").asTextField;
        GTextField lv      = item.asCom.GetChild("n2").asCom.GetChild("n2").asTextField;
        GTextField rank    = item.asCom.GetChild("n12").asCom.GetChild("n2").asTextField;
        GLoader    achieve = item.asCom.GetChild("n12").asCom.GetChild("n1").asLoader;
        GButton    mask    = item.asCom.GetChild("n11").asButton;
        GImage     bg_     = item.asCom.GetChild("itemBg_").asImage;

        bg_.visible = false;
        userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);
        //GLoader item_bg = item.asCom.GetChild("n0").asLoader;

        //        if (d1["uid"].ToString().Equals(userModel.uid))
        //        {
        //            item_bg.url = Tools.GetResourceUrl("Image:bg_zidichen7");
        //        }
        //        else
        //        {
        //            item_bg.url = Tools.GetResourceUrl("Image:bg_zidichen3");
        //        }
        //if (index % 2 == 0) {
        //	item_bg.url = "";//Tools.GetResourceUrl("Image2:n_bg_tanban6");
        //} else {
        //	item_bg.url = Tools.GetResourceUrl("Image2:n_bg_tanban6");
        //}

        bool isVisible = SetListCSS(item, listData.ToArray(), index);

        if (isVisible)
        {
            Dictionary <string, object> d1 = (Dictionary <string, object>)listData[index];
            if (d1["uid"].ToString().Equals(userModel.uid))
            {
                bg_.visible = true;
            }
            string headurl = ((Dictionary <string, object>)d1["head"])["use"].ToString();
            //			try{
            Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(headurl));
//			}catch(Exception eeee){
//				Debug.LogError (d1["uid"].ToString() +" || "+headurl);
//			}
            mask.RemoveEventListeners();
            mask.onClick.Add(() => {
                roleModel.SetTempData(listData, new int[] { list.GetFirstChildInView() });
                string fuid = d1["uid"] + "";
                string uid  = userModel.uid;
                if (fuid != uid)
                {
                    this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, d1["uid"], roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 }));
                }
                else
                {
                    ViewManager.inst.ShowText(Tools.GetMessageById("13106"));
                }
            });
            if ((int)d1["rank_diff"] == 0)
            {
                change.url = Tools.GetResourceUrl("Image2:n_icon_bianhua3");
                num.text   = "";
            }
            else if ((int)d1["rank_diff"] > 0)
            {
                change.url = Tools.GetResourceUrl("Image2:n_icon_bianhua1");
                num.text   = Tools.GetMessageColor("[0]" + d1["rank_diff"] + "[/0]", new string[] { "4db10c" });
            }
            else
            {
                change.url = Tools.GetResourceUrl("Image2:n_icon_bianhua2");
                num.text   = Tools.GetMessageColor("[0]" + d1["rank_diff"] + "[/0]", new string[] { "d23823" });
            }

            Tools.StartSetValue(start, (index + 1).ToString(), "");
            if (d1["uname"] != null)
            {
                name.text = (string)d1["uname"];
            }
            else
            {
                name.text = d1["uid"] + "";
            }

            if (d1["guild_name"] == null)
            {
                guild.text = Tools.GetMessageById("19955");
            }
            else
            {
                guild.text = d1["guild_name"] + "";
            }
            lv.text     = d1["lv"].ToString();
            achieve.url = userModel.GetRankImg((int)d1["like_num"]);
            rank.text   = d1["like_num"] + "";
        }
    }
Exemple #8
0
    public override void Init()
    {
        Create(Config.VIEW_FIGTHTDATASHOWMEMBER /*,false,Tools.GetMessageById("24242")*/);
        fightModel = ModelManager.inst.fightModel;
        if (fightModel.isOpenFromRecord)
        {
            fightDataDetails = (object[])fightModel.fightDataDetails[fightModel.recordIndex];
        }
        else
        {
            fightDataDetails = (object[])fightModel.fightDataDetails;
        }

        roleModel = ModelManager.inst.roleModel;
        dataAll   = (object[])fightDataDetails[3];
        myData    = (object[])dataAll[Convert.ToInt32(fightModel.openIndex)];
        GComponent comPhoto     = this.GetChild("n2").asCom;
        GTextField uname        = this.GetChild("n3").asTextField;
        GTextField guildName    = this.GetChild("n4").asTextField;
        GComponent comScoreType = this.GetChild("n7").asCom;
        GLoader    scoreTypeBG  = comScoreType.GetChild("n1").asLoader;
        GTextField scoreTypeNum = comScoreType.GetChild("n4").asTextField;
        GGroup     group        = GetChild("n25").asGroup;

        GList   list           = this.GetChild("n22").asList;
        GButton dreamAttention = this.GetChild("n23").asButton;

        dreamAttention.text = Tools.GetMessageById("13147");
        dreamAttention.onClick.Add(() => {
            if ((int)myData[0] <= 0)
            {
                ViewManager.inst.ShowText(Tools.GetMessageById("24228"));
            }
            else
            {
                Dictionary <string, object> data1 = new Dictionary <string, object>();
                data1["fuid"] = myData[0];
                NetHttp.inst.Send(NetBase.HTTP_FOLLOW, data1, (VoHttp vo) =>
                {
                    if ((bool)vo.data == true)
                    {
                        ModelRole.attentionFight.Add(myData[0].ToString());

                        //if ((int)fightDataDetails[0] == 1)
                        //{
                        //    myData[10] = true;
                        //}
                        //else
                        //{
                        //    myData[13] = true;
                        //}


                        ViewManager.inst.ShowText(Tools.GetMessageById("13045"));
                        dreamAttention.visible = false;
                    }
                    else
                    {
                        ViewManager.inst.ShowText(Tools.GetMessageById("13120"));
                    }
                });
            }
        });
        object[] fightDta = (object[])myData[5];
        deck = (object[])myData[4];

        userModel = ModelManager.inst.userModel;
        userModel.GetUnlcok(Config.UNLOCK_GUILD, guildName);

        //                [0]	-82	System.Object
        //[1]	"勇敢的龙骑士"	System.Object
        //[2]	9	System.Object
        //[3]	5	System.Object
        //[4] System.Object[8] System.Object
        //[5] System.Object[6] System.Object
        // [6] false	System.Object
        // [7] true	System.Object
        //[8] Count= 1 System.Object
        // [9] null	System.Object
        // [10]    null	System.Object

        list.itemRenderer = OnRender;
        list.numItems     = deck.Length;
        if (!Tools.IsNullEmpty(myData[1]))
        {
            uname.text = myData[1].ToString();
        }
        else
        {
            uname.text = myData[0].ToString();
        }
        comPhoto.GetChild("n2").asTextField.text = myData[2].ToString();
        GButton head = comPhoto.GetChild("n0").asButton;

        head.onClick.Add(OpenUser);

        if ((int)fightDataDetails[0] == 1)
        {
            //comScoreType.visible = false;
            group.visible = false;
            if ((int)myData[0] > 0)
            {
                Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(((Dictionary <string, object>)myData[6])["use"].ToString()));
            }
            else
            {
                Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(myData[1].ToString(), false, true));
            }
            if (!Tools.IsNullEmpty(myData[8]))
            {
                guildName.text = myData[8].ToString();
            }
            else
            {
                guildName.text = Tools.GetMessageById("19955");
            }
            scoreTypeNum.text = fightModel.recordIndex.ToString();
            Debug.Log((bool)myData[10]);
            if (!(bool)myData[10])//是否关注
            {
                if (!(bool)myData[11])
                {
                    if ((bool)myData[9])
                    {
                        if (myData[0].ToString().Equals(userModel.uid))
                        {
                            dreamAttention.visible = false;
                        }
                        else
                        {
                            if (ModelRole.attentionFight.Contains(myData[0].ToString()))
                            {
                                dreamAttention.visible = false;
                            }
                            else
                            {
                                dreamAttention.visible = true;
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if ((bool)myData[7])
            {
                //comScoreType.visible = true;
                group.visible = true;

                //scoreTypeBG.url = Tools.GetResourceUrl("Image2:n_icon_paiming0");
                //scoreTypeNum.text = Tools.GetMessageById("24223");
                Tools.GetResourceUrlForMVP(scoreTypeBG, "mvp");
            }
            else
            {
                //comScoreType.visible = false;
                group.visible = false;
            }

            if ((int)myData[0] > 0)
            {
                Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(((Dictionary <string, object>)myData[9])["use"].ToString()));
            }
            else
            {
                Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(myData[1].ToString(), false, true));
            }
            if (!Tools.IsNullEmpty(myData[11]))
            {
                guildName.text = myData[11].ToString();
            }
            else
            {
                guildName.text = Tools.GetMessageById("19955");
            }
            Debug.Log((bool)myData[13]);
            if (!(bool)myData[13])//是否关注
            {
                if (!(bool)myData[14])
                {
                    if ((bool)myData[12])
                    {
                        if (myData[0].ToString().Equals(userModel.uid))
                        {
                            dreamAttention.visible = false;
                        }
                        else
                        {
                            if (ModelRole.attentionFight.Contains(myData[0].ToString()))
                            {
                                dreamAttention.visible = false;
                            }
                            else
                            {
                                dreamAttention.visible = true;
                            }
                        }
                    }
                }
            }
        }
    }
    private void SearchRender(int index, GObject item)
    {
        Dictionary <string, object> dc = (Dictionary <string, object>)listData[index];
        GButton    photo          = item.asCom.GetChild("n1").asCom.GetChild("n0").asButton;
        GTextField name           = item.asCom.GetChild("n3").asTextField;
        GTextField guild          = item.asCom.GetChild("n4").asTextField;
        GLoader    achieve        = item.asCom.GetChild("n21").asCom.GetChild("n1").asLoader;
        GTextField status         = item.asCom.GetChild("n9").asTextField;
        GButton    mask_btn       = item.asCom.GetChild("n8").asButton;
        GButton    btn_attention  = item.asCom.GetChild("n7").asButton;
        GTextField attention_text = btn_attention.GetChild("title").asTextField;
        GLoader    btn_image      = btn_attention.asCom.GetChild("n1").asLoader;
        //btn_image.visible = true;
        GObject    reletion  = item.asCom.GetChild("n2");
        GTextField rankScore = item.asCom.GetChild("n21").asCom.GetChild("n2").asTextField;
        GButton    more      = item.asCom.GetChild("n10").asButton;
        GTextField lv        = item.asCom.GetChild("n1").asCom.GetChild("n2").asTextField;
        GLoader    bg        = item.asCom.GetChild("n32").asLoader;

        bg.visible        = false;
        more.visible      = false;
        rankScore.visible = true;
        reletion.visible  = false;
        userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);

        btn_attention.RemoveEventListeners();
        btn_attention.onClick.Add(() => {
            string uid_ = dc["uid"] + "";
            if (!uid_.Equals(userModel.uid))
            {
                Dictionary <string, object> dd = new Dictionary <string, object>();
                dd["fuid"] = dc["uid"];
                NetHttp.inst.Send(NetBase.HTTP_FOLLOW, dd, (VoHttp vo) =>
                {
                    if ((bool)vo.data == true)
                    {
                        roleModel.AddAttentionFight(dc["uid"].ToString());
                        ((Dictionary <string, object>)listData[index])["if_friend"] = true;
                        Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0);
                        btn_attention.touchable = false;
                        //                        btn_image.url = Tools.GetResourceUrl("Image:btn_page3");
                        btn_attention.RemoveEventListeners();
                    }
                    else
                    {
                        ViewManager.inst.ShowText(Tools.GetMessageById("13120"));
                    }
                });
            }
            else
            {
                ViewManager.inst.ShowText(Tools.GetMessageById("13106"));
            }
        });
        if ((bool)dc["if_black"])
        {//是否拉黑
            Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textShieldd, fontSize, textBtnColor, "", 0);
            type = 1;
            btn_attention.touchable = false;
            //            btn_image.url = Tools.GetResourceUrl("Image:btn_page3");
        }
        else
        if ((bool)dc["if_follow"])
        {
            //是否已关注
            Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0);
            type = 2;
            btn_attention.touchable = false;
            //            btn_image.url = Tools.GetResourceUrl("Image:btn_page3");
        }
        else
        {
            Tools.SetButtonBgAndColor(btn_attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor);
            btn_attention.touchable = true;
            //            btn_image.url = Tools.GetResourceUrl("Image:btn_9");
        }

        achieve.url = userModel.GetRankImg((int)dc["rank_score"]);
        mask_btn.RemoveEventListeners();
        mask_btn.onClick.Add(() => {
            roleModel.SetTempData(listData, new int[] { index });
            string uid_ = dc["uid"] + "";
            if (!uid_.Equals(userModel.uid))
            {
                this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid_, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 }));
            }
            else
            {
                ViewManager.inst.ShowText(Tools.GetMessageById("13106"));
            }
        });
        lv.text = dc["lv"].ToString();
        string uname = dc["uname"] + "";

        if (uname.Equals(""))
        {
            name.text = dc["uid"] + "";
        }
        else
        {
            name.text = uname;
        }
        string dc_ = (string)dc["head_use"];

        Tools.SetLoaderButtonUrl(photo, ModelUser.GetHeadUrl(dc_));
        if (dc["guild_name"] == null)
        {
            guild.text = Tools.GetMessageById("19955");
        }
        else
        {
            guild.text = dc["guild_name"] + "";
        }
        if (dc.ContainsKey("status"))
        {
            switch ((int)dc["status"])
            {
            case 0:    //离线
                //					bg.url = Tools.GetResourceUrl("Image2:n_bg_zt3");
                status.text = Tools.GetMessageById("19957");
                Tools.SetRootTabTitleStrokeColor(status, "#646EA9", 1);
                break;

            case 1:    //在线
                //					bg.url = Tools.GetResourceUrl("Image2:n_bg_zt1");
                status.text = Tools.GetMessageById("19958");
                Tools.SetRootTabTitleStrokeColor(status, "#63A969", 1);
                break;

            case 2:    //ing
                //					bg.url = Tools.GetResourceUrl("Image2:n_bg_zt2");
                Tools.SetRootTabTitleStrokeColor(status, "#A55A76", 1);
                status.text = Tools.GetMessageById("19959");
                break;
            }
        }
        rankScore.text = dc["rank_score"] + "";
    }
    private void OnRenderer(int index, GObject item)
    {
        GButton btn = item.asCom.GetChild("n11").asButton;

        //Tools.Btn_Change(btn, "Image:btn_10", "13018");
        btn.touchable = false;
        //}
//            else
//            {
//                btnAtr.selectedIndex = 0;
//                ButtonChange();
//    //Tools.Btn_Change(btn, "Image:btn_16", "13013");
//}
//            if (info.ContainsKey("is_black")) {
//                if ((bool)info["is_black"])
//                {//是否拉黑
//                    //Tools.Btn_Change(btn, "Image:btn_10", "13032");



        object[] data = (object[])listData[index];
        Dictionary <string, object> info = (Dictionary <string, object>)data[2]; //userinfo  【1】uid

        object[]   fightData      = (object[])data[1];                           //战斗数据
        GTextField lv             = item.asCom.GetChild("n3").asCom.GetChild("n2").asTextField;
        GGroup     group          = item.asCom.GetChild("n3").asCom.GetChild("n3").asGroup;
        GComponent start          = item.asCom.GetChild("n8").asCom;
        GButton    head           = item.asCom.GetChild("n3").asCom.GetChild("n0").asButton;
        GTextField uname          = item.asCom.GetChild("n4").asTextField;
        GTextField guild          = item.asCom.GetChild("n10").asTextField;
        GTextField core           = item.asCom.GetChild("n7").asTextField;
        GTextField core_type      = item.asCom.GetChild("n5").asTextField;
        GLoader    fight_group    = item.asCom.GetChild("n41").asLoader;
        GTextField group_name     = item.asCom.GetChild("n42").asTextField;
        GComponent com            = item.asCom.GetChild("n35").asCom;
        GComponent start_         = item.asCom.GetChild("n40").asCom;
        GButton    dreamAttention = item.asCom.GetChild("n45").asButton;

        dreamAttention.text = Tools.GetMessageById("13147");
        dreamAttention.onClick.Add(() => {
            if ((int)data[0] <= 0)
            {
                ViewManager.inst.ShowText(Tools.GetMessageById("24228"));
            }
            else
            {
                Dictionary <string, object> data1 = new Dictionary <string, object>();
                data1["fuid"] = data[0];
                NetHttp.inst.Send(NetBase.HTTP_FOLLOW, data1, (VoHttp vo) =>
                {
                    if ((bool)vo.data == true)
                    {
                        roleModel.AddAttentionFight(data[0].ToString());
                        Dictionary <string, object> dataMy = (Dictionary <string, object>)data[2];
                        dataMy["is_friend"] = true;
                        ViewManager.inst.ShowText(Tools.GetMessageById("13045"));
                        //Tools.SetButtonBgAndColor(btn, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0);

                        //btn.touchable = false;
                        dreamAttention.visible = false;
                    }
                    else
                    {
                        ViewManager.inst.ShowText(Tools.GetMessageById("13120"));
                    }
                });
            }
        });
        //GGraph icon_start = item.asCom.GetChild("n31").asGraph;

        userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);


        if (info["lv"] != null)
        {
            lv.text = info["lv"].ToString();
        }
        if (info["name"] != null)
        {
            uname.text = info["name"].ToString();
        }
        else
        {
            uname.text = info["uid"].ToString();
        }
        if (info["guild_name"] != null)
        {
            if (info["guild_name"].ToString().Equals(""))
            {
                guild.text = Tools.GetMessageById("19955");
            }
            else
            {
                guild.text = info["guild_name"].ToString();
            }
        }
        else
        {
            guild.text = Tools.GetMessageById("19955");
        }


        object[]      type          = null;
        List <object> userFightData = new List <object>();

        if (data[0].ToString().Equals(userModel.uid))
        {
            mydata = (object[])fightModel.fightData["my_data"];
            List <object> userData = fightModel.GetUserData(data_all, mydata, statementType);
            for (int i = 0; i < 5; i++)
            {
                Dictionary <string, object> dd = new Dictionary <string, object>();
                dd["data"]  = mydata[i];
                dd["rank"]  = (int)userData[i];
                dd["index"] = i;
                userFightData.Insert(i, dd);
            }
            Tools.Sort(userFightData, new string[] { "rank:int:0" });
            Dictionary <string, object> my = (Dictionary <string, object>)userFightData[0];
            type = new object[] { my["index"], my["data"] };
        }
        else
        {
            type = fightModel.GetUserMaxData(index, data_all, info["uid"].ToString(), fightDataTypeChange);
        }


        if (statementType.Equals(ModelFight.FIGHT_MATCH) || statementType.Equals(ModelFight.FIGHT_FREEMATCH1))
        {
            fight_group.visible = false;
            group_name.visible  = false;
            start.visible       = true;
            start_.visible      = false;
            com.visible         = false;


            Tools.StartSetValue(start, (index + 1).ToString(), ((int)myRank["1"] + 1).ToString(), info["uid"].ToString());
            //if (index == 0)
            //{
            //    GameObject g = EffectManager.inst.AddPrefab(Config.EFFECT_LIGHT, icon_start);
            //    GameObjectScaler.Scale(g, 0.8f);
            //    g.transform.localScale *= 0.8f;
            //}
        }
        else
        {
            fight_group.visible = true;
            group_name.visible  = true;
            start.visible       = false;
            start_.visible      = true;
            if (statementType.Equals(ModelFight.FIGHT_FREEMATCH2))
            {
                com.visible = false;

                if ((int)info["rankLevel"] >= 0 && (int)info["rankLevel"] <= 3)
                {
                    fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui2");
                    Tools.SetRootTabTitleStrokeColor(group_name, "#424F9E", 2);
                    group_name.text = Tools.GetMessageById("24229");
                }
                else
                {
                    fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui1");
                    Tools.SetRootTabTitleStrokeColor(group_name, "#9A42AA", 2);
                    group_name.text = Tools.GetMessageById("24230");
                }
            }
            else
            {
                com.visible = true;
                GLoader    rankIcon  = com.GetChild("n1").asLoader;
                GTextField rankScore = com.GetChild("n2").asTextField;
                rankIcon.url   = userModel.GetRankImg((int)info["rank_score"]);
                rankScore.text = info["rank_score"].ToString();

                Dictionary <string, object> userInfo = (Dictionary <string, object>)user[2];

                if ((int)userInfo["rankLevel"] <= 4)
                {
                    if ((int)info["rankLevel"] >= 0 && (int)info["rankLevel"] <= 3)
                    {
                        fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui2");
                        Tools.SetRootTabTitleStrokeColor(group_name, "#424F9E", 2);
                        group_name.text = Tools.GetMessageById("24229");
                    }
                    else
                    {
                        fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui1");
                        Tools.SetRootTabTitleStrokeColor(group_name, "#9A42AA", 2);
                        group_name.text = Tools.GetMessageById("24230");
                    }
                }
                else
                {
                    if ((int)info["rankLevel"] >= 0 && (int)info["rankLevel"] <= 3)
                    {
                        fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui1");
                        Tools.SetRootTabTitleStrokeColor(group_name, "#9A42AA", 2);
                        group_name.text = Tools.GetMessageById("24230");
                    }
                    else
                    {
                        fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui2");
                        Tools.SetRootTabTitleStrokeColor(group_name, "#424F9E", 2);
                        group_name.text = Tools.GetMessageById("24229");
                    }
                }
            }

            if ((bool)info["is_mvp"])
            {
                //Tools.StartSetValue(start_, Tools.GetMessageById("24223"));
                Tools.GetResourceUrlForMVP(start_.GetChild("n1").asLoader, "mvp");
            }
            else
            {
                start_.visible = false;
            }
        }


        if (index == 0)
        {
            core_type.text = fight_tag["0"].ToString();
            core.text      = fightData[0].ToString();
            fightDataTypeChange.Remove(0);
        }
        else
        {
            if (!fight_tag[type[0].ToString()].ToString().Equals(fight_tag["5"].ToString()))
            {
                core_type.text = fight_tag[type[0].ToString()].ToString();
                core.text      = fightData[Convert.ToInt32(type[0])].ToString();
            }
            else
            {
                core_type.text = fight_tag["0"].ToString();
                core.text      = fightData[0].ToString();
            }
            fightDataTypeChange.Remove((int)type[0]);
        }
        //平均分、是否是新记录
        GComponent obj         = item.asCom.GetChild("n38").asCom;
        GImage     new_mark_bg = obj.GetChild("n0").asImage;
        GTextField new_mark    = obj.GetChild("n1").asTextField;

        obj.visible = false;
        if (!statementType.Equals(ModelFight.FIGHT_FREEMATCH1) && !statementType.Equals(ModelFight.FIGHT_FREEMATCH2))
        {
            if (data[0].ToString().Equals(userModel.uid))
            {
                if (type.Length != 0)
                {
                    object[] userType = (object[])myData[Convert.ToUInt32(type[0])];
                    if ((int)userType[2] != 0)
                    {
                        obj.visible   = true;
                        new_mark.text = Tools.GetMessageById("24218");
                    }
                }
            }
            group.visible = true;
            if ((int)info["uid"] > 0)
            {
                if (info["head"] != null)
                {
                    Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(((Dictionary <string, object>)info["head"])["use"].ToString()));
                }
            }
            else
            {
                Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(info["name"].ToString(), false, true));
            }
        }
        else
        {
            group.visible = false;
            if ((int)info["uid"] > 0)
            {
                if (info["head"] != null)
                {
                    Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(((Dictionary <string, object>)info["head"])["use"].ToString()));
                }
            }
            else
            {
                Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl("icon_diannao"));
            }
        }
        btn.touchable = true;
        btn.RemoveEventListeners();
        GLoader bg1 = item.asCom.GetChild("n2").asLoader;

        bg1.url = Tools.GetResourceUrl("Image2:n_bg_tanban1");
        //GLoader bg = item.asCom.GetChild("n39").asLoader;



        if (data[0].ToString().Equals(userModel.uid))
        {
            Tools.SetButtonBgAndColor(btn, btnBgUp, "24216", "", textBtnColor, textBtnStrokeColor);
            //bg.visible = true;
            btn.visible = true;
            btn.onClick.Add(() => {
                ViewManager.inst.ShowScene <MediatorUserDataStatemnet>();
            });
        }
        else
        {
            Debug.Log(info["uid"] + "is_friend:" + info["is_friend"] + " ..........request_sign" + (bool)info["request_sign"] + ".................is_black" + (bool)info["is_black"]);
            //bg.visible = false;
            if ((bool)info["is_friend"])
            {
                //Tools.SetButtonBgAndColor(btn, btnBgDo, textAttentiond, fontSize, textBtnColor, "",0);
                //btn.touchable = false;


                if ((bool)info["request_sign"])
                {
                    dreamAttention.visible = false;
                }
            }
            else
            {
                if (info.ContainsKey("is_black"))
                {
                    if (!(bool)info["is_black"])
                    {
                        if ((bool)info["request_sign"])
                        {
                            dreamAttention.visible = true;
                        }
                    }
                    else
                    {
                        //Tools.SetButtonBgAndColor(btn, btnBgDo, textShieldd, fontSize, textBtnColor, "",0);
                        //btn.touchable = false;
                    }
                }


                //Tools.SetButtonBgAndColor(btn, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor);
            }

            //btn.onClick.Add(() =>
            //{


            //});
        }
    }
    private void OnRendere(int index, GObject item)
    {
        GComponent g         = item.asCom;
        GObject    reletion  = g.GetChild("n3");
        GButton    head      = g.GetChild("n2").asCom.GetChild("n0").asButton;
        GTextField name      = g.GetChild("n4").asTextField;
        GTextField guild     = g.GetChild("n5").asTextField;
        GLoader    achieve   = g.GetChild("n29").asCom.GetChild("n1").asLoader;
        GTextField rankScore = g.GetChild("n29").asCom.GetChild("n2").asTextField;
        GTextField msg       = g.GetChild("n6").asTextField;
        GTextField status    = g.GetChild("n7").asTextField;
        GButton    mask_btn  = g.GetChild("n9").asButton;
        GButton    btn_      = g.GetChild("n0").asButton;

        btn_.visible = false;
        GLoader bg = g.GetChild("n32").asLoader;

        userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);

        bool isVisible = SetListCSS(item, listData.ToArray(), index);

        if (isVisible)
        {
            bg.visible       = false;
            reletion.visible = false;

            GTextField lv = g.GetChild("n2").asCom.GetChild("n2").asTextField;
            Dictionary <string, object> dc = (Dictionary <string, object>)listData[index];
            int fans_count = userModel.Get_NoticeState(ModelUser.RED_FANS);
            if ((bool)dc["is_new"])
            {
                userModel.Add_Notice(g, new UnityEngine.Vector2(72, -1), 0, false);
            }
            else
            {
                userModel.Remove_Notice(g);
            }
            achieve.url = userModel.GetRankImg((int)dc["rank_score"]);
            mask_btn.RemoveEventListeners();
            mask_btn.onClick.Add(() => {
                roleModel.SetTempData(null, new int[] { m_PageIndexS, m_PageIndex });
                string uid = dc["uid"] + "";
                if (!uid.Equals(userModel.uid))
                {
                    this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 }));
                }
                else
                {
                    ViewManager.inst.ShowText(Tools.GetMessageById("13106"));
                }
            });
            lv.text = dc["lv"].ToString();
            string uname = dc["uname"] + "";
            if (uname.Equals(""))
            {
                name.text = dc["uid"] + "";
            }
            else
            {
                name.text = uname;
            }
            string dc_ = (string)dc["head_use"];
            Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(dc_));
            if (dc["guild_name"] == null)
            {
                guild.text = Tools.GetMessageById("19955");
            }
            else
            {
                guild.text = dc["guild_name"] + "";
            }
            Dictionary <string, object> dynamic = (Dictionary <string, object>)dc["dynamic"];
            if (dynamic.Count != 0)
            {
                Tools.DataTimeFormat(msg, (DateTime)dynamic["time"], 0);
                switch (dynamic["type"].ToString())
                {
                case "lv_up":
                    msg.text = Tools.GetMessageById("19937", new object[] { msg.text, dynamic["lv"].ToString() });
                    break;

                case "elv_up":
                    msg.text = Tools.GetMessageById("19938", new object[] { msg.text, Tools.GetEffortName((int)dynamic["elv"]) });
                    break;

                case "match_team":
                    if ((bool)dynamic["if_win"])
                    {
                        if ((bool)dynamic["if_mvp"])
                        {
                            msg.text = Tools.GetMessageById("19939", new object[] { msg.text });
                        }
                        else
                        {
                            msg.text = Tools.GetMessageById("19940", new object[] { msg.text });
                        }
                    }
                    else
                    {
                        if ((bool)dynamic["if_mvp"])
                        {
                            msg.text = Tools.GetMessageById("19941", new object[] { msg.text });
                        }
                        else
                        {
                            msg.text = Tools.GetMessageById("19942", new object[] { msg.text });
                        }
                    }

                    break;

                case "match":
                    msg.text = Tools.GetMessageById("19943", new object[] { msg.text, dynamic["sort"].ToString(), dynamic["kill_num"].ToString() });
                    break;

                case "up_head":
                    msg.text = Tools.GetMessageById("19970", new object[] { msg.text });
                    break;

                case "choose_head":
                    msg.text = Tools.GetMessageById("19971", new object[] { msg.text });
                    break;
                }
            }
            else
            {
                msg.text = "";
            }
            if (dc.ContainsKey("status"))
            {
                switch ((int)dc["status"])
                {
                case 0:
                    //					bg.url = Tools.GetResourceUrl("Image2:n_bg_zt3");
                    status.text = Tools.GetMessageById("19957");
                    Tools.SetRootTabTitleStrokeColor(status, "#646EA9", 1);
                    break;

                case 1:
                    //					bg.url = Tools.GetResourceUrl("Image2:n_bg_zt1");
                    status.text = Tools.GetMessageById("19958");
                    Tools.SetRootTabTitleStrokeColor(status, "#63A969", 1);
                    break;

                case 2:
                    //					bg.url = Tools.GetResourceUrl("Image2:n_bg_zt2");
                    Tools.SetRootTabTitleStrokeColor(status, "#A55A76", 1);
                    status.text = Tools.GetMessageById("19959");
                    break;
                }
            }
            rankScore.text = dc["rank_score"] + "";
        }
    }
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_ROLEIDEX);
        userModel = ModelManager.inst.userModel;
        roleModel = ModelManager.inst.roleModel;



        photoCom  = GetChild("n112").asCom;
        photoHead = photoCom.GetChild("n0").asButton;
        lv        = photoCom.GetChild("n2").asTextField;
        sex       = this.GetChild("n26").asLoader;
        name      = this.GetChild("n10").asTextField;
        story     = this.GetChild("n12").asTextInput;
        //image_hurt_ = this.GetChild ("n103").asImage;

        story.promptText = Tools.GetMessageById("13107") + Tools.GetMessageById("13105");
        loveNum          = this.GetChild("n14").asTextField;
        fansNum          = this.GetChild("n16").asTextField;
        attenNum         = this.GetChild("n18").asTextField;
        //lv = this.GetChild ("n76").asTextField;
        like_list       = this.GetChild("n21").asList;
        like            = this.GetChild("n25").asButton;
        graph           = this.GetChild("n105").asGraph;
        like_bg         = like.asCom.GetChild("n2").asImage;
        like_bg.visible = false;
        like.onClick.Add(Like);
        more = this.GetChild("n20").asButton;
        more.onClick.Add(More);
        more.text        = Tools.GetMessageById("13081");
        attention        = this.GetChild("n22").asButton;
        attention.grayed = false;
        attention.onClick.Add(Attention);
        attentionAtr      = attention.GetController("c1");
        attention.visible = false;
        watch             = this.GetChild("n0").asButton;
        //watch.text = Tools.GetMessageById ("13014");
        watch.visible = false;
        watch.onClick.Add(Watch);
        shield = this.GetChild("n23").asButton;
        shield.onClick.Add(Shield);
        shield.visible = false;
        editImage      = GetChild("n110").asImage;
        btnMicro       = GetChild("n117").asButton;
        btnMicro.onClick.Add(BtnMicro);
        btnOpenMicro = GetChild("n121").asButton;
        btnOpenMicro.onClick.Add(BtnOpenMicro);

        isBtnMicro = userModel.GetUnlcok(Config.UNLOCK_PAY_MICRO, btnMicro);

        GetChild("n15").asTextField.text = Tools.GetMessageById("13011");
        GetChild("n17").asTextField.text = Tools.GetMessageById("13012");
        GetChild("n19").asTextField.text = Tools.GetMessageById("13013");
        uid = GetChild("n116").asTextField;


        //save_img = this.GetChild ("n30").asButton;
        //save_img.touchable = false;
        //save_img.visible = true;
        //save_btn = this.GetChild ("n31").asButton;
        //save_btn.visible = false;
        //save_btn.text = Tools.GetMessageById ("13017");
        //save_btn.RemoveEventListeners ();
        //save_btn.onClick.Add (() =>
        //{
        //	Save ();
        //});
        //guildName = this.GetChild ("n32").asTextField;
        //openGuild = this.GetChild ("n102").asButton;
        //openGuild.GetChild ("title").asTextField.textFormat.size = 28;
        //openGuild.text = Tools.GetMessageById ("13072");
        //openGuild.onClick.Add(OpenGuild);
        guild = this.GetChild("n111").asButton;
        guild.onClick.Add(Guild);
        guildAtr            = guild.GetController("c1");
        guild.visible       = false;
        btnBgUp             = "n_icon_guanzhu";
        btnBgDo             = "n_icon_guanzhu_";
        btnBgDo_            = "n_icon_guanzhu_2";
        textAttention       = "13013";
        textAttentiond      = "13018";
        textBtnColor        = "FFFFFF";
        textBtnStrokeColor  = "#38A9E3";
        textBtnStrokeColor1 = "#666666";
        textBtnStrokeColor2 = "#2FAC50";
        textShield          = "13016";
        textShieldd         = "13032";
        textGuild           = "19908";
        textGuildd          = "19955";
        fontSize            = "";
        InitDate();
        Tools.SetButtonBgAndColor(watch, btnBgUp, "13014", fontSize, textBtnColor, textBtnStrokeColor);
        this.AddGlobalListener(MainEvent.ROLE_UPDATE, viewUpdate);
        Log.debug(like.x + " - " + this.x);
        if (!userModel.IsLove())
        {
            if (roleModel.otherInfo["uid"].ToString() != userModel.uid)
            {
                if (GuideManager.inst.Check("101:0"))
                {
                    GuideManager.inst.Show(this);
                }
            }
        }
    }
Exemple #13
0
    private void SearchRander(int index, GObject item)
    {
        GComponent comPhoto       = item.asCom.GetChild("n1").asCom;
        GButton    photo          = comPhoto.GetChild("n0").asButton;
        GTextField name           = item.asCom.GetChild("n3").asTextField;
        GTextField guild          = item.asCom.GetChild("n4").asTextField;
        GObject    rank           = item.asCom.GetChild("n21");
        GTextField rankScore      = rank.asCom.GetChild("n2").asTextField;
        GLoader    achieve        = rank.asCom.GetChild("n1").asLoader;
        GTextField status         = item.asCom.GetChild("n9").asTextField;
        GButton    mask_btn       = item.asCom.GetChild("n8").asButton;
        GButton    btn_attention  = item.asCom.GetChild("n7").asButton;
        GTextField attention_text = btn_attention.GetChild("title").asTextField;
        GLoader    btn_image      = btn_attention.asCom.GetChild("n1").asLoader;
        GObject    reletion       = item.asCom.GetChild("n2");
        GButton    more           = item.asCom.GetChild("n10").asButton;
        GTextField lv             = item.asCom.GetChild("n1").asCom.GetChild("n2").asTextField;
        GGroup     itemBtn        = item.asCom.GetChild("item").asGroup;

        //GImage bg = item.asCom.GetChild("n0").asImage;
        more.text = Tools.GetMessageById("13078");


        bool isVisible = SetListCSS(item, listData.ToArray(), index);

        if (isVisible)
        {
            Dictionary <string, object> dc = (Dictionary <string, object>)listData[index];

            more.visible      = false;
            rankScore.visible = true;
            reletion.visible  = false;
            rank.visible      = true;
            int uid = (int)dc["uid"];
            if (uid == -1)
            {
                //            bg.visible = false;
                lv.visible       = false;
                comPhoto.visible = false;
                name.visible     = false;
                guild.visible    = false;
                achieve.visible  = false;
                status.visible   = false;
                //mask_btn.visible = false;
                more.visible          = true;
                btn_attention.visible = false;
                rank.visible          = false;
                more.onClick.Add(() =>
                {
                    if (Convert.ToInt32(dc["type"]) == 1)
                    {
                        ViewManager.inst.ShowText(Tools.GetMessageById("13043"));
                    }
                    else
                    {
                        GetNearData(1, item);
                    }
                });
            }
            else
            {
                lv.visible       = true;
                comPhoto.visible = true;
                name.visible     = true;
                guild.visible    = true;
                userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);
                achieve.visible = true;
                status.visible  = true;
                //mask_btn.visible = true;
                btn_attention.visible = true;
                more.visible          = false;
                btn_attention.RemoveEventListeners();
                btn_attention.onClick.Add(() =>
                {
                    //关注的实现
                    Dictionary <string, object> dd = new Dictionary <string, object>();
                    dd["fuid"] = dc["uid"];
                    NetHttp.inst.Send(NetBase.HTTP_FOLLOW, dd, (VoHttp vo) =>
                    {
                        if ((bool)vo.data == true)
                        {
                            roleModel.AddAttentionFight(dc["uid"].ToString());
                            //ViewManager.inst.ShowText(Tools.GetMessageById("13045"));
                            ((Dictionary <string, object>)listData[index])["if_follow"] = true;
                            Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0);
                            btn_attention.touchable = false;
                            //                        btn_image.url = Tools.GetResourceUrl("Image:btn_page3");
                            btn_attention.RemoveEventListeners();
                        }
                        else
                        {
                            ViewManager.inst.ShowText(Tools.GetMessageById("13120"));
                        }
                    });
                });
                if ((bool)dc["if_black"])
                {//是否拉黑
                    Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textShieldd, fontSize, textBtnColor, "", 0);

                    type = 1;
                    btn_attention.touchable = false;
                }
                else if ((bool)dc["if_follow"])
                {
                    Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0);

                    type = 2;
                    btn_attention.touchable = false;
                    //                btn_image.url = Tools.GetResourceUrl("Image:btn_page3");
                }
                else
                {
                    Tools.SetButtonBgAndColor(btn_attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor);

                    btn_attention.touchable = true;
                }
                achieve.url = userModel.GetRankImg((int)dc["rank_score"]);
                status.text = Tools.GetNearDistance((int)dc["dis"]);
                mask_btn.RemoveEventListeners();
                mask_btn.onClick.Add(() =>
                {
                    if (!more.visible)
                    {
                        roleModel.SetTempData(listData, new int[] { list.GetFirstChildInView(), tag_n, dataPreNum });
                        string uid_ = dc["uid"] + "";
                        if (!uid_.Equals(userModel.uid))
                        {
                            this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid_, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 }));
                        }
                        else
                        {
                            ViewManager.inst.ShowText(Tools.GetMessageById("13106"));
                        }
                    }
                });

                lv.text = dc["lv"].ToString();

                string uname = dc["uname"] + "";
                if (uname.Equals(""))
                {
                    name.text = dc["uid"] + "";
                }
                else
                {
                    name.text = uname;
                }
                string dc_ = (string)dc["head_use"];
                Tools.SetLoaderButtonUrl(photo, ModelUser.GetHeadUrl(dc_));
                if (dc["guild_name"] == null)
                {
                    guild.text = Tools.GetMessageById("19955");
                }
                else
                {
                    guild.text = dc["guild_name"] + "";
                }
                rankScore.text = dc["rank_score"] + "";
            }
        }
        else
        {
            btn_attention.visible = false;
        }
    }
 private void ShareOnclick(EventContext context)
 {
     userModel.GetUnlcok(Config.UNLOCK_SHARD, null, true);
     ViewManager.inst.ShowView <MediatorFightDataShare>();
 }
    private void FindObject()
    {
        GButton btn = this.GetChild("n100").asButton;

        btn.text = Tools.GetMessageById("13132");
        GButton callBack = this.GetChild("n104").asButton;

        callBack.onClick.Add(CallBack);
        title1    = this.GetChild("n2").asTextField;
        title2    = this.GetChild("n13").asTextField;
        text1     = this.GetChild("n10").asTextField;
        text2     = this.GetChild("n11").asTextField;
        text3     = this.GetChild("n14").asTextField;
        text4     = this.GetChild("n15").asTextField;
        url       = this.GetChild("n8").asTextInput;
        btn_Copy  = this.GetChild("n110").asButton;
        erBg      = this.GetChild("n3").asLoader;
        btn_share = this.GetChild("n5").asButton;
        tabShare  = GetChild("bar0").asButton;
        if (shareModel.isShareRed())
        {
            userModel.Add_Notice(btn_share, new Vector2(145, -10));
        }
        else
        {
            userModel.Remove_Notice(btn_share);
        }

        btn_yaoqing = this.GetChild("n12").asButton;
        btn_yaoqing.GetChild("title").asTextField.textFormat.size = 25;
        //fenGeXian = this.GetChild("n9").asImage;
        list            = GetChild("n60").asList;
        num1            = GetChild("n66").asTextField;
        num2            = GetChild("n64").asTextField;
        tabC1           = GetController("c1");
        textContext     = this.GetChild("n90").asTextField;
        input           = this.GetChild("n0").asCom.GetChild("n1").asTextInput;
        btn_ok          = this.GetChild("n84").asButton;
        image           = this.GetChild("n99").asImage;
        btn_weixin      = this.GetChild("n91").asButton;
        weiChatGroup    = this.GetChild("n106").asGroup;
        btn_weixin.text = "";
        bool ok = userModel.GetUnlcok(Config.UNLOCK_WEICHAT, weiChatGroup);

        if (!ok)
        {
            btn_ok.x = 527;
        }
        GetChild("n72").asTextField.text = Tools.GetMessageById("13136");
        btn_ok.text = Tools.GetMessageById("31002");

        //GetChild("n105").asTextField.text=Tools.GetMessageById("13145",new string[] { userModel.uid});

        InitTopBar(new string[] {
            Tools.GetMessageById("13134"),
            Tools.GetMessageById("13133"),
            Tools.GetMessageById("13127")
        });

        tabC1.onChanged.Add(OnChange);
        OnChange();

        if (!Tools.IsNullEmpty(isUid))
        {
            btn_yaoqing.touchable = false;
            btn_yaoqing.grayed    = true;
        }
        else
        {
            btn_yaoqing.visible = true;
        }
        share_bitmap = "";
        GetER();//获取二维码
        SetData();
    }
    private void TasteRander(int index, GObject item)
    {
        Dictionary <string, object> dc = (Dictionary <string, object>)listData [index];
        GButton    photo          = item.asCom.GetChild("n1").asCom.GetChild("n0").asButton;
        GTextField name           = item.asCom.GetChild("n3").asTextField;
        GTextField guild          = item.asCom.GetChild("n4").asTextField;
        GLoader    achieve        = item.asCom.GetChild("n21").asCom.GetChild("n1").asLoader;
        GTextField status         = item.asCom.GetChild("n9").asTextField;
        GButton    mask_btn       = item.asCom.GetChild("n8").asButton;
        GButton    btn_attention  = item.asCom.GetChild("n7").asButton;
        GTextField attention_text = btn_attention.GetChild("title").asTextField;
        GLoader    btn_image      = btn_attention.asCom.GetChild("n1").asLoader;

        btn_image.visible = true;
        GObject    reletion  = item.asCom.GetChild("n2");
        GTextField rankScore = item.asCom.GetChild("n21").asCom.GetChild("n2").asTextField;
        GTextField lv        = item.asCom.GetChild("n1").asCom.GetChild("n2").asTextField;

        reletion.visible      = false;
        btn_attention.visible = true;
        userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);

        btn_attention.RemoveEventListeners();
        btn_attention.onClick.Add(() =>
        {
            //关注的实现
            Dictionary <string, object> dd = new Dictionary <string, object> ();
            dd ["fuid"] = dc ["uid"];
            NetHttp.inst.Send(NetBase.HTTP_FOLLOW, dd, (VoHttp vo) =>
            {
                if ((bool)vo.data == true)
                {
                    roleModel.AddAttentionFight(dc["uid"].ToString());
                    ((Dictionary <string, object>)listData[index])["if_follow"] = true;
                    Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0);
                    btn_attention.touchable = false;
                }
                else
                {
                    ViewManager.inst.ShowText(Tools.GetMessageById("13120"));
                }
            });
        });
        if ((bool)dc ["if_black"])
        {        //是否拉黑
            Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textShieldd, fontSize, textBtnColor, "", 0);
            type = 1;
            btn_attention.touchable = false;
        }
        else if ((bool)dc["if_follow"])
        {
            //是否已关注
            Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0);
            type = 2;
            btn_attention.touchable = false;
        }
        else
        {
            Tools.SetButtonBgAndColor(btn_attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor);
            btn_attention.touchable = true;
        }

        achieve.url = userModel.GetRankImg((int)dc["rank_score"]);
        mask_btn.RemoveEventListeners();
        mask_btn.onClick.Add(() =>
        {
            roleModel.SetTempData(listData, new int[] { index });
            string uid_ = dc ["uid"] + "";
            if (!uid_.Equals(userModel.uid))
            {
                this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid_, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 }));
            }
            else
            {
                ViewManager.inst.ShowText(Tools.GetMessageById("13106"));
            }
        });
        lv.text = dc ["lv"].ToString();
        if (Tools.IsNullEmpty(dc["uname"]))
        {
            name.text = dc ["uid"] + "";
        }
        else
        {
            name.text = dc["uname"].ToString();
        }
        string dc_ = (string)dc ["head_use"];

        Tools.SetLoaderButtonUrl(photo, ModelUser.GetHeadUrl(dc_));
        if (dc["guild_name"] == null)
        {
            guild.text = Tools.GetMessageById("19955");
        }
        else
        {
            guild.text = dc["guild_name"] + "";
        }
        switch (dc["type"].ToString())
        {
        case "redbag":
            status.text = Tools.GetMessageById("19963");
            break;

        case "battle_man":
            status.text = Tools.GetMessageById("19964");
            break;

        case "elv_lv":
            status.text = Tools.GetMessageById("19965");
            break;
        }
        rankScore.text = dc ["rank_score"] + "";
    }
Exemple #17
0
    public override void Init()
    {
        base.Init();
        this.isAutoClose = false;
        this.Create(Config.VIEW_FREEMATCH, false, Tools.GetMessageById("25024"));

        fightModel           = ModelManager.inst.fightModel;
        userModel            = ModelManager.inst.userModel;
        fightModel.fightType = ModelFight.FIGHT_FREEMATCH1;

//		PlatForm.inst.timeout = 2f;

//		title = view.GetChild ("n1").asTextField;
        btn_Change = this.GetChild("n2").asButton;
        btn_Start  = this.GetChild("n12").asButton;
        btn_Invite = this.GetChild("n13").asButton;

        btn_Change.text = Tools.GetMessageById("33209");
        btn_Start.text  = Tools.GetMessageById("33210");
        btn_Invite.text = Tools.GetMessageById("33211");

        btn_Quit = this.GetChild("n16").asButton;
        btn_Clos = this.GetChild("n31").asButton;
        btn_Bot  = this.GetChild("n11").asButton;
        btn_Chat = this.GetChild("n19").asButton;
        c1       = this.GetController("c1");
        btn_Mil  = this.GetChild("n28").asButton;
        bar      = this.GetChild("n29").asCom as ComProgressBar;
        bar.skin = ComProgressBar.BAR10;
        bar.SetTextVisible(false);
        bar.value = 0;
        bar.max   = 100;

        item0 = this.GetChild("n3").asCom;
        item1 = this.GetChild("n4").asCom;
        item2 = this.GetChild("n5").asCom;
        item3 = this.GetChild("n6").asCom;
        item4 = this.GetChild("n7").asCom;
        item5 = this.GetChild("n8").asCom;
        item6 = this.GetChild("n9").asCom;
        item7 = this.GetChild("n10").asCom;
        help  = this.GetChild("n30").asButton;

        btn_Invite.onClick.Add(Invite_Click);
        btn_Clos.onClick.Add(Close_Click);
        btn_Change.onClick.Add(Change_Click);
        btn_Start.onClick.Add(Start_Click);
        btn_Bot.onClick.Add(Bot_Click);
        btn_Chat.onClick.Add(Chat_Click);
        btn_Quit.onClick.Add(Close_Click);
        help.onClick.Add(Help_Click);

        userModel.GetUnlcok(Config.UNLOCK_FREEMATCH2, btn_Change);

//		public int[] freeType1 = new int[]{ 0, 1, 2, 3, 4, 5, 6, 7 };
//		public int[] freeType2 = new int[]{ 0, 1, 4, 5, 2, 3, 6, 7 };
        if (fightModel.freeType == 1)
        {
            items = new GComponent[8] {
                item0, item1, item2, item3, item4, item5, item6, item7
            }
        }
        ;
        else
        {
            items = new GComponent[8] {
                item0, item1, item4, item5, item2, item3, item6, item7
            }
        };
        this.SetDefault();
        if (fightModel.isRequest)
        {
            NetSocket.inst.AddListener(NetBase.SOCKET_NEWROOM, (VoSocket vo) =>
            {
                NetSocket.inst.RemoveListener(NetBase.SOCKET_NEWROOM);
                fightModel.CreateFreeTeam(vo.data);
                UpdateItems();
                CheckMode();
                btn_Bot.visible = fightModel.isLeader;
            });

            Dictionary <string, object> data = new Dictionary <string, object> ();
            data ["mode"] = fightModel.freeType;
            NetSocket.inst.Send(NetBase.SOCKET_NEWROOM, data);
        }
        else
        {
            CheckMode();
            UpdateItems();
            btn_Bot.visible = fightModel.isLeader;
        }

        micro = new MediatorMicro();
        ViewManager.inst.AddTopView(micro);
//		micro.visible = false;

        NetSocket.inst.AddListener(NetBase.SOCKET_ADDUSER, (VoSocket vo) =>
        {
            fightModel.ChangeFreeTeam(vo.data);
            UpdateItems();
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_REMOVEUSER, (VoSocket vo) =>
        {
            bool b = fightModel.DelFreeTeam(vo.data);
            if (b)
            {
                fightModel.Clear();
                ViewManager.inst.CloseView(this);
                ViewManager.inst.ShowText(Tools.GetMessageById("25011"));
            }
            else
            {
                UpdateItems();
            }
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_KILLROOMPUSH, (VoSocket vo) =>
        {
            fightModel.Clear();
            ViewManager.inst.CloseView(this);
            ViewManager.inst.ShowText(Tools.GetMessageById("25008"));
            Log.debug("解散队伍");
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_FREESTARTMATCHPUSH, (VoSocket vo) =>
        {
            if (fightModel.freeType == 1)
            {
                fightModel.fightType = ModelFight.FIGHT_FREEMATCH1;
            }
            else
            {
                fightModel.fightType = ModelFight.FIGHT_FREEMATCH2;
            }
            Log.debug("进入战斗");
            ViewManager.inst.ShowScene <MediatorFightWorld> (true);
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_CHANGEMODEPUSH, (VoSocket vo) =>
        {
            Dictionary <string, object> da = (Dictionary <string, object>)vo.data;
            fightModel.freeType            = Convert.ToInt32(da ["new_mode"]);
            CheckMode(true);
            Log.debug("更换模式");
//			ViewManager.inst.ShowText (Tools.GetMessageById ("25021"));
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_CHANGEPOSPUSH, (VoSocket vo) =>
        {
            fightModel.RepalceFreeTeam(vo.data);
            CheckMode(true);
            Log.debug("更换位置");
//			ViewManager.inst.ShowText (Tools.GetMessageById ("25021"));
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_FREECHATPUSH, (VoSocket vo) =>
        {
            if (userModel.IsChatVoice())
            {
                fightModel.AddMicro(vo.data);
            }
        });

        this.AddGlobalListener(MainEvent.SOCKET_CLOSE, (MainEvent e) =>
        {
            this.Close();
        });
    }
Exemple #18
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"));
        }
    }
Exemple #19
0
    private void OnRendere(int index, GObject item)
    {
        GComponent g         = item.asCom;
        GObject    reletion  = g.GetChild("n3");
        GButton    headBtn   = g.GetChild("n2").asButton;
        GButton    head      = g.GetChild("n2").asCom.GetChild("n0").asButton;
        GTextField name      = g.GetChild("n4").asTextField;
        GTextField guild     = g.GetChild("n5").asTextField;
        GLoader    achieve   = g.GetChild("n29").asCom.GetChild("n1").asLoader;
        GTextField rankScore = g.GetChild("n29").asCom.GetChild("n2").asTextField;
        GTextField msg       = g.GetChild("n6").asTextField;
        GTextField status    = g.GetChild("n7").asTextField;
        GButton    mask_btn  = g.GetChild("n9").asButton;
        GButton    btn_      = g.GetChild("n0").asButton;

        userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);

        bool isVisible = SetListCSS(item, listData.ToArray(), index);

        if (isVisible)
        {
            btn_.visible = true;
            //mask_btn.SetSize(622, 71);
            btn_.text        = Tools.GetMessageById("19911");
            reletion.visible = false;
            msg.visible      = false;
            status.visible   = false;
            GTextField lv = g.GetChild("n2").asCom.GetChild("n2").asTextField;
            Dictionary <string, object> dc = (Dictionary <string, object>)listData[index];

            btn_.GetChild("n1").asLoader.url = Tools.GetResourceUrl("Image2:n_btn_4");
            Tools.SetRootTabTitleStrokeColor(btn_.GetChild("title").asTextField, "#dd8680", 2);
            btn_.RemoveEventListeners();
            btn_.onClick.Add(() =>
            {
                Dictionary <string, object> dd = new Dictionary <string, object>();
                dd["fuid"] = dc["uid"];
                NetHttp.inst.Send(NetBase.HTTP_CANCLESHIELDING, dd, (VoHttp vo) =>
                {
                    if ((bool)vo.data == true)
                    {
                        SendNetMesage("");
                        ViewManager.inst.ShowText(Tools.GetMessageById("19913"));
                    }
                });
            });
            achieve.url = userModel.GetRankImg((int)dc["rank_score"]);
            mask_btn.RemoveEventListeners();
            mask_btn.onClick.Add(() => {
                roleModel.SetTempData(null, new int[] { m_PageIndexS, m_PageIndex });
                string uid = dc["uid"] + "";
                if (!uid.Equals(userModel.uid))
                {
                    this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 }));
                }
                else
                {
                    ViewManager.inst.ShowText(Tools.GetMessageById("13106"));
                }
            });
            lv.text = dc["lv"].ToString();
            string uname = dc["uname"] + "";
            if (uname.Equals(""))
            {
                name.text = dc["uid"] + "";
            }
            else
            {
                name.text = uname;
            }
            string dc_ = (string)dc["head_use"];
            Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(dc_));
            if (dc["guild_name"] == null)
            {
                guild.text = Tools.GetMessageById("19955");
            }
            else
            {
                guild.text = dc["guild_name"] + "";
            }
            //msg.text = "23小时前成就等级提升至99级";
            rankScore.text = dc["rank_score"] + "";
        }
        else
        {
            btn_.visible = false;
        }
    }
    public override void Init()
    {
        base.Init();
        string myUid = "";

        fightModel           = ModelManager.inst.fightModel;
        roleModel            = ModelManager.inst.roleModel;
        userModel            = ModelManager.inst.userModel;
        playbackfailure_time = (int)DataManager.inst.systemSimple["playbackfailure_time"];
        video_deadline       = (DateTime)DataManager.inst.systemSimple["video_deadline"];
        if (fightModel.isOpenFromRecord)
        {
            myUid            = roleModel.otherInfo["uid"].ToString();
            fightDataDetails = (object[])fightModel.fightDataDetails[fightModel.recordIndex];
            Create(Config.VIEW_FIGTHTDATASHOWRANK, false, (string)roleModel.otherInfo["uname"] + Tools.GetMessageById("24224"));
        }
        else
        {
            myUid            = fightModel.myUid;
            fightDataDetails = (object[])fightModel.fightDataDetails;
            Create(Config.VIEW_FIGTHTDATASHOWRANK, false, fightDataDetails[fightDataDetails.Length - 1].ToString() + Tools.GetMessageById("24224"));
        }

        listData = new List <object[]>();
        GTextField t1    = this.GetChild("n15").asTextField;
        GTextField t2    = this.GetChild("n16").asTextField;
        GTextField text1 = this.GetChild("n5").asTextField;
        GTextField text2 = this.GetChild("n7").asTextField;
        GTextField text3 = this.GetChild("n4").asTextField;
        GTextField text4 = this.GetChild("n6").asTextField;

        timeFail = this.GetChild("n39").asTextField;
        GTextField value1 = this.GetChild("value1").asTextField;
        GTextField value2 = this.GetChild("value2").asTextField;
        GTextField value3 = this.GetChild("value3").asTextField;
        GTextField value4 = this.GetChild("value4").asTextField;

        list1 = this.GetChild("n3").asList;
        list2 = this.GetChild("n13").asList;
        share = this.GetChild("n17").asButton;
        watch = this.GetChild("n18").asButton;
        bool ok = userModel.GetUnlcok(Config.UNLOCK_FIGHTSHARE, share);

        if (!ok)
        {
            watch.x = 377;
        }
        //share.asCom.GetChild("n1").asLoader.url = Tools.GetResourceUrl("Image2:n_icon_you1");
        share.text = Tools.GetMessageById("24219");
        share.RemoveEventListeners();
        share.onClick.Add(ShareOnclick);

        //watch.asCom.GetChild("n1").asLoader.url = Tools.GetResourceUrl("Image2:n_icon_you2");
        watch.text = Tools.GetMessageById("24248");
        watch.RemoveEventListeners();
        watch.onClick.Add(WatchOnclick);
        //share.visible = true;
        if (fightModel.isOpenFromRecord)
        {
            if (!myUid.Equals(userModel.uid))
            {
                share.visible = false;
                watch.visible = false;
            }
            else
            {
                if (!TimeFail())
                {
                    share.visible    = false;
                    watch.visible    = false;
                    timeFail.visible = true;
                    timeFail.text    = Tools.GetMessageById("10038");
                }
            }
        }
        else
        {
            share.visible = false;
        }

        dataAll = (object[])fightDataDetails[3];
        for (int i = 0; i < dataAll.Length; i++)
        {
            object[] data = (object[])dataAll[i];
            if (data[0].ToString().Equals(myUid))
            {
                dataMe  = (object[])data[5];
                myIndex = i;
            }
            listData.Add(data);
        }
        string str1   = Tools.GetMessageById("24231") + ":";
        string str1_1 = dataMe[0].ToString();
        string str2   = Tools.GetMessageById("24213") + ":";
        string str2_1 = dataMe[3].ToString();
        string str3   = Tools.GetMessageById("24211") + ":";
        string str3_1 = dataMe[1].ToString();
        string str4   = Tools.GetMessageById("24212") + ":";
        string str4_1 = dataMe[2].ToString();

        t1.text     = Tools.GetMessageById("24249");
        t2.text     = Tools.GetMessageById("24250");
        text1.text  = str1;
        text2.text  = str2;
        text3.text  = str3;
        text4.text  = str4;
        value1.text = str1_1;
        value2.text = str2_1;
        value3.text = str3_1;
        value4.text = str4_1;
        if (myIndex <= 3)
        {
            listData1 = listData.GetRange(0, 4);
            listData2 = listData.GetRange(4, 4);
        }
        else
        {
            listData1 = listData.GetRange(4, 4);
            listData2 = listData.GetRange(0, 4);
        }
        list1.itemRenderer = OnRender_1;
        list1.numItems     = listData1.Count;
        list2.itemRenderer = OnRender_2;
        list2.numItems     = listData2.Count;
    }
    private void InitDate()
    {
        Tools.UpdataHeadTime();
        //addrDiction = (Dictionary<string, object>)DataManager.inst.systemSimple["area_config"];
        storyNum      = (int)DataManager.inst.systemSimple["story_num"];
        friend_like_s = (Dictionary <string, object>)DataManager.inst.systemSimple["friend_like"];
        need_coin     = (object[])friend_like_s["need_coin"];
        gift_coin     = (object[])friend_like_s["gift_coin"];

        fuid      = roleModel.fuid;
        otherInfo = roleModel.otherInfo;
        uid.text  = Tools.GetMessageById("13028") + otherInfo["uid"];

        if (otherInfo["uid"].ToString().Equals(userModel.uid))
        {
            if (isBtnMicro)
            {
                btnMicro.visible = true;
                //是否是第一次的
                if (!ModelRole.isHasMicro)
                {
                    userModel.Add_Notice(btnMicro, new Vector2(40, 0), 0, false, false, true);
                }
                else
                {
                    btnOpenMicro.visible = true;
                    userModel.Remove_Notice(btnMicro);
                }
            }
            editImage.visible = true;
            graph.visible     = false;
            attention.visible = false;
            watch.visible     = false;
            shield.visible    = false;
            guild.visible     = false;
            InitBaseView();
            InitBaseList();
        }
        else
        {
            if (isBtnMicro)
            {
                if (false)
                {
                }
                else
                {
                    btnOpenMicro.visible = true;
                    btnMicro.visible     = true;
                    btnMicro.touchable   = false;
                }
            }
            i_like_num         = (int)otherInfo["ilike_num"];
            graph.visible      = true;
            photoCom.touchable = false;
            attention.visible  = true;
            watch.visible      = true;
            shield.visible     = true;
            guild.visible      = true;
            userModel.GetUnlcok(Config.UNLOCK_GUILD, guild);
            //save_btn.visible = false;
            //save_img.visible = false;
            if ((bool)otherInfo["if_black"])
            {
                //是拉黑的关系
                Tools.SetButtonBgAndColor(attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor);
                Tools.SetButtonBgAndColor(shield, btnBgDo, textShieldd, fontSize, textBtnColor, textBtnStrokeColor1);
                typeShield = true;
            }
            else
            {
                Tools.SetButtonBgAndColor(shield, btnBgUp, textShield, fontSize, textBtnColor, textBtnStrokeColor);
                typeShield = false;
            }
            InitBaseView();
            InitBaseList();
        }

        fans_name   = new string[] {
        };
        fun2_player = new string[] {
            Tools.GetMessageById("13014"),
            Tools.GetMessageById("13015"),
            Tools.GetMessageById("13016")
        };
        fun2        = new string[] { Tools.GetMessageById("13017") };
        fun1_player = new string[] { Tools.GetMessageById("13018") };
    }