public void SetPVP1List(yuan.YuanMemoryDB.YuanTable mYt)
    {
        for (int i = 0; i < listPVP1.Count; i++)
        {
            listPVP1[i].gameObject.SetActiveRecursively(false);
        }
        for (int i = 0; i < mYt.Rows.Count; i++)
        {
            if (listPVP1.Count > i)
            {
                listPVP1[i].playerID           = mYt.Rows[i]["PlayerID"].YuanColumnText;
                listPVP1[i].lblPlayerName.text = mYt.Rows[i]["PlayerName"].YuanColumnText;

                listPVP1[i].lblPlayerLevel.text  = "Lv" + mYt.Rows[i]["PlayerLevel"].YuanColumnText;
                listPVP1[i].picPlayer.atlas      = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].atlas;
                listPVP1[i].picPlayer.spriteName = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].spriteName;
                listPVP1[i].btnAddLable.text     = StaticLoc.Loc.Get("info338") + "";
                listPVP1[i].lblPlayerPro.text    = RefreshList.GetPro(mYt.Rows[i]["ProID"].YuanColumnText);

                if (myGrid.gameObject.active)
                {
                    listPVP1[i].gameObject.SetActiveRecursively(true);
                    listPVP1[i].picNew.gameObject.active = false;
                }
            }
            else
            {
                BtnPlayerForTeam tempPlayer = (BtnPlayerForTeam)Instantiate(btnPlayerForOnePVP);
                tempPlayer.GetComponent <UIToggle>().group = 7;
                tempPlayer.transform.parent           = myGrid.transform;
                tempPlayer.transform.localPosition    = Vector3.zero;
                tempPlayer.transform.localScale       = new Vector3(1, 1, 1);
                tempPlayer.btnAddMessage.target       = this.gameObject;
                tempPlayer.btnAddMessage.functionName = "BtnPVP1";
                tempPlayer.btnAddLable.text           = StaticLoc.Loc.Get("info338") + "";
                tempPlayer.lblPlayerPro.text          = RefreshList.GetPro(mYt.Rows[i]["ProID"].YuanColumnText);
                tempPlayer.picNew.gameObject.active   = false;

                tempPlayer.playerID = mYt.Rows[i]["PlayerID"].YuanColumnText;
                if (mYt.Rows[i]["PlayerID"].YuanColumnText == "-10")
                {
                    PanelStatic.StaticBtnGameManager.pvpButtonTran = tempPlayer.btnAddMessage.gameObject.transform;
                    PanelStatic.StaticBtnGameManagerBack.UICL.SendMessage("SetCourseStepObject", tempPlayer.btnAddMessage.gameObject.transform, SendMessageOptions.DontRequireReceiver);
                    tempPlayer.picNew.gameObject.active   = false;
                    tempPlayer.btnAddMessage.functionName = "RobotytShaDow";
                }
                tempPlayer.lblPlayerName.text = mYt.Rows[i]["PlayerName"].YuanColumnText;

                tempPlayer.picPlayer.atlas      = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].atlas;
                tempPlayer.picPlayer.spriteName = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].spriteName;
                tempPlayer.lblPlayerLevel.text  = "Lv" + mYt.Rows[i]["PlayerLevel"].YuanColumnText;
                listPVP1.Add(tempPlayer);
                if (!myGrid.gameObject.active)
                {
                    tempPlayer.gameObject.SetActiveRecursively(false);
                }
            }
            myGrid.repositionNow = true;
        }
    }
    public void SetPVP1RevengeList(yuan.YuanMemoryDB.YuanTable mYt)
    {
        for (int i = 0; i < listPVP1.Count; i++)
        {
            listPVP1[i].gameObject.SetActiveRecursively(false);
        }
        for (int i = 0; i < mYt.Rows.Count; i++)
        {
            if (listPVP1.Count > i)
            {
                listPVP1[i].playerID           = mYt.Rows[i]["PlayerID"].YuanColumnText;
                listPVP1[i].lblPlayerName.text = mYt.Rows[i]["PlayerName"].YuanColumnText;
                listPVP1[i].yr = mYt.Rows[i];
                listPVP1[i].lblPlayerLevel.text  = "Lv" + mYt.Rows[i]["PlayerLevel"].YuanColumnText;
                listPVP1[i].picPlayer.atlas      = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].atlas;
                listPVP1[i].picPlayer.spriteName = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].spriteName;

                string[] bePVPInfo = mYt.Rows[i]["pvp1BeInfo"].YuanColumnText.Split(',');


                if (bePVPInfo[1].Trim() == "0")
                {
                    listPVP1[i].lblPlayerPro.text = string.Format("{0}[00ff00]{1}", System.DateTime.Parse(bePVPInfo[3]).ToShortTimeString(), StaticLoc.Loc.Get("info339"));
                }
                else
                {
                    listPVP1[i].lblPlayerPro.text = string.Format("{0}[ff0000]{1}", System.DateTime.Parse(bePVPInfo[3]).ToShortTimeString(), StaticLoc.Loc.Get("info339"));
                }


                //listPVP1[i].lblPlayerPro.text = RefreshList.GetPro(mYt.Rows[i]["ProID"].YuanColumnText);

                if (myGrid.gameObject.active)
                {
                    listPVP1[i].gameObject.SetActiveRecursively(true);
                    if (bePVPInfo[2].Trim() == "2")
                    {
                        listPVP1[i].btnAddLable.text         = StaticLoc.Loc.Get("info341");
                        listPVP1[i].picNew.gameObject.active = false;
                    }
                    else
                    {
                        listPVP1[i].btnAddLable.text         = StaticLoc.Loc.Get("info342");
                        listPVP1[i].picNew.gameObject.active = true;
                    }
                }
                else
                {
                    listPVP1[i].gameObject.SetActiveRecursively(false);
                }
            }
            else
            {
                BtnPlayerForTeam tempPlayer = (BtnPlayerForTeam)Instantiate(btnPlayerForOnePVP);
                tempPlayer.GetComponent <UIToggle>().group = 7;
                tempPlayer.transform.parent           = myGrid.transform;
                tempPlayer.transform.localPosition    = Vector3.zero;
                tempPlayer.transform.localScale       = new Vector3(1, 1, 1);
                tempPlayer.btnAddMessage.target       = this.gameObject;
                tempPlayer.btnAddMessage.functionName = "BtnPVP1";
                tempPlayer.btnAddLable.text           = StaticLoc.Loc.Get("info338");
                tempPlayer.lblPlayerPro.text          = RefreshList.GetPro(mYt.Rows[i]["ProID"].YuanColumnText);
                tempPlayer.playerID             = mYt.Rows[i]["PlayerID"].YuanColumnText;
                tempPlayer.lblPlayerName.text   = mYt.Rows[i]["PlayerName"].YuanColumnText;
                tempPlayer.picPlayer.atlas      = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].atlas;
                tempPlayer.picPlayer.spriteName = PanelStatic.StaticYuanPicManger.picPlayer[int.Parse(mYt.Rows[i]["ProID"].YuanColumnText) - 1].spriteName;
                tempPlayer.lblPlayerLevel.text  = "Lv" + mYt.Rows[i]["PlayerLevel"].YuanColumnText;
                tempPlayer.yr = mYt.Rows[i];

                string[] bePVPInfo = mYt.Rows[i]["pvp1BeInfo"].YuanColumnText.Split(',');
                if (bePVPInfo[2].Trim() == "2")
                {
                    tempPlayer.btnAddLable.text         = StaticLoc.Loc.Get("info343");
                    tempPlayer.picNew.gameObject.active = false;
                }
                else
                {
                    tempPlayer.btnAddLable.text         = StaticLoc.Loc.Get("info342");
                    tempPlayer.picNew.gameObject.active = true;
                }

                if (bePVPInfo[1].Trim() == "0")
                {
                    tempPlayer.lblPlayerPro.text = string.Format("{0}[00ff00]{1}", System.DateTime.Parse(bePVPInfo[3]).ToShortTimeString(), StaticLoc.Loc.Get("info339"));
                }
                else
                {
                    tempPlayer.lblPlayerPro.text = string.Format("{0}[ff0000]{1}", System.DateTime.Parse(bePVPInfo[3]).ToShortTimeString(), StaticLoc.Loc.Get("info340"));
                }


                listPVP1.Add(tempPlayer);
                if (!myGrid.gameObject.active)
                {
                    tempPlayer.gameObject.SetActiveRecursively(false);
                }
            }
            myGrid.repositionNow = true;
        }
    }
Exemplo n.º 3
0
    private void RefreshPlayerList(yuan.YuanMemoryDB.YuanTable mYt)
    {
        foreach (BtnPlayerForTeam item in listBtn)
        {
            item.gameObject.SetActiveRecursively(false);
        }
        if (mYt.Rows.Count > 0)
        {
            lblNull.gameObject.active = false;
        }
        else
        {
            lblNull.gameObject.active = true;
            //if (listType != ListType.Firends&&listType!=ListType.Team)
            //{
//                this.transform.parent.gameObject.SetActiveRecursively(false);

            InActiveChild();

            //}
            if (listType == ListType.Team)
            {
                if (ytPlayerLegionList.Count > 0 || ytPlayerList.Count > 0)
                {
                    lblNull.gameObject.active = false;
                    if (ytPlayerList.Count > 0)
                    {
                        teamType = TeamType.Team;
                    }
                    else if (ytPlayerLegionList.Count > 0)
                    {
                        teamType = TeamType.Legion;
                    }
                    else
                    {
                        teamType = TeamType.Team;
                    }

                    playerInfo.teamType = teamType;
                }
                else
                {
                    //Debug.Log("+++++++++++++++++++++");
//                    this.transform.parent.gameObject.SetActiveRecursively(false);

                    InActiveChild();

                    foreach (BtnPlayerForTeam item in listBtn)
                    {
                        item.gameObject.SetActiveRecursively(false);
                    }
                }
            }
        }

        int num = 0;

        foreach (yuan.YuanMemoryDB.YuanRow item in mYt.Rows)
        {
            UIToggle ckb;
            if (num < listBtn.Count)
            {
                int numPro = int.Parse(item["ProID"].YuanColumnText.Trim()) - 1;
                listBtn[num].picPlayer.atlas      = yuanPicManager.picPlayer[numPro].atlas;
                listBtn[num].picPlayer.spriteName = yuanPicManager.picPlayer[numPro].spriteName;
                listBtn[num].lblPlayerName.text   = item["PlayerName"].YuanColumnText.Trim();
                listBtn[num].lblPlayerLevel.text  = item["PlayerLevel"].YuanColumnText.Trim();
                listBtn[num].lblPlayerPro.text    = GetPro(item["ProID"].YuanColumnText.Trim());

                if (listType == ListType.Guild)
                {
                    if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 1)
                    {
                        listBtn[num].GuildPosition.text = StaticLoc.Loc.Get("info950");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 2)
                    {
                        listBtn[num].GuildPosition.text = StaticLoc.Loc.Get("info947");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 3)
                    {
                        listBtn[num].GuildPosition.text = StaticLoc.Loc.Get("info948");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 4)
                    {
                        listBtn[num].GuildPosition.text = StaticLoc.Loc.Get("buttons705");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 5)
                    {
                        listBtn[num].GuildPosition.text = StaticLoc.Loc.Get("info964");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 0)
                    {
                        listBtn[num].GuildPosition.text = StaticLoc.Loc.Get("info949");
                    }
                }

                listBtn[num].yr = item;

                ckb           = listBtn[num].GetComponent <UIToggle>();
                ckb.isChecked = false;

                listBtn[num].gameObject.SetActiveRecursively(true);
            }
            else
            {
                BtnPlayerForTeam btnforTeamTemp = ((GameObject)Instantiate(btnPlayerForTeam)).GetComponent <BtnPlayerForTeam>();
                btnforTeamTemp.GetComponent <UIToggle>().group = 5;
                UIButtonMessage btnMessage = btnforTeamTemp.GetComponent <UIButtonMessage>();
                btnMessage.target = this.gameObject;
                if (txtMailAddressee != null)
                {
                    btnMessage.functionName = "SetMailAddress";
                }
                else
                {
                    btnMessage.functionName = "SetPlayerInfo";
                }
                btnforTeamTemp.yr                      = item;
                btnforTeamTemp.playerInfo              = this.playerInfo;
                btnforTeamTemp.transform.parent        = this.transform;
                btnforTeamTemp.transform.localPosition = Vector3.zero;
                btnforTeamTemp.transform.localScale    = new Vector3(1, 1, 1);
                int numPro = int.Parse(item["ProID"].YuanColumnText.Trim()) - 1;
                btnforTeamTemp.picPlayer.atlas      = yuanPicManager.picPlayer[numPro].atlas;
                btnforTeamTemp.picPlayer.spriteName = yuanPicManager.picPlayer[numPro].spriteName;
                btnforTeamTemp.lblPlayerName.text   = item["PlayerName"].YuanColumnText.Trim();
                btnforTeamTemp.lblPlayerLevel.text  = item["PlayerLevel"].YuanColumnText.Trim();
                btnforTeamTemp.lblPlayerPro.text    = GetPro(item["ProID"].YuanColumnText.Trim());


                if (listType == ListType.Guild)
                {
                    if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 1)
                    {
                        btnforTeamTemp.GuildPosition.text = StaticLoc.Loc.Get("info950");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 2)
                    {
                        btnforTeamTemp.GuildPosition.text = StaticLoc.Loc.Get("info947");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 3)
                    {
                        btnforTeamTemp.GuildPosition.text = StaticLoc.Loc.Get("info948");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 4)
                    {
                        btnforTeamTemp.GuildPosition.text = StaticLoc.Loc.Get("buttons705");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 5)
                    {
                        btnforTeamTemp.GuildPosition.text = StaticLoc.Loc.Get("info964");
                    }
                    else if (int.Parse(item["GuildPosition"].YuanColumnText.Trim()) == 0)
                    {
                        btnforTeamTemp.GuildPosition.text = StaticLoc.Loc.Get("info949");
                    }
                }

                ckb       = btnforTeamTemp.GetComponent <UIToggle>();
                ckb.group = 5;

                UIPanel tempPanel = btnforTeamTemp.GetComponent <UIPanel>();
                if (tempPanel != null)
                {
                    Destroy(tempPanel);
                }
                listBtn.Add(btnforTeamTemp);
            }
            if (num == 0)
            {
                ckb.isChecked = true;
            }
            num++;
        }
        myGrid.repositionNow = true;
    }