Esempio n. 1
0
    public override void LateInit()
    {
        base.LateInit();

        if (0 < CharInven._GuildId)//길드랄 새로 가입한걸지도 모르니깐
        {
            NetworkClient.instance.SendPMsgGuildQueryBaseInfoC(CharInven._GuildId);
        }
        else//길드를 탈퇴당한걸지도 모르니깐
        {
            MyGuildInfo = new NetData.GuildSimpleInfo(0, 0, null, null, 0, 0, 0, 0, 0, 0);
        }

        if (OpenDay != System.DateTime.Now.Day)
        {
            OpenDay = System.DateTime.Now.Day;
            RankingList.Clear();
            MyRankDic.Clear();
        }

        TabGroup.CoercionTab(0);
        GuildPopGo.SetActive(false);

        SceneManager.instance.sw.Stop();
        SceneManager.instance.showStopWatchTimer("Ranking panel, LateInit() finish");
    }
    //길드기본정보
    public void SetGuildInfo(List <NetData.GuildSimpleInfo> SimpleInfoList)
    {
        MyGuildSimpleInfo = SimpleInfoList[0];

        GuildInfoLabels[(int)eGuildInfoLabel.eGuildName].text   = MyGuildSimpleInfo.Name;
        GuildInfoLabels[(int)eGuildInfoLabel.eMasterName].text  = MyGuildSimpleInfo.LeaderName;
        GuildInfoLabels[(int)eGuildInfoLabel.eMemberCount].text = string.Format("{0}/{1}", MyGuildSimpleInfo.Count.ToString(), _LowDataMgr.instance.GetLowdataGuildInfo(MyGuildSimpleInfo.guildLv).GuildJoinLimit);
        GuildInfoLabels[(int)eGuildInfoLabel.eCreateTime].text  = string.Format(_LowDataMgr.instance.GetStringCommon(577), MyGuildSimpleInfo.CreateTime.ToString().Substring(0, 4), MyGuildSimpleInfo.CreateTime.ToString().Substring(4, 2), MyGuildSimpleInfo.CreateTime.ToString().Substring(6, 2));
        GuildInfoLabels[(int)eGuildInfoLabel.eAttak].text       = MyGuildSimpleInfo.Attack.ToString();

        //아이콘
        BtnMark.GetComponent <UISprite>().spriteName = _LowDataMgr.instance.GetLowDataIcon(MyGuildSimpleInfo.Icon);
        MarkPaging.NowCreate(32);

        isFreeJoinSet = MyGuildSimpleInfo.JoinSet == 2;
        GuildJoinLv   = (int)MyGuildSimpleInfo.JoinLevel;
    }
Esempio n. 3
0
    public void OnMyGuildInfo(NetData.GuildSimpleInfo simpleInfo)
    {
        if (simpleInfo.Id.Equals(CharInven._GuildId))//이렇게 확인한다.
        {
            MyGuildInfo = simpleInfo;
        }
        else//내꺼와 다르다면 상대 길드 정보를 요청한것.
        {
            GuildPopGo.SetActive(true);

            GuildInfo[0].text = simpleInfo.Name;
            GuildInfo[1].text = simpleInfo.LeaderName;
            GuildInfo[2].text = string.Format("{0}/{1}", simpleInfo.Count.ToString(), _LowDataMgr.instance.GetLowdataGuildInfo(simpleInfo.guildLv).GuildJoinLimit); // ToString("#,##");

            GuildMark.spriteName = _LowDataMgr.instance.GetLowDataIcon(simpleInfo.Icon);

            GuildState[0].text = string.Format(_LowDataMgr.instance.GetStringCommon(577), simpleInfo.CreateTime.ToString().Substring(0, 4), simpleInfo.CreateTime.ToString().Substring(4, 2), simpleInfo.CreateTime.ToString().Substring(6, 2));
            GuildState[1].text = simpleInfo.Attack.ToString();
        }
    }
    /// <summary> 길드 정보 </summary>
    public void OnGuildDetailInfo(NetData.GuildSimpleInfo simpleInfo)
    {
        ActivePopups(1);
        Popup[1].transform.FindChild("Main").gameObject.SetActive(true);
        //Popup[1].transform.FindChild("Make").gameObject.SetActive(false);

        Transform infoTf = Popup[1].transform.FindChild("Main");

        infoTf.FindChild("Info/guild_name").GetComponent <UILabel>().text  = simpleInfo.Name;
        infoTf.FindChild("Info/master_name").GetComponent <UILabel>().text = simpleInfo.LeaderName;
        //   infoTf.FindChild("Info/declaration").GetComponent<UILabel>().text = simpleInfo.Declaration;

        infoTf.FindChild("Info/mark").GetComponent <UISprite>().spriteName = _LowDataMgr.instance.GetLowDataIcon(simpleInfo.Icon);

        infoTf.FindChild("Info/guildStr").GetComponent <UILabel>().text  = simpleInfo.Attack.ToString();
        infoTf.FindChild("Info/guildmake").GetComponent <UILabel>().text = string.Format(_LowDataMgr.instance.GetStringCommon(577), simpleInfo.CreateTime.ToString().Substring(0, 4), simpleInfo.CreateTime.ToString().Substring(4, 2), simpleInfo.CreateTime.ToString().Substring(6, 2));
        //simpleInfo.CreateTime.ToString();
        // infoTf.FindChild("BtnRanking/label").GetComponent<UILabel>().text = string.Format("{0}", _LowDataMgr.instance.GetStringCommon(560) );
        infoTf.FindChild("Info/mamber").GetComponent <UILabel>().text = string.Format("{0}/{1}", simpleInfo.Count.ToString(), _LowDataMgr.instance.GetLowdataGuildInfo(simpleInfo.guildLv).GuildJoinLimit); // ToString("#,##");


        NetworkClient.instance.SendPMsgGuildQueryDetailedInfoC(simpleInfo.Id);
    }
    void SetRecommendList(bool isResetView)
    {
        if (!TabObj[1].activeSelf)
        {
            TabObj[0].gameObject.SetActive(false);
            TabObj[1].gameObject.SetActive(true);
        }

        int count = ListTf.childCount, setCount = 0;

        for (int i = 0; i < count; i++)
        {
            if (RecommendList.Count <= i)
            {
                ListTf.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            Transform tf = ListTf.GetChild(i);
            NetData.GuildSimpleInfo info = RecommendList[i];

            if (ToggleFreeJoin.value)
            {
                if (info.JoinSet == 1)//심사가입
                {
                    tf.gameObject.SetActive(false);
                    continue;
                }
            }

            tf.FindChild("Mark").GetComponent <UISprite>().spriteName = _LowDataMgr.instance.GetLowDataIcon(info.Icon);

            tf.FindChild("Txt_guildname").GetComponent <UILabel>().text = info.Name;
            tf.FindChild("Txt_master").GetComponent <UILabel>().text    = info.LeaderName;
            //tf.FindChild("Txt_info").GetComponent<UILabel>().text = info.;
            tf.FindChild("Txt_num").GetComponent <UILabel>().text = string.Format("{0}/{1}", info.Count, _LowDataMgr.instance.GetLowdataGuildInfo(info.guildLv).GuildJoinLimit);


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

                isJoinGuild = true;
                break;
            }

            //tf.FindChild("Btn").GetComponent<UISprite>().spriteName = isJoinGuild ? "Btn_Blue02Dis" : "Btn_Blue02";

            //가입신청버튼은 세종류로.
            //가입신청(215)
            //가입취소(가입승인 대기상태)(233)//
            //가입불가능(레벨불만족일경우)

            tf.FindChild("Btn/label").GetComponent <UILabel>().text  = _LowDataMgr.instance.GetStringCommon((uint)(isJoinGuild ? 233 : 215));
            tf.FindChild("Btn").GetComponent <UISprite>().spriteName = CheckLevel ? "Btn_Blue01" :"Btn_Blue01Dis";

            int idx = i;

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

            EventDelegate.Set(tf.FindChild("Btn").GetComponent <UIButton>().onClick, delegate() {
                //선택
                for (int j = 0; j < count; j++)
                {
                    ListTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }

                //가입레벨이 길드마다다르므로 체크레벨 비교..
                uint needLv = info.JoinLevel;
                if (NetData.instance.UserLevel >= needLv)
                {
                    NetworkClient.instance.SendPMsgGuildApplyGuildC(info.Id, (uint)(isJoinGuild ? 2 : 1)); //1가입 2 취소
                }
                else
                {
                    SetClickPopup(945, needLv.ToString(), null);
                }
                //SetClickPopup(171, null, null);
            });

            EventDelegate.Set(tf.FindChild("BtnInfo").GetComponent <UIEventTrigger>().onClick, delegate() {
                //선택
                for (int j = 0; j < count; j++)
                {
                    ListTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }
                OnGuildDetailInfo(info);
            });

            ++setCount;
            tf.gameObject.SetActive(true);
        }

        if (isResetView)
        {
            ListTf.parent.GetComponent <UIScrollView>().ResetPosition();
            ListTf.GetComponent <UIGrid>().repositionNow      = true;
            ListTf.parent.GetComponent <UIPanel>().clipOffset = Vector3.zero;
            ListTf.parent.GetComponent <UIPanel>().transform.localPosition = Vector3.zero;
        }

        ListTf.parent.GetComponent <UIScrollView>().enabled = setCount > 4;

        if (setCount == 0)
        {
            NotFoundGuildName.text = _LowDataMgr.instance.GetStringCommon(579);
        }
        else
        {
            NotFoundGuildName.text = "";
        }
    }