Beispiel #1
0
    void SetSlot(Transform slotTf, NetData.RankInfo info)
    {
        //등수
        UISprite rankMark = slotTf.FindChild("Rankmark").GetComponent <UISprite>();
        UILabel  rank     = slotTf.FindChild("Txt_ranking").GetComponent <UILabel>();

        rank.text = string.Format(_LowDataMgr.instance.GetStringCommon(522), info.Rank);
        slotTf.FindChild("Txt_Name").GetComponent <UILabel>().text = info.Name;//이름

        //얼굴
        UISprite face = slotTf.FindChild("Char").GetComponent <UISprite>();

        if (CurRankType == eRANK_TABLE_TYPE.GUILD_GOLD || CurRankType == eRANK_TABLE_TYPE.GUILD_MEMBER)// 길드는 휘장
        {
            face.atlas      = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.GuildMark);
            face.spriteName = _LowDataMgr.instance.GetLowDataIcon((uint)info.RoleType);

            slotTf.FindChild("Txt_Guildname").gameObject.SetActive(false);
            Vector3 namePos = slotTf.FindChild("Txt_Name").localPosition;
            namePos.y = 15;//29.2
            slotTf.FindChild("Txt_Name").localPosition = namePos;

            Vector3 lvPos = slotTf.FindChild("Txt_Level").localPosition;
            lvPos.y = -30;//-45.8
            slotTf.FindChild("Txt_Level").localPosition = lvPos;

            slotTf.FindChild("Txt_VIP").GetComponent <UILabel>().text = "";

            if (0 < info.Id)
            {
                EventDelegate.Set(slotTf.GetComponent <UIEventTrigger>().onClick, () => {
                    NetworkClient.instance.SendPMsgGuildQueryBaseInfoC((uint)info.Id);
                    NetworkClient.instance.SendPMsgGuildQueryDetailedInfoC((uint)info.Id);
                });
            }
        }
        else
        {
            face.atlas      = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.Face);
            face.spriteName = UIHelper.GetClassPortIcon((uint)info.RoleType, 1);

            slotTf.FindChild("Txt_Guildname").gameObject.SetActive(true);
            Vector3 namePos = slotTf.FindChild("Txt_Name").localPosition;
            namePos.y = 29.2f;
            slotTf.FindChild("Txt_Name").localPosition = namePos;

            Vector3 lvPos = slotTf.FindChild("Txt_Level").localPosition;
            lvPos.y = -45.8f;
            slotTf.FindChild("Txt_Level").localPosition = lvPos;

            slotTf.FindChild("Txt_VIP").GetComponent <UILabel>().text       = string.Format("{0}.{1}", _LowDataMgr.instance.GetStringCommon(460), info.VipLv);
            slotTf.FindChild("Txt_Guildname").GetComponent <UILabel>().text = info.GuildName;

            if (0 < info.Id)
            {
                EventDelegate.Set(slotTf.GetComponent <UIEventTrigger>().onClick, () => {
                    UIMgr.OpenUserInfoPopup((long)info.Id, info.Name, info.RoleType, 0, info.Level, true);
                });
            }
        }

        if (info.Rank == 1)
        {
            rank.gradientTop    = oneTop;
            rank.gradientBottom = oneBtm;
            rank.effectColor    = brownEff;

            rankMark.gameObject.SetActive(true);
            rankMark.spriteName = "Img_Rank01";
        }
        else if (info.Rank == 2)
        {
            rank.gradientTop    = towTop;
            rank.gradientBottom = towBtm;
            rank.effectColor    = blueEff;

            rankMark.gameObject.SetActive(true);
            rankMark.spriteName = "Img_Rank02";
        }
        else if (info.Rank == 3)
        {
            rank.gradientTop    = threeTop;
            rank.effectColor    = brownEff;
            rank.gradientBottom = threeBtm;

            rankMark.gameObject.SetActive(true);
            rankMark.spriteName = "Img_Rank03";
        }
        else
        {
            rankMark.gameObject.SetActive(false);

            rank.gradientTop    = Color.white;
            rank.gradientBottom = Color.white;
            rank.color          = Color.white;
            rank.effectColor    = blueEff;
        }

        slotTf.FindChild("Txt_Info").GetComponent <UILabel>().text  = CurChildTapName;      //info
        slotTf.FindChild("Txt_Num").GetComponent <UILabel>().text   = info.Data.ToString(); //info value
        slotTf.FindChild("Txt_Level").GetComponent <UILabel>().text = string.Format("{0}.{1}", _LowDataMgr.instance.GetStringCommon(14), info.Level);
    }
Beispiel #2
0
    void MySetSlot(NetData.RankInfo info)
    {
        //얼굴
        bool     isGuild = CurRankType == eRANK_TABLE_TYPE.GUILD_GOLD || CurRankType == eRANK_TABLE_TYPE.GUILD_MEMBER;
        UISprite face    = MySlot.FindChild("Char").GetComponent <UISprite>();

        if (!isGuild || MyGuildInfo.Id <= 0)
        {
            face.atlas      = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.Face);
            face.spriteName = UIHelper.GetClassPortIcon((uint)info.RoleType, 1);
        }
        else// 길드는 휘장
        {
            face.atlas      = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.GuildMark);
            face.spriteName = _LowDataMgr.instance.GetLowDataIcon((uint)MyGuildInfo.Icon);
        }

        //등수
        UISprite rankMark = MySlot.FindChild("Rankmark").GetComponent <UISprite>();
        UILabel  rank     = MySlot.FindChild("Txt_ranking").GetComponent <UILabel>();

        if (info.Rank > 10000 || info.Rank == 0)
        {
            rank.text = _LowDataMgr.instance.GetStringCommon(193);    //순위권밖
        }
        else
        {
            rank.text = (isGuild && MyGuildInfo.Id <= 0) ? _LowDataMgr.instance.GetStringCommon(133) : string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(521), info.Rank);
        }

        if (info.Rank == 1)
        {
            rank.gradientTop    = oneTop;
            rank.gradientBottom = oneBtm;
            rank.effectColor    = brownEff;

            rankMark.gameObject.SetActive(true);
            rankMark.spriteName = "Img_Rank01";
        }
        else if (info.Rank == 2)
        {
            rank.gradientTop    = towTop;
            rank.gradientBottom = towBtm;
            rank.effectColor    = blueEff;

            rankMark.gameObject.SetActive(true);
            rankMark.spriteName = "Img_Rank02";
        }
        else if (info.Rank == 3)
        {
            rank.gradientTop    = threeTop;
            rank.effectColor    = brownEff;
            rank.gradientBottom = threeBtm;

            rankMark.gameObject.SetActive(true);
            rankMark.spriteName = "Img_Rank03";
        }
        else
        {
            rankMark.gameObject.SetActive(false);

            rank.gradientTop    = Color.white;
            rank.gradientBottom = Color.white;
            rank.color          = Color.white;
            rank.effectColor    = blueEff;
        }

        MySlot.FindChild("Txt_Guildname").GetComponent <UILabel>().text = MyGuildInfo.Id <= 0 ? _LowDataMgr.instance.GetStringCommon(331) : MyGuildInfo.Name;
        MySlot.FindChild("Txt_VIP").GetComponent <UILabel>().text       = isGuild ? "" : string.Format("{0}.{1}", _LowDataMgr.instance.GetStringCommon(460), info.VipLv);

        MySlot.FindChild("Txt_Info").GetComponent <UILabel>().text  = CurChildTapName;
        MySlot.FindChild("Txt_Num").GetComponent <UILabel>().text   = info.Data.ToString();
        MySlot.FindChild("Txt_Level").GetComponent <UILabel>().text = isGuild ? string.Format("{0}", MyGuildInfo.Id <= 0 ? "" : string.Format("{0}.{1}", _LowDataMgr.instance.GetStringCommon(14), MyGuildInfo.guildLv))
            : string.Format("{0}.{1}", _LowDataMgr.instance.GetStringCommon(14), info.Level);
    }
    public void RankingView(int cnt, List <NetData.RankInfo> RankList)
    {
        RankScroll.gameObject.SetActive(RankList.Count > 0 ? true : false);
        if (!RankScroll.gameObject.activeSelf)
        {
            uiMgr.AddPopup(141, 901, 117);
            return;
        }

        //최초호출시 스크롤뷰를 갱신
        if (totalCnt == 0)
        {
            RankScroll.ResetPosition();
        }

        //여러번 호출되기때문에 누적시켜줌
        totalCnt += cnt;
        // 맨처음 호출될때는 0번째슬롯부터 다음부터는 마지막생성된 슬롯부터~ 시작
        for (int i = slotCnt == 0 ? 0 : slotCnt; i < RankTf.childCount; i++)
        {
            if (i >= totalCnt)
            {
                RankTf.transform.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            GameObject slotGo = RankTf.GetChild(i).gameObject;
            Transform  slotTf = slotGo.transform;

            slotGo.SetActive(true);

            NetData.RankInfo info = RankingList[i];

            UISprite icon = slotTf.FindChild("Mark").GetComponent <UISprite>();
            UILabel  name = slotTf.FindChild("Txt_guildname").GetComponent <UILabel>();
            UILabel  rank = slotTf.FindChild("Txt_ranking").GetComponent <UILabel>();

            icon.spriteName = _LowDataMgr.instance.GetLowDataIcon((uint)info.RoleType);
            name.text       = info.Name;
            rank.text       = string.Format(_LowDataMgr.instance.GetStringCommon(522), info.Rank.ToString());

            //길드 가입신청

            bool isJoinGuild = false;
            for (int j = 0; j < JoinList.Count; j++)
            {
                if (JoinList[j] != info.Id)
                {
                    continue;
                }

                isJoinGuild = true;
                break;
            }

            int idx = i;

            UIEventTrigger etri = slotTf.GetComponent <UIEventTrigger>();
            EventDelegate.Set(etri.onClick, delegate()
            {
                //선택
                for (int j = 0; j < RankTf.childCount; j++)
                {
                    RankTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }
            });

            //가입신청버튼은 세종류로.
            //가입신청(215)
            //가입취소(가입승인 대기상태)(233)//
            //가입불가능(레벨불만족일경우)
            //slotTf.FindChild("Btn_join").GetComponent<UISprite>().spriteName = isJoinGuild ? "Btn_Blue01Dis" : "Btn_Blue01";
            slotTf.FindChild("Btn_join/label").GetComponent <UILabel>().text  = _LowDataMgr.instance.GetStringCommon((uint)(isJoinGuild ? 233 : 215));
            slotTf.FindChild("Btn_join").GetComponent <UISprite>().spriteName = CheckLevel ? "Btn_Blue01" : "Btn_Blue01Dis";

            EventDelegate.Set(slotTf.FindChild("Btn_join").GetComponent <UIButton>().onClick, delegate()
            {
                //선택
                for (int j = 0; j < RankTf.childCount; j++)
                {
                    RankTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }
                if (CheckLevel)
                {
                    NetworkClient.instance.SendPMsgGuildApplyGuildC((uint)info.Id, (uint)(isJoinGuild ? 2 : 1));//1가입 2 취소
                }
                else
                {
                    SetClickPopup(945, _LowDataMgr.instance.GetEtcTableValue <string>(EtcID.GuildCondition), null);
                }
                //SetClickPopup(171, null, null);
            });

            //길드정보보기
            EventDelegate.Set(slotTf.FindChild("Btn_search").GetComponent <UIEventTrigger>().onClick, delegate() {
                //선택
                for (int j = 0; j < RankTf.childCount; j++)
                {
                    RankTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }

                NetworkClient.instance.SendPMsgGuildQueryBaseInfoC((uint)info.Id);
            });
        }
        RankTf.GetComponent <UIGrid>().Reposition();
    }