示例#1
0
        public static void InitLadderRecent(CUIFormScript form, List <COMDT_RANK_CURSEASON_FIGHT_RECORD> dataList)
        {
            CUIListScript component = form.transform.Find("Root/List").GetComponent <CUIListScript>();

            if (dataList == null)
            {
                component.SetElementAmount(0);
            }
            else
            {
                int num = (dataList.get_Count() < 10) ? dataList.get_Count() : 10;
                component.SetElementAmount(num);
                for (int i = 0; i < num; i++)
                {
                    CUIListElementScript elemenet = component.GetElemenet(i);
                    COMDT_RANK_CURSEASON_FIGHT_RECORD cOMDT_RANK_CURSEASON_FIGHT_RECORD = dataList.get_Item(i);
                    DebugHelper.Assert(cOMDT_RANK_CURSEASON_FIGHT_RECORD != null);
                    Image component2 = elemenet.transform.Find("imageIcon").GetComponent <Image>();
                    Text  component3 = elemenet.transform.Find("txtResult").GetComponent <Text>();
                    Text  component4 = elemenet.transform.Find("txtBraveScore").GetComponent <Text>();
                    Text  component5 = elemenet.transform.Find("txtTime").GetComponent <Text>();
                    Text  component6 = elemenet.transform.Find("txtKDA").GetComponent <Text>();
                    CLadderView.SetWinLose(component3, ref cOMDT_RANK_CURSEASON_FIGHT_RECORD);
                    component4.set_text(cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwAddStarScore.ToString());
                    component5.set_text(CLadderView.GetGameTime(ref cOMDT_RANK_CURSEASON_FIGHT_RECORD));
                    component6.set_text(string.Format("{0} / {1} / {2}", cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwKillNum, cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwDeadNum, cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwAssistNum));
                    ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwHeroId);
                    if (dataByKey != null)
                    {
                        component2.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), form, true, false, false, false);
                        Utility.FindChild(component2.gameObject, "FiveFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 5);
                        Utility.FindChild(component2.gameObject, "FourFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 4);
                        Utility.FindChild(component2.gameObject, "ThreeFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 3);
                        Utility.FindChild(component2.gameObject, "TwoFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 2);
                        Utility.FindChild(component2.gameObject, "Bp").CustomSetActive(Convert.ToBoolean(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bIsBanPick));
                    }
                    for (int j = 0; j < 6; j++)
                    {
                        COMDT_INGAME_EQUIP_INFO cOMDT_INGAME_EQUIP_INFO = null;
                        if (j < (int)cOMDT_RANK_CURSEASON_FIGHT_RECORD.bEquipNum)
                        {
                            cOMDT_INGAME_EQUIP_INFO = cOMDT_RANK_CURSEASON_FIGHT_RECORD.astEquipDetail[j];
                        }
                        Image component7 = elemenet.transform.FindChild(string.Format("TianFu/TianFuIcon{0}", (j + 1).ToString())).GetComponent <Image>();
                        if (cOMDT_INGAME_EQUIP_INFO == null || cOMDT_INGAME_EQUIP_INFO.dwEquipID == 0u)
                        {
                            component7.gameObject.CustomSetActive(false);
                        }
                        else
                        {
                            component7.gameObject.CustomSetActive(true);
                            CUICommonSystem.SetEquipIcon((ushort)cOMDT_INGAME_EQUIP_INFO.dwEquipID, component7.gameObject, form);
                        }
                    }
                }
            }
        }
示例#2
0
        public static void InitLadderRecent(CUIFormScript form, List <COMDT_RANK_CURSEASON_FIGHT_RECORD> dataList)
        {
            CUIListScript component = form.transform.Find("Root/List").GetComponent <CUIListScript>();

            if (dataList == null)
            {
                component.SetElementAmount(0);
            }
            else
            {
                int amount = (dataList.Count >= 10) ? 10 : dataList.Count;
                component.SetElementAmount(amount);
                CUIListElementScript elemenet = null;
                for (int i = 0; i < amount; i++)
                {
                    elemenet = component.GetElemenet(i);
                    COMDT_RANK_CURSEASON_FIGHT_RECORD data = dataList[i];
                    DebugHelper.Assert(data != null);
                    Image image  = elemenet.transform.Find("imageIcon").GetComponent <Image>();
                    Text  result = elemenet.transform.Find("txtResult").GetComponent <Text>();
                    Text  text2  = elemenet.transform.Find("txtTime").GetComponent <Text>();
                    Text  text3  = elemenet.transform.Find("txtKDA").GetComponent <Text>();
                    SetWinLose(result, ref data);
                    text2.text = GetGameTime(ref data);
                    text3.text = string.Format("{0}  /  {1}  /  {2}", data.dwKillNum, data.dwDeadNum, data.dwAssistNum);
                    ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(data.dwHeroId);
                    if (dataByKey != null)
                    {
                        image.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), form, true, false, false);
                        Utility.FindChild(image.gameObject, "Friend").CustomSetActive(data.bTeamerNum > 1);
                    }
                    for (int j = 0; j < 6; j++)
                    {
                        COMDT_INGAME_EQUIP_INFO comdt_ingame_equip_info = null;
                        if (j < data.bEquipNum)
                        {
                            comdt_ingame_equip_info = data.astEquipDetail[j];
                        }
                        int   num4   = j + 1;
                        Image image2 = elemenet.transform.FindChild(string.Format("TianFu/TianFuIcon{0}", num4.ToString())).GetComponent <Image>();
                        if ((comdt_ingame_equip_info == null) || (comdt_ingame_equip_info.dwEquipID == 0))
                        {
                            image2.gameObject.CustomSetActive(false);
                        }
                        else
                        {
                            image2.gameObject.CustomSetActive(true);
                            CUICommonSystem.SetEquipIcon((ushort)comdt_ingame_equip_info.dwEquipID, image2.gameObject, form);
                        }
                    }
                }
            }
        }
示例#3
0
 public void SetEuipItems(ref COMDT_PLAYER_FIGHT_DATA playerData, CUIFormScript form)
 {
     if ((playerData != null) && (form != null))
     {
         for (int i = 0; i < 6; i++)
         {
             COMDT_INGAME_EQUIP_INFO comdt_ingame_equip_info = playerData.astEquipDetail[i];
             int   num2      = i + 1;
             Image component = this.equipObj.transform.FindChild(string.Format("TianFuIcon{0}", num2.ToString())).GetComponent <Image>();
             if ((comdt_ingame_equip_info.dwEquipID == 0) || (comdt_ingame_equip_info == null))
             {
                 component.gameObject.CustomSetActive(false);
             }
             else
             {
                 component.gameObject.CustomSetActive(true);
                 CUICommonSystem.SetEquipIcon((ushort)comdt_ingame_equip_info.dwEquipID, component.gameObject, form);
             }
         }
     }
 }
 public void SetEuipItems(ref COMDT_PLAYER_FIGHT_DATA playerData, CUIFormScript form)
 {
     if (playerData == null || form == null)
     {
         return;
     }
     for (int i = 0; i < 6; i++)
     {
         COMDT_INGAME_EQUIP_INFO cOMDT_INGAME_EQUIP_INFO = playerData.astEquipDetail[i];
         Image component = this.equipObj.transform.FindChild(string.Format("TianFuIcon{0}", (i + 1).ToString())).GetComponent <Image>();
         if (cOMDT_INGAME_EQUIP_INFO.dwEquipID == 0u || cOMDT_INGAME_EQUIP_INFO == null)
         {
             component.gameObject.CustomSetActive(false);
         }
         else
         {
             component.gameObject.CustomSetActive(true);
             CUICommonSystem.SetEquipIcon((ushort)cOMDT_INGAME_EQUIP_INFO.dwEquipID, component.gameObject, form);
         }
     }
 }