Exemplo n.º 1
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);
                    }
                }
            }
        }