예제 #1
0
        public string GetAchievementDesc()
        {
            string szDesc = this.Cfg.szDesc;

            if (this.Cfg.dwDoneType == 41u)
            {
                return(string.Format(szDesc, CLadderView.GetRankName((byte)this.Cfg.dwDoneCondi, this.Cfg.dwDoneParm)));
            }
            if (this.Cfg.dwDoneParm == 0u)
            {
                if (this.Cfg.bShowProcess > 0 && !this.IsFinish())
                {
                    return(string.Format("{0}\n({1}/{2})", string.Format(szDesc, this.Cfg.dwDoneCondi), this.DoneCnt, this.Cfg.dwDoneCondi));
                }
                return(string.Format(szDesc, this.Cfg.dwDoneCondi));
            }
            else
            {
                if (this.Cfg.bShowProcess > 0 && !this.IsFinish())
                {
                    return(string.Format("{0}\n({1}/{2})", string.Format(szDesc, this.Cfg.dwDoneCondi, this.Cfg.dwDoneParm), this.DoneCnt, this.Cfg.dwDoneCondi));
                }
                return(string.Format(szDesc, this.Cfg.dwDoneCondi, this.Cfg.dwDoneParm));
            }
        }
예제 #2
0
        public static void ShowRankDetail(GameObject go, byte rankGrade, uint rankClass, bool isGrey = false, bool isUseSmall = false)
        {
            DebugHelper.Assert(go != null, "GameObject is NULL!!!");
            DebugHelper.Assert(rankGrade > 0, "grade must be above 0!!!");
            Image image  = go.transform.Find("ImgRank") ? go.transform.Find("ImgRank").GetComponent <Image>() : null;
            Image image2 = go.transform.Find("ImgSubRank") ? go.transform.Find("ImgSubRank").GetComponent <Image>() : null;
            Text  text   = go.transform.Find("txtRankName") ? go.transform.Find("txtRankName").GetComponent <Text>() : null;

            if (image)
            {
                string rankIconPath = CLadderView.GetRankIconPath(rankGrade, rankClass);
                image.SetSprite((!isUseSmall) ? rankIconPath : string.Format("{0}_small", rankIconPath), null, true, false, false, false);
                image.gameObject.CustomSetActive(true);
                CUIUtility.SetImageGrey(image, isGrey);
            }
            if (image2)
            {
                image2.SetSprite(CLadderView.GetSubRankIconPath(rankGrade, rankClass), null, true, false, false, false);
                image2.gameObject.CustomSetActive(true);
                CUIUtility.SetImageGrey(image2, isGrey);
            }
            if (text)
            {
                text.set_text(CLadderView.GetRankName(rankGrade, rankClass));
                CUIUtility.SetImageGrey(text, isGrey);
            }
        }
예제 #3
0
        public static string GetLadderGradeLimitText(int gradeLimit)
        {
            string result = string.Empty;

            if (gradeLimit > 1)
            {
                result = CLadderView.GetRankName((byte)gradeLimit, 0u);
            }
            else if (gradeLimit == 1)
            {
                result = Singleton <CTextManager> .GetInstance().GetText("Guild_No_Grade_Limit_Tip");
            }
            return(result);
        }
        public static string GetLadderGradeLimitText(int gradeLimit)
        {
            string result      = string.Empty;
            int    bLogicGrade = (int)CLadderSystem.GetGradeDataByShowGrade(gradeLimit).bLogicGrade;

            if (bLogicGrade > 1)
            {
                result = CLadderView.GetRankName((byte)gradeLimit, 0u);
            }
            else if (bLogicGrade == 1)
            {
                result = Singleton <CTextManager> .GetInstance().GetText("Guild_No_Grade_Limit_Tip");
            }
            return(result);
        }
예제 #5
0
        public static void InitLadderHistory(CUIFormScript form, List <COMDT_RANK_PASTSEASON_FIGHT_RECORD> dataList)
        {
            CUIListScript component = form.transform.Find("ExpandList").GetComponent <CUIListScript>();

            if (dataList == null)
            {
                component.SetElementAmount(0);
            }
            else
            {
                component.SetElementAmount(dataList.get_Count());
                for (int i = 0; i < dataList.get_Count(); i++)
                {
                    CUIListElementScript elemenet = component.GetElemenet(i);
                    COMDT_RANK_PASTSEASON_FIGHT_RECORD cOMDT_RANK_PASTSEASON_FIGHT_RECORD = dataList.get_Item(i);
                    Text component2 = elemenet.transform.Find("Title/txtLeagueTime").GetComponent <Text>();
                    Text component3 = elemenet.transform.Find("Title/txtRankTitle").GetComponent <Text>();
                    Text component4 = elemenet.transform.Find("Title/txtHeroes").GetComponent <Text>();
                    Text component5 = elemenet.transform.Find("Expand/txtGameNum").GetComponent <Text>();
                    Text component6 = elemenet.transform.Find("Expand/txtWinNum").GetComponent <Text>();
                    Text component7 = elemenet.transform.Find("Expand/txtWinRate").GetComponent <Text>();
                    Text component8 = elemenet.transform.Find("Expand/txtContiWinNum").GetComponent <Text>();
                    component2.set_text(CLadderView.GetSeasonNameWithBracket((ulong)cOMDT_RANK_PASTSEASON_FIGHT_RECORD.dwSeaStartTime) + " " + CLadderView.GetSeasonText(ref cOMDT_RANK_PASTSEASON_FIGHT_RECORD));
                    component3.set_text(CLadderView.GetRankName(ref cOMDT_RANK_PASTSEASON_FIGHT_RECORD));
                    List <COMDT_RANK_COMMON_USED_HERO> list = new List <COMDT_RANK_COMMON_USED_HERO>();
                    component4.set_text(CLadderView.GetTopUseHeroNames(ref cOMDT_RANK_PASTSEASON_FIGHT_RECORD, out list));
                    component5.set_text(cOMDT_RANK_PASTSEASON_FIGHT_RECORD.dwTotalFightCnt.ToString());
                    component6.set_text(cOMDT_RANK_PASTSEASON_FIGHT_RECORD.dwTotalWinCnt.ToString());
                    component7.set_text((cOMDT_RANK_PASTSEASON_FIGHT_RECORD.dwTotalFightCnt > 0u) ? string.Format("{0}%", (cOMDT_RANK_PASTSEASON_FIGHT_RECORD.dwTotalWinCnt * 100f / cOMDT_RANK_PASTSEASON_FIGHT_RECORD.dwTotalFightCnt).ToString("0.00")) : "0.00%");
                    component8.set_text(cOMDT_RANK_PASTSEASON_FIGHT_RECORD.dwMaxContinuousWinCnt.ToString());
                    int num = (list.get_Count() > 4) ? 4 : list.get_Count();
                    for (int j = 0; j < num; j++)
                    {
                        Transform transform = elemenet.transform.Find(string.Format("Expand/Hero{0}", j + 1));
                        transform.gameObject.CustomSetActive(true);
                        COMDT_RANK_COMMON_USED_HERO cOMDT_RANK_COMMON_USED_HERO = list.get_Item(j);
                        CLadderView.SetMostUsedHero(transform, ref cOMDT_RANK_COMMON_USED_HERO, form);
                    }
                    for (int k = num; k < 4; k++)
                    {
                        Transform transform2 = elemenet.transform.Find(string.Format("Expand/Hero{0}", k + 1));
                        transform2.gameObject.CustomSetActive(false);
                    }
                }
            }
        }
예제 #6
0
 private static string GetRankName(ref COMDT_RANK_PASTSEASON_FIGHT_RECORD data)
 {
     return(CLadderView.GetRankName(data.bGrade, data.dwClassOfRank));
 }
예제 #7
0
        public static void ShowRankDetail(GameObject go, byte rankGrade, uint rankClass, uint score, bool bShowScore = true, bool useSmall = false, bool isLadderRewardForm = false, bool isUseSpecialColorWhenSuperKing = false, bool isImgSamll = true)
        {
            DebugHelper.Assert(go != null, "GameObject is NULL!!!");
            Image image       = go.transform.Find("ImgRank") ? go.transform.Find("ImgRank").GetComponent <Image>() : null;
            Image image2      = go.transform.Find("ImgSubRank") ? go.transform.Find("ImgSubRank").GetComponent <Image>() : null;
            Text  text        = go.transform.Find("txtRankName") ? go.transform.Find("txtRankName").GetComponent <Text>() : null;
            Text  text2       = go.transform.Find("txtTopGroupScore") ? go.transform.Find("txtTopGroupScore").GetComponent <Text>() : null;
            byte  bLogicGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade).bLogicGrade;

            if (image)
            {
                string rankIconPath = CLadderView.GetRankIconPath(rankGrade, rankClass);
                string text3        = "{0}";
                if (isImgSamll)
                {
                    text3 += "_small";
                }
                image.SetSprite((!useSmall) ? rankIconPath : string.Format(text3, rankIconPath), null, true, false, false, false);
                image.gameObject.CustomSetActive(true);
            }
            if (image2)
            {
                if (isLadderRewardForm && (int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    image2.gameObject.CustomSetActive(false);
                }
                else
                {
                    image2.SetSprite(CLadderView.GetSubRankIconPath(rankGrade, rankClass), null, true, false, false, false);
                    image2.gameObject.CustomSetActive(true);
                }
            }
            if (text)
            {
                text.set_text(CLadderView.GetRankName(rankGrade, rankClass));
                if (isUseSpecialColorWhenSuperKing && CLadderView.IsSuperKing(rankGrade, rankClass))
                {
                    text.set_text("<color=#feba29>" + text.get_text() + "</color>");
                }
            }
            if (text2)
            {
                if ((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    text2.set_text(string.Format("x{0}", score));
                }
                text2.gameObject.CustomSetActive((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL);
            }
            Transform transform = go.transform.Find("ScoreCon");

            if (!transform)
            {
                return;
            }
            if ((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL || !bShowScore)
            {
                transform.gameObject.CustomSetActive(false);
            }
            else
            {
                transform.Find("Con3Star").gameObject.CustomSetActive(false);
                transform.Find("Con4Star").gameObject.CustomSetActive(false);
                transform.Find("Con5Star").gameObject.CustomSetActive(false);
                ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade);
                if (gradeDataByShowGrade != null)
                {
                    Transform transform2 = transform.Find(string.Format("Con{0}Star", gradeDataByShowGrade.dwGradeUpNeedScore));
                    if (transform2)
                    {
                        transform2.gameObject.CustomSetActive(true);
                        int num = 1;
                        while ((long)num <= (long)((ulong)gradeDataByShowGrade.dwGradeUpNeedScore))
                        {
                            Image  component  = transform2.Find(string.Format("ImgScore{0}", num)).GetComponent <Image>();
                            string prefabPath = ((ulong)score >= (ulong)((long)num)) ? CLadderView.LADDER_IMG_STAR : CLadderView.LADDER_IMG_STAR_EMPTY;
                            if (component)
                            {
                                component.SetSprite(prefabPath, null, true, false, false, false);
                            }
                            num++;
                        }
                    }
                }
                transform.gameObject.CustomSetActive(true);
            }
        }
예제 #8
0
        public static void ShowRankDetail(GameObject go, byte rankGrade, uint rankClass, uint score, bool bShowScore = true, bool useSmall = false, bool isLadderRewardForm = false, bool isUseSpecialColorWhenSuperKing = false, bool isImgSamll = true)
        {
            DebugHelper.Assert(go != null, "GameObject is NULL!!!");
            DebugHelper.Assert(rankGrade > 0, "grade must be above 0!!!");
            Image image  = (!go.transform.Find("ImgRank")) ? null : go.transform.Find("ImgRank").GetComponent <Image>();
            Image image2 = (!go.transform.Find("ImgSubRank")) ? null : go.transform.Find("ImgSubRank").GetComponent <Image>();
            Text  text   = (!go.transform.Find("txtRankName")) ? null : go.transform.Find("txtRankName").GetComponent <Text>();
            Text  text2  = (!go.transform.Find("txtTopGroupScore")) ? null : go.transform.Find("txtTopGroupScore").GetComponent <Text>();

            if (image)
            {
                string rankIconPath = CLadderView.GetRankIconPath(rankGrade, rankClass);
                string text3        = "{0}";
                if (isImgSamll)
                {
                    text3 += "_small";
                }
                image.SetSprite(useSmall ? string.Format(text3, rankIconPath) : rankIconPath, null, true, false, false, false);
                image.gameObject.CustomSetActive(true);
            }
            if (image2)
            {
                if (isLadderRewardForm && (int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    image2.gameObject.CustomSetActive(false);
                }
                else
                {
                    image2.SetSprite(CLadderView.GetSubRankIconPath(rankGrade, rankClass), null, true, false, false, false);
                    image2.gameObject.CustomSetActive(true);
                }
            }
            if (text)
            {
                text.text = CLadderView.GetRankName(rankGrade, rankClass);
                if (isUseSpecialColorWhenSuperKing && CLadderView.IsSuperKing(rankGrade, rankClass))
                {
                    text.text = "<color=#feba29>" + text.text + "</color>";
                }
            }
            if (text2)
            {
                if ((int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    text2.text = string.Format("x{0}", score);
                }
                text2.gameObject.CustomSetActive((int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL);
            }
            Transform transform = go.transform.Find("ScoreCon");

            if (!transform)
            {
                return;
            }
            if ((int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL || !bShowScore)
            {
                transform.gameObject.CustomSetActive(false);
            }
            else
            {
                transform.Find("Con3Star").gameObject.CustomSetActive(false);
                transform.Find("Con4Star").gameObject.CustomSetActive(false);
                transform.Find("Con5Star").gameObject.CustomSetActive(false);
                ResRankGradeConf dataByKey = GameDataMgr.rankGradeDatabin.GetDataByKey((uint)rankGrade);
                if (dataByKey != null)
                {
                    Transform transform2 = transform.Find(string.Format("Con{0}Star", dataByKey.dwGradeUpNeedScore));
                    if (transform2)
                    {
                        transform2.gameObject.CustomSetActive(true);
                        int num = 1;
                        while ((long)num <= (long)((ulong)dataByKey.dwGradeUpNeedScore))
                        {
                            Image  component  = transform2.Find(string.Format("ImgScore{0}", num)).GetComponent <Image>();
                            string prefabPath = ((ulong)score < (ulong)((long)num)) ? CLadderView.LADDER_IMG_STAR_EMPTY : CLadderView.LADDER_IMG_STAR;
                            if (component)
                            {
                                component.SetSprite(prefabPath, null, true, false, false, false);
                            }
                            num++;
                        }
                    }
                }
                transform.gameObject.CustomSetActive(true);
            }
        }