Exemplo n.º 1
0
        public static void InitLevelList(CUIFormScript form, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                ResChapterInfo dataByKey = GameDataMgr.chapterInfoDatabin.GetDataByKey(currentChapter);
                DebugHelper.Assert(dataByKey != null);
                bool flag = Singleton <CFunctionUnlockSys> .instance.ChapterIsUnlock(dataByKey.dwChapterId);

                PVE_ADV_COMPLETE_INFO     pve_adv_complete_info     = masterRoleInfo.pveLevelDetail[difficulty - 1];
                PVE_CHAPTER_COMPLETE_INFO pve_chapter_complete_info = pve_adv_complete_info.ChapterDetailList[currentChapter - 1];
                PVE_LEVEL_COMPLETE_INFO[] levelDetailList           = pve_chapter_complete_info.LevelDetailList;
                CUIListScript             component = form.transform.FindChild("LevelList").GetComponent <CUIListScript>();
                component.SetElementAmount(levelDetailList.Length);
                CUIListElementScript elemenet = null;
                Sprite     sprite             = CUIUtility.GetSpritePrefeb(GetLevelFramePath(difficulty), false, false).GetComponent <SpriteRenderer>().sprite;
                GameObject prefab             = CUIUtility.GetSpritePrefeb(GetLevelSelectFramePath(difficulty), false, false);
                for (int i = 0; i < levelDetailList.Length; i++)
                {
                    elemenet = component.GetElemenet(i);
                    ResLevelCfgInfo info3        = GameDataMgr.levelDatabin.GetDataByKey(levelDetailList[i].iLevelID);
                    object[]        inParameters = new object[] { levelDetailList[i].iLevelID };
                    DebugHelper.Assert(info3 != null, "Can't find LevelConfig = {0}", inParameters);
                    bool bActive = (levelDetailList[i].levelStatus == 0) || !flag;
                    bool flag3   = (levelDetailList[i].levelStatus == 1) && flag;
                    int  starNum = CAdventureSys.GetStarNum(levelDetailList[i].bStarBits);
                    elemenet.transform.FindChild("Unlock/star1").GetComponent <Image>().color   = (starNum < 1) ? CUIUtility.s_Color_GrayShader : Color.white;
                    elemenet.transform.FindChild("Unlock/star2").GetComponent <Image>().color   = (starNum < 2) ? CUIUtility.s_Color_GrayShader : Color.white;
                    elemenet.transform.FindChild("Unlock/star3").GetComponent <Image>().color   = (starNum < 3) ? CUIUtility.s_Color_GrayShader : Color.white;
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().text = Utility.UTF8Convert(info3.szName);
                    if ((levelNo == (i + 1)) && !bActive)
                    {
                        elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().color = s_Adv_Level_Colors[0];
                    }
                    else if (!bActive)
                    {
                        elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().color = s_Adv_Level_Colors[1];
                    }
                    else
                    {
                        elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().color = s_Adv_Level_Colors[2];
                    }
                    elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().color        = s_Adv_Difficult_Color[difficulty - 1];
                    elemenet.transform.FindChild("SelectedFrame/Image1").GetComponent <Image>().color = s_Adv_Difficult_Color[((s_Adv_Difficult_Color.Length / 2) + difficulty) - 1];
                    elemenet.transform.FindChild("SelectedFrame/Image2").GetComponent <Image>().color = s_Adv_Difficult_Color[((s_Adv_Difficult_Color.Length / 2) + difficulty) - 1];
                    elemenet.transform.FindChild("SelectedFrame/SelectedFrame").GetComponent <Image>().SetSprite(prefab);
                    elemenet.transform.FindChild("New").gameObject.CustomSetActive(flag3);
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectLevel;
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                    elemenet.transform.FindChild("Unlock").gameObject.CustomSetActive(!bActive);
                    elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(bActive);
                    elemenet.m_selectedSprite = sprite;
                    elemenet.GetComponent <Image>().SetSprite(((levelNo - 1) != i) ? elemenet.m_defaultSprite : sprite, elemenet.m_selectedLayout);
                }
                component.SelectElement(levelNo - 1, true);
            }
        }
Exemplo n.º 2
0
        public static void InitChapterList(CUIFormScript formScript, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                CUIListScript             component             = formScript.transform.FindChild("ChapterList").GetComponent <CUIListScript>();
                PVE_ADV_COMPLETE_INFO     pve_adv_complete_info = masterRoleInfo.pveLevelDetail[difficulty - 1];
                PVE_CHAPTER_COMPLETE_INFO chapterInfo           = null;
                CUIListElementScript      elemenet = null;
                int    stars       = 0;
                string prefabPath  = string.Empty;
                string chapterName = string.Empty;
                component.SetElementAmount(CAdventureSys.CHAPTER_NUM);
                for (int i = 0; i < CAdventureSys.CHAPTER_NUM; i++)
                {
                    ResChapterInfo dataByIndex = GameDataMgr.chapterInfoDatabin.GetDataByIndex(i);
                    DebugHelper.Assert(dataByIndex != null);
                    bool bActive = Singleton <CFunctionUnlockSys> .instance.ChapterIsUnlock(dataByIndex.dwChapterId);

                    bool flag2 = i == (Singleton <CAdventureSys> .instance.bNewChapterId - 1);
                    chapterInfo = pve_adv_complete_info.ChapterDetailList[i];
                    elemenet    = component.GetElemenet(i);
                    stars       = CAdventureSys.GetChapterTotalStar(chapterInfo);
                    SetRewardItem(elemenet.gameObject, chapterInfo, stars, i);
                    chapterName = GetChapterName(i + 1);
                    elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().text = chapterName;
                    if ((currentChapter == (i + 1)) && bActive)
                    {
                        elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().color = s_Adv_Chaptper_Colors[0];
                    }
                    else if (bActive)
                    {
                        elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().color = s_Adv_Chaptper_Colors[1];
                    }
                    else
                    {
                        elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().color = s_Adv_Chaptper_Colors[2];
                    }
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectChapter;
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                    elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(!bActive);
                    elemenet.transform.FindChild("Unlock").gameObject.CustomSetActive(bActive);
                    prefabPath = GetChapterBgPath(i + 1);
                    elemenet.transform.FindChild("BackgroundImg").GetComponent <Image>().SetSprite(prefabPath, component.m_belongedFormScript, true, false, false);
                    elemenet.transform.FindChild("Lock/SelectedImg").GetComponent <Image>().SetSprite(prefabPath, component.m_belongedFormScript, true, false, false);
                    elemenet.transform.FindChild("Lock/LockText").GetComponent <Text>().text = Utility.UTF8Convert(dataByIndex.szLockedTip);
                    elemenet.transform.FindChild("New").gameObject.CustomSetActive(flag2);
                }
                component.SelectElement(currentChapter - 1, true);
                component.MoveElementInScrollArea(currentChapter - 1, true);
            }
        }
Exemplo n.º 3
0
 public override void Validate()
 {
     this._urlaList = UrlAction.ParseFromText(base.view.activity.Content, null);
     if (this._urlaList.Count > 0)
     {
         this._stepList.SetElementAmount(this._urlaList.Count);
         for (int i = 0; i < this._urlaList.Count; i++)
         {
             UrlAction            action   = this._urlaList[i];
             CUIListElementScript elemenet = this._stepList.GetElemenet(i);
             if (null != elemenet)
             {
                 CUIHttpImageScript component = elemenet.GetComponent <CUIHttpImageScript>();
                 if (null != component)
                 {
                     component.SetImageUrl(action.target);
                 }
             }
         }
         this._curStepIndex = 0;
         this._leftToRight  = true;
         this._stepList.MoveElementInScrollArea(this._curStepIndex, true);
         this._lastScrollTime = Time.time;
         this.updateOverTime();
     }
 }
Exemplo n.º 4
0
 private void _refresh_list(CUIListScript listScript, ListView <COMDT_FRIEND_INFO> data_list, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friend)
 {
     if (listScript != null)
     {
         int count = data_list.Count;
         listScript.SetElementAmount(count);
         for (int i = 0; i < count; i++)
         {
             CUIListElementScript elemenet = listScript.GetElemenet(i);
             if ((elemenet != null) && listScript.IsElementInScrollArea(i))
             {
                 FriendShower      component = elemenet.GetComponent <FriendShower>();
                 COMDT_FRIEND_INFO info      = data_list[i];
                 if ((component != null) && (info != null))
                 {
                     UT.ShowFriendData(info, component, type, bShowNickName, friend);
                     if (component.sendHeartButton != null)
                     {
                         if (friend == CFriendModel.FriendType.GameFriend)
                         {
                             component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SendCoin;
                         }
                         else if (friend == CFriendModel.FriendType.SNS)
                         {
                             component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SNS_SendCoin;
                         }
                         component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = info.stUin.ullUid;
                         component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = info.stUin.dwLogicWorldId;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 5
0
        public static void InitExloreList(CUIFormScript form)
        {
            if (form != null)
            {
                int length = s_eventIDs.Length;
                CUIListElementScript elemenet  = null;
                CUIStepListScript    component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>();
                component.SetElementAmount(length);
                for (int i = 0; i < length; i++)
                {
                    elemenet = component.GetElemenet(i);
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID = s_eventIDs[i];
                    elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(s_exploreTypes[i]);

                    elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>().color = s_exploreColors[i];
                    Image      image  = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>();
                    GameObject prefab = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false);
                    if (prefab != null)
                    {
                        image.SetSprite(prefab);
                    }
                    GameObject gameObject           = elemenet.transform.FindChild("Lock").gameObject;
                    GameObject obj4                 = elemenet.transform.FindChild("Unlock").gameObject;
                    RES_SPECIALFUNCUNLOCK_TYPE type = s_unlockTypes[i];
                    if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(type))
                    {
                        image.color = CUIUtility.s_Color_White;
                        gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        image.color = CUIUtility.s_Color_GrayShader;
                        gameObject.CustomSetActive(true);
                        ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);
                        if (dataByKey != null)
                        {
                            gameObject.GetComponentInChildren <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip);
                        }
                    }
                    if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_NONE)
                    {
                        int            lastChapter = CAdventureSys.GetLastChapter(1);
                        ResChapterInfo info        = GameDataMgr.chapterInfoDatabin.GetDataByKey(lastChapter);
                        if (info != null)
                        {
                            obj4.CustomSetActive(true);
                            obj4.GetComponentInChildren <Text>().text = string.Format(Singleton <CTextManager> .instance.GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(info.szChapterName));
                        }
                    }
                    else
                    {
                        obj4.CustomSetActive(false);
                    }
                }
                component.SelectElementImmediately(1);
            }
        }
Exemplo n.º 6
0
    public static void OpenForm(GameObject form)
    {
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        int amount = GameDataMgr.addedSkiilDatabin.Count();
        CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();

        component.SetElementAmount(amount);
        CUIListElementScript elemenet    = null;
        CUIEventScript       script3     = null;
        ResSkillUnlock       dataByIndex = null;
        ResSkillCfgInfo      dataByKey   = null;
        uint key     = 0;
        bool bActive = true;

        form.transform.Find("Panel_TopBg/LevelText").GetComponent <Text>().text = (masterRoleInfo == null) ? Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[] { "1" }) : Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[] { masterRoleInfo.PvpLevel.ToString() });

        for (int i = 0; i < amount; i++)
        {
            elemenet    = component.GetElemenet(i);
            script3     = elemenet.GetComponent <CUIEventScript>();
            dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            key         = dataByIndex.dwUnlockSkillID;
            dataByKey   = GameDataMgr.skillDatabin.GetDataByKey(key);
            bActive     = (masterRoleInfo == null) || (masterRoleInfo.PvpLevel < dataByIndex.wAcntLevel);
            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                Image  image      = elemenet.transform.Find("Icon").GetComponent <Image>();
                image.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false);
                script3.m_onClickEventID         = enUIEventID.AddedSkill_GetDetail;
                script3.m_onClickEventParams.tag = dataByIndex.wAcntLevel;
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().text = Utility.UTF8Convert(dataByKey.szSkillName);
                elemenet.transform.Find("Lock").gameObject.CustomSetActive(bActive);
                image.color = !bActive ? Color.white : CUIUtility.s_Color_GrayShader;
                if (bActive)
                {
                    string[] args = new string[] { dataByIndex.wAcntLevel.ToString() };
                    Utility.GetComponetInChild <Text>(elemenet.gameObject, "Lock/Text").text = Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", args);
                }
            }
            else
            {
                DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", key));
            }
        }
        dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(0);
        if (dataByIndex != null)
        {
            component.SelectElement(0, true);
            OnRefresh(form, dataByIndex.wAcntLevel);
        }
    }
Exemplo n.º 7
0
            public void Refresh_Recomand_Friend(int index, COMDT_FRIEND_INFO info)
            {
                CUIListElementScript elemenet = this.recommandFriendListCom.GetElemenet(index);

                if (elemenet != null)
                {
                    FriendShower component = elemenet.GetComponent <FriendShower>();
                    if (component != null)
                    {
                        UT.ShowFriendData(info, component, FriendShower.ItemType.Add, false, CFriendModel.FriendType.Recommend);
                    }
                }
            }
Exemplo n.º 8
0
        public static void InitDifficultList(CUIFormScript form, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            CUIListScript component              = form.transform.FindChild("DifficultList").GetComponent <CUIListScript>();
            string        text                   = string.Empty;
            string        prefabPath             = string.Empty;
            int           lEVEL_DIFFICULT_OPENED = CAdventureSys.LEVEL_DIFFICULT_OPENED;

            component.SetElementAmount(lEVEL_DIFFICULT_OPENED);
            for (int i = 0; i < lEVEL_DIFFICULT_OPENED; i++)
            {
                bool flag = CAdventureSys.IsDifOpen(currentChapter, i + 1);
                prefabPath = CAdventureView.GetDifficultIcon(i + 1);
                CUIListElementScript elemenet = component.GetElemenet(i);
                Image component2 = elemenet.transform.FindChild("DifficultImg").GetComponent <Image>();
                component2.SetSprite(prefabPath, form, true, false, false, false);
                component2.color = ((!flag) ? CAdventureView.s_Adv_Difficulty_Gray_Color : Color.white);
                elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().SetSprite(prefabPath, form, true, false, false, false);
                text = Singleton <CTextManager> .get_instance().GetText(string.Format("Adventure_Level_{0}", i + 1));

                elemenet.transform.FindChild("DifficultImg/DifficultText").GetComponent <Text>().text  = text;
                elemenet.transform.FindChild("SelectedFrame/DifficultText").GetComponent <Text>().text = text;
                elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectDifficult;
                elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                elemenet.transform.FindChild("SelectedFrame/Frame_circle").GetComponent <Image>().color = CAdventureView.s_Adv_Difficult_Circle_Color[i];
                PVE_ADV_COMPLETE_INFO     pVE_ADV_COMPLETE_INFO     = masterRoleInfo.pveLevelDetail[i];
                PVE_CHAPTER_COMPLETE_INFO pVE_CHAPTER_COMPLETE_INFO = pVE_ADV_COMPLETE_INFO.ChapterDetailList[currentChapter - 1];
                int chapterTotalStar = CAdventureSys.GetChapterTotalStar(pVE_CHAPTER_COMPLETE_INFO);
                elemenet.transform.FindChild("SelectedFrame/RewardBox").gameObject.CustomSetActive(chapterTotalStar == CAdventureSys.LEVEL_PER_CHAPTER * CAdventureSys.STAR_PER_LEVEL && pVE_CHAPTER_COMPLETE_INFO.bIsGetBonus == 0);
                elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(!flag);
            }
            component.SelectElement(difficulty - 1, true);
        }
Exemplo n.º 9
0
        private void OnSignalListElementEnabled(CUIEvent uiEvent)
        {
            CUIListElementScript srcWidgetScript = (CUIListElementScript)uiEvent.m_srcWidgetScript;
            int index = srcWidgetScript.m_index;

            if ((index >= 0) || (index < this.m_signalTipses.Count))
            {
                CSignalTipShower component = srcWidgetScript.GetComponent <CSignalTipShower>();
                if (component != null)
                {
                    component.Set(this.m_signalTipses[index], uiEvent.m_srcFormScript);
                }
            }
        }
Exemplo n.º 10
0
        private void OnSignalListElementEnabled(CUIEvent uiEvent)
        {
            CUIListElementScript cUIListElementScript = (CUIListElementScript)uiEvent.m_srcWidgetScript;
            int index = cUIListElementScript.m_index;

            if (index < 0 && index >= this.m_signalTipses.get_Count())
            {
                return;
            }
            CSignalTipShower component = cUIListElementScript.GetComponent <CSignalTipShower>();

            if (component != null)
            {
                component.Set(this.m_signalTipses.get_Item(index), uiEvent.m_srcFormScript);
            }
        }
Exemplo n.º 11
0
        public override void Validate()
        {
            this._urlaList = UrlAction.ParseFromText(base.view.activity.Content, null);
            int count = this._urlaList.Count;

            if (count > 0)
            {
                this._stepList.SetElementAmount(count);
                for (int i = 0; i < count; i++)
                {
                    UrlAction            urlAction = this._urlaList[i];
                    CUIListElementScript elemenet  = this._stepList.GetElemenet(i);
                    if (null != elemenet)
                    {
                        CUIHttpImageScript component = elemenet.GetComponent <CUIHttpImageScript>();
                        if (null != component)
                        {
                            component.SetImageUrl(urlAction.target);
                        }
                    }
                }
                this._pickIdxList = new int[count];
                if (this._pickObject != null)
                {
                    CUIContainerScript component2 = this._pickObject.GetComponent <CUIContainerScript>();
                    if (component2 != null)
                    {
                        component2.RecycleAllElement();
                        for (int j = 0; j < this._urlaList.Count; j++)
                        {
                            this._pickIdxList[j] = component2.GetElement();
                        }
                    }
                }
                this._curStepIndex = 0;
                this._leftToRight  = true;
                this._stepList.MoveElementInScrollArea(this._curStepIndex, true);
                this.EnablePickObj(this._curStepIndex);
                this._lastScrollTime = Time.time;
                this.updateOverTime();
            }
        }
Exemplo n.º 12
0
 private void _refresh_list(CUIListScript listScript, ListView <CTask> data_list)
 {
     if (listScript != null)
     {
         int count = data_list.Count;
         listScript.SetElementAmount(count);
         for (int i = 0; i < count; i++)
         {
             CUIListElementScript elemenet = listScript.GetElemenet(i);
             if ((elemenet != null) && listScript.IsElementInScrollArea(i))
             {
                 CTaskShower component = elemenet.GetComponent <CTaskShower>();
                 CTask       task      = data_list[i];
                 if ((component != null) && (task != null))
                 {
                     component.ShowTask(task, this.m_CUIForm);
                 }
             }
         }
     }
 }
Exemplo n.º 13
0
 private void _refresh_black_list(CUIListScript listScript, List <CFriendModel.stBlackName> blackList)
 {
     if (listScript != null)
     {
         int count = blackList.Count;
         listScript.SetElementAmount(count);
         for (int i = 0; i < count; i++)
         {
             CUIListElementScript elemenet = listScript.GetElemenet(i);
             if ((elemenet != null) && listScript.IsElementInScrollArea(i))
             {
                 FriendShower             component = elemenet.GetComponent <FriendShower>();
                 CFriendModel.stBlackName info      = blackList[i];
                 if (component != null)
                 {
                     UT.ShowBlackListData(ref info, component);
                 }
             }
         }
     }
 }
Exemplo n.º 14
0
    private void _refresh_list(CUIListScript listScript, ListView <CTask> data_list)
    {
        if (listScript == null)
        {
            return;
        }
        int count = data_list.get_Count();

        listScript.SetElementAmount(count);
        for (int i = 0; i < count; i++)
        {
            CUIListElementScript elemenet = listScript.GetElemenet(i);
            if (elemenet != null && listScript.IsElementInScrollArea(i))
            {
                CTaskShower component = elemenet.GetComponent <CTaskShower>();
                CTask       cTask     = data_list.get_Item(i);
                if (component != null && cTask != null)
                {
                    component.ShowTask(cTask, this.m_CUIForm);
                }
            }
        }
    }
Exemplo n.º 15
0
        public void initWidget()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CUnionBattleRankSystem.UNION_RANK_PATH);

            if (form != null)
            {
                this.m_CurSelRankType      = enUnionRankType.enRankType_None;
                this.m_CurSelRankMatchType = enUnionRankMatchType.enRankMatchType_None;
                this.m_CurSelRankItemIndex = -1;
                this.m_CurSelMapId         = 0u;
                CUIListScript component           = form.GetWidget(2).GetComponent <CUIListScript>();
                int           unionBattleMapCount = CUnionBattleEntrySystem.GetUnionBattleMapCount();
                component.SetElementAmount(unionBattleMapCount);
                int num = 0;
                for (int i = 0; i < unionBattleMapCount; i++)
                {
                    ResRewardMatchLevelInfo unionBattleMapInfoByIndex = CUnionBattleEntrySystem.GetUnionBattleMapInfoByIndex(i);
                    if (CUICommonSystem.IsMatchOpened(5, unionBattleMapInfoByIndex.dwMapId))
                    {
                        CUIListElementScript elemenet = component.GetElemenet(num);
                        if (elemenet != null)
                        {
                            CUIEventScript component2 = elemenet.GetComponent <CUIEventScript>();
                            elemenet.transform.FindChild("Text").GetComponent <Text>().text = unionBattleMapInfoByIndex.szMatchName;
                            component2.m_onClickEventParams.tagUInt            = unionBattleMapInfoByIndex.dwMapId;
                            component2.m_onClickEventParams.commonUInt32Param1 = unionBattleMapInfoByIndex.dwMatchType;
                        }
                        num++;
                    }
                }
                if (num != unionBattleMapCount)
                {
                    component.SetElementAmount(num);
                }
            }
        }
    public static void OpenForm(GameObject form)
    {
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        int num = GameDataMgr.addedSkiilDatabin.Count();
        CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();

        component.SetElementAmount(num);
        form.transform.Find("Panel_TopBg/LevelText").GetComponent <Text>().set_text((masterRoleInfo != null) ? Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[]
        {
            masterRoleInfo.PvpLevel.ToString()
        }) : Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[]
        {
            "1"
        }));
        ResSkillUnlock dataByIndex;

        for (int i = 0; i < num; i++)
        {
            CUIListElementScript elemenet   = component.GetElemenet(i);
            CUIEventScript       component2 = elemenet.GetComponent <CUIEventScript>();
            dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            uint            dwUnlockSkillID = dataByIndex.dwUnlockSkillID;
            ResSkillCfgInfo dataByKey       = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);
            bool            flag            = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByIndex.wAcntLevel;
            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                Image  component3 = elemenet.transform.Find("Icon").GetComponent <Image>();
                component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
                component2.m_onClickEventID         = enUIEventID.AddedSkill_GetDetail;
                component2.m_onClickEventParams.tag = (int)dataByIndex.wAcntLevel;
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().set_text(Utility.UTF8Convert(dataByKey.szSkillName));
                elemenet.transform.Find("Lock").gameObject.CustomSetActive(flag);
                component3.set_color(flag ? CUIUtility.s_Color_GrayShader : Color.white);
                if (flag)
                {
                    Utility.GetComponetInChild <Text>(elemenet.gameObject, "Lock/Text").set_text(Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", new string[]
                    {
                        dataByIndex.wAcntLevel.ToString()
                    }));
                }
                if ((ulong)dwUnlockSkillID == (ulong)((long)CAddSkillSys.SendSkillId))
                {
                    CUICommonSystem.SetObjActive(elemenet.transform.FindChild("HelpBtn"), true);
                    if (masterRoleInfo.PvpLevel >= (uint)dataByIndex.wAcntLevel)
                    {
                        Singleton <CUINewFlagSystem> .GetInstance().AddNewFlag(elemenet.gameObject, enNewFlagKey.New_SendSkill_V14, enNewFlagPos.enTopRight, 1f, 0f, 0f, enNewFlagType.enNewFlag);
                    }
                }
            }
            else
            {
                DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
            }
        }
        dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(0);
        if (dataByIndex != null)
        {
            component.SelectElement(0, true);
            CAddSkillView.OnRefresh(form, dataByIndex.wAcntLevel);
        }
        if (CSysDynamicBlock.bLobbyEntryBlocked)
        {
            CUIToggleListScript  component4 = form.transform.FindChild("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
            CUIListElementScript elemenet2  = component4.GetElemenet(10);
            if (elemenet2)
            {
                elemenet2.gameObject.CustomSetActive(false);
            }
            Transform transform = form.transform.FindChild("Skill-Send-Test");
            if (transform != null)
            {
                transform.gameObject.CustomSetActive(false);
            }
        }
    }
        public static void InitExloreList(CUIFormScript form)
        {
            if (form == null)
            {
                return;
            }
            int num = CExploreView.s_eventIDs.Length;
            CUIStepListScript component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>();

            component.SetElementAmount(num);
            for (int i = 0; i < num; i++)
            {
                CUIListElementScript elemenet   = component.GetElemenet(i);
                CUIEventScript       component2 = elemenet.GetComponent <CUIEventScript>();
                component2.m_onClickEventID = CExploreView.s_eventIDs[i];
                Text component3 = elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>();
                component3.set_text(Singleton <CTextManager> .instance.GetText(CExploreView.s_exploreTypes[i]));
                Image component4 = elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>();
                component4.set_color(CExploreView.s_exploreColors[i]);
                Image      component5   = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>();
                GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false);
                if (spritePrefeb != null)
                {
                    component5.SetSprite(spritePrefeb, false);
                }
                GameObject gameObject  = elemenet.transform.FindChild("Lock").gameObject;
                GameObject gameObject2 = elemenet.transform.FindChild("Unlock").gameObject;
                RES_SPECIALFUNCUNLOCK_TYPE rES_SPECIALFUNCUNLOCK_TYPE = CExploreView.s_unlockTypes[i];
                if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(rES_SPECIALFUNCUNLOCK_TYPE))
                {
                    component5.set_color(CUIUtility.s_Color_White);
                    gameObject.CustomSetActive(false);
                }
                else
                {
                    component5.set_color(CUIUtility.s_Color_GrayShader);
                    gameObject.CustomSetActive(true);
                    ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)rES_SPECIALFUNCUNLOCK_TYPE);
                    if (dataByKey != null)
                    {
                        gameObject.GetComponentInChildren <Text>().set_text(Utility.UTF8Convert(dataByKey.szLockedTip));
                    }
                }
                if (CExploreView.s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_NONE)
                {
                    int            lastChapter = CAdventureSys.GetLastChapter(1);
                    ResChapterInfo dataByKey2  = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)lastChapter);
                    if (dataByKey2 != null)
                    {
                        gameObject2.CustomSetActive(true);
                        gameObject2.GetComponentInChildren <Text>().set_text(string.Format(Singleton <CTextManager> .instance.GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(dataByKey2.szChapterName)));
                    }
                }
                else if (CExploreView.s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ARENA)
                {
                    if (Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList == null || Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank == 0u)
                    {
                        gameObject2.CustomSetActive(false);
                    }
                    else
                    {
                        string text = string.Empty;
                        text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreArenaRankText"), Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank);
                        gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().set_text(text);
                        gameObject2.CustomSetActive(true);
                    }
                }
                else if (CExploreView.s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG)
                {
                    BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model;

                    if (model._data == null)
                    {
                        gameObject2.CustomSetActive(false);
                    }
                    else
                    {
                        string text2 = string.Empty;
                        if (model.IsAllCompelte())
                        {
                            text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnFinishText"), new object[0]);
                        }
                        else
                        {
                            text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnText"), Math.Max(1, model.Get_LastUnlockLevelIndex(model.curDifficultyType) + 1));
                        }
                        gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().set_text(text2);
                        gameObject2.CustomSetActive(true);
                    }
                }
            }
            component.SelectElementImmediately(1);
            Text  component6 = form.gameObject.transform.FindChild("AwardGroup/Name1").gameObject.GetComponent <Text>();
            Text  component7 = form.gameObject.transform.FindChild("AwardGroup/Name2").gameObject.GetComponent <Text>();
            Image component8 = form.gameObject.transform.FindChild("AwardGroup/Icon1").gameObject.GetComponent <Image>();
            Image component9 = form.gameObject.transform.FindChild("AwardGroup/Icon2").gameObject.GetComponent <Image>();

            component6.gameObject.CustomSetActive(false);
            component7.gameObject.CustomSetActive(false);
            component8.gameObject.CustomSetActive(false);
            component9.gameObject.CustomSetActive(false);
            uint   num2  = 0u;
            string empty = string.Empty;

            try
            {
                num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHeroId"));
            }
            catch (Exception)
            {
            }
            if (num2 != 0u)
            {
                ResHeroCfgInfo dataByKey3 = GameDataMgr.heroDatabin.GetDataByKey(num2);
                if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey3 != null)
                {
                    component6.gameObject.CustomSetActive(true);
                    component6.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHero"), dataByKey3.szName));
                    component8.gameObject.CustomSetActive(true);
                    component8.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false);
                }
            }
            num2 = 0u;
            try
            {
                num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHeroId"));
            }
            catch (Exception)
            {
            }
            if (num2 != 0u)
            {
                ResHeroCfgInfo dataByKey4 = GameDataMgr.heroDatabin.GetDataByKey(num2);
                if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey4 != null)
                {
                    component7.gameObject.CustomSetActive(true);
                    component7.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHero"), dataByKey4.szName));
                    component9.gameObject.CustomSetActive(true);
                    component9.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false);
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform = form.transform.FindChild("AwardGroup");
                if (transform)
                {
                    transform.gameObject.CustomSetActive(false);
                }
            }
        }
Exemplo n.º 18
0
        public static void InitLevelList(CUIFormScript form, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            ResChapterInfo dataByKey = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)currentChapter);

            DebugHelper.Assert(dataByKey != null);
            bool flag = Singleton <CFunctionUnlockSys> .instance.ChapterIsUnlock(dataByKey.dwChapterId);

            PVE_ADV_COMPLETE_INFO     pVE_ADV_COMPLETE_INFO     = masterRoleInfo.pveLevelDetail[difficulty - 1];
            PVE_CHAPTER_COMPLETE_INFO pVE_CHAPTER_COMPLETE_INFO = pVE_ADV_COMPLETE_INFO.ChapterDetailList[currentChapter - 1];

            PVE_LEVEL_COMPLETE_INFO[] levelDetailList = pVE_CHAPTER_COMPLETE_INFO.LevelDetailList;
            CUIListScript             component       = form.transform.FindChild("LevelList").GetComponent <CUIListScript>();

            component.SetElementAmount(levelDetailList.Length);
            Sprite     sprite       = CUIUtility.GetSpritePrefeb(CAdventureView.GetLevelFramePath(difficulty), false, false).GetComponent <SpriteRenderer>().sprite;
            GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(CAdventureView.GetLevelSelectFramePath(difficulty), false, false);

            for (int i = 0; i < levelDetailList.Length; i++)
            {
                CUIListElementScript elemenet   = component.GetElemenet(i);
                ResLevelCfgInfo      dataByKey2 = GameDataMgr.levelDatabin.GetDataByKey((long)levelDetailList[i].iLevelID);
                DebugHelper.Assert(dataByKey2 != null, "Can't find LevelConfig = {0}", new object[]
                {
                    levelDetailList[i].iLevelID
                });
                bool flag2   = levelDetailList[i].levelStatus == 0 || !flag;
                bool bActive = levelDetailList[i].levelStatus == 1 && flag;
                int  starNum = CAdventureSys.GetStarNum(levelDetailList[i].bStarBits);
                elemenet.transform.FindChild("Unlock/star1").GetComponent <Image>().set_color((starNum >= 1) ? Color.white : CUIUtility.s_Color_GrayShader);
                elemenet.transform.FindChild("Unlock/star2").GetComponent <Image>().set_color((starNum >= 2) ? Color.white : CUIUtility.s_Color_GrayShader);
                elemenet.transform.FindChild("Unlock/star3").GetComponent <Image>().set_color((starNum >= 3) ? Color.white : CUIUtility.s_Color_GrayShader);
                elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_text(Utility.UTF8Convert(dataByKey2.szName));
                if (levelNo == i + 1 && !flag2)
                {
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[0]);
                }
                else if (!flag2)
                {
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[1]);
                }
                else
                {
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[2]);
                }
                elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[difficulty - 1]);
                elemenet.transform.FindChild("SelectedFrame/Image1").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[CAdventureView.s_Adv_Difficult_Color.Length / 2 + difficulty - 1]);
                elemenet.transform.FindChild("SelectedFrame/Image2").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[CAdventureView.s_Adv_Difficult_Color.Length / 2 + difficulty - 1]);
                elemenet.transform.FindChild("SelectedFrame/SelectedFrame").GetComponent <Image>().SetSprite(spritePrefeb, false);
                elemenet.transform.FindChild("New").gameObject.CustomSetActive(bActive);
                elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectLevel;
                elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                elemenet.transform.FindChild("Unlock").gameObject.CustomSetActive(!flag2);
                elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(flag2);
                elemenet.m_selectedSprite = sprite;
                elemenet.GetComponent <Image>().SetSprite((levelNo - 1 == i) ? sprite : elemenet.m_defaultSprite, elemenet.m_selectedLayout);
            }
            component.SelectElement(levelNo - 1, true);
        }
Exemplo n.º 19
0
        public static void InitExloreList(CUIFormScript form)
        {
            if (form != null)
            {
                int length = s_eventIDs.Length;
                CUIListElementScript elemenet  = null;
                CUIStepListScript    component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>();
                component.SetElementAmount(length);
                for (int i = 0; i < length; i++)
                {
                    elemenet = component.GetElemenet(i);
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID = s_eventIDs[i];
                    elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(s_exploreTypes[i]);

                    elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>().color = s_exploreColors[i];
                    Image      image2 = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>();
                    GameObject prefab = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false);
                    if (prefab != null)
                    {
                        image2.SetSprite(prefab);
                    }
                    GameObject gameObject           = elemenet.transform.FindChild("Lock").gameObject;
                    GameObject obj4                 = elemenet.transform.FindChild("Unlock").gameObject;
                    RES_SPECIALFUNCUNLOCK_TYPE type = s_unlockTypes[i];
                    if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(type))
                    {
                        image2.color = CUIUtility.s_Color_White;
                        gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        image2.color = CUIUtility.s_Color_GrayShader;
                        gameObject.CustomSetActive(true);
                        ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);
                        if (dataByKey != null)
                        {
                            gameObject.GetComponentInChildren <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip);
                        }
                    }
                    if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_NONE)
                    {
                        int            lastChapter = CAdventureSys.GetLastChapter(1);
                        ResChapterInfo info        = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)lastChapter);
                        if (info != null)
                        {
                            obj4.CustomSetActive(true);
                            obj4.GetComponentInChildren <Text>().text = string.Format(Singleton <CTextManager> .instance.GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(info.szChapterName));
                        }
                    }
                    else if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ARENA)
                    {
                        if ((Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList == null) || (Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank == 0))
                        {
                            obj4.CustomSetActive(false);
                        }
                        else
                        {
                            string str = string.Empty;
                            str = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreArenaRankText"), Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank);
                            obj4.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = str;
                            obj4.CustomSetActive(true);
                        }
                    }
                    else if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG)
                    {
                        BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model;

                        if (model._data == null)
                        {
                            obj4.CustomSetActive(false);
                        }
                        else
                        {
                            string str2 = string.Empty;
                            if (model.IsAllCompelte())
                            {
                                str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnFinishText"), new object[0]);
                            }
                            else
                            {
                                str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnText"), Math.Max(1, model.Get_LastUnlockLevelIndex(model.curDifficultyType) + 1));
                            }
                            obj4.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = str2;
                            obj4.CustomSetActive(true);
                        }
                    }
                }
                component.SelectElementImmediately(1);
                Text  text2  = form.gameObject.transform.FindChild("AwardGroup/Name1").gameObject.GetComponent <Text>();
                Text  text3  = form.gameObject.transform.FindChild("AwardGroup/Name2").gameObject.GetComponent <Text>();
                Image image  = form.gameObject.transform.FindChild("AwardGroup/Icon1").gameObject.GetComponent <Image>();
                Image image4 = form.gameObject.transform.FindChild("AwardGroup/Icon2").gameObject.GetComponent <Image>();
                text2.gameObject.CustomSetActive(false);
                text3.gameObject.CustomSetActive(false);
                image.gameObject.CustomSetActive(false);
                image4.gameObject.CustomSetActive(false);
                uint key = 0;
                try
                {
                    key = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHeroId"));
                }
                catch (Exception)
                {
                }
                if (key != 0)
                {
                    ResHeroCfgInfo info2 = GameDataMgr.heroDatabin.GetDataByKey(key);
                    if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(key, false) && (info2 != null))
                    {
                        text2.gameObject.CustomSetActive(true);
                        text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHero"), info2.szName);
                        image.gameObject.CustomSetActive(true);
                        image.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(key, 0)), form, true, false, false);
                    }
                }
                key = 0;
                try
                {
                    key = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHeroId"));
                }
                catch (Exception)
                {
                }
                if (key != 0)
                {
                    ResHeroCfgInfo info3 = GameDataMgr.heroDatabin.GetDataByKey(key);
                    if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(key, false) && (info3 != null))
                    {
                        text3.gameObject.CustomSetActive(true);
                        text3.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHero"), info3.szName);
                        image4.gameObject.CustomSetActive(true);
                        image4.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(key, 0)), form, true, false, false);
                    }
                }
            }
        }
Exemplo n.º 20
0
        private void OnTrophyEnable(CUIEvent uiEvent)
        {
            int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

            if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_CurAchieveSeries.Count)
            {
                return;
            }
            CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript;

            if (cUIListElementScript == null)
            {
                DebugHelper.Assert(false, "achievement sery enable elementscript is null");
                return;
            }
            CAchieveItem2  cAchieveItem = this.m_CurAchieveSeries[srcWidgetIndexInBelongedList];
            CUIEventScript component    = cUIListElementScript.GetComponent <CUIEventScript>();

            component.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Trophy_Click, new stUIEventParams
            {
                commonUInt32Param1 = cAchieveItem.Cfg.dwID
            });
            GameObject widget  = cUIListElementScript.GetWidget(0);
            GameObject widget2 = cUIListElementScript.GetWidget(1);
            GameObject widget3 = cUIListElementScript.GetWidget(2);
            GameObject widget4 = cUIListElementScript.GetWidget(3);
            GameObject widget5 = cUIListElementScript.GetWidget(4);
            GameObject widget6 = cUIListElementScript.GetWidget(5);

            widget2.CustomSetActive(false);
            Image component2 = widget.GetComponent <Image>();
            Image component3 = widget5.GetComponent <Image>();
            Text  component4 = widget3.GetComponent <Text>();
            Text  component5 = widget4.GetComponent <Text>();

            if (component2 == null || component3 == null || component4 == null || component5 == null)
            {
                return;
            }
            CAchieveItem2 cAchieveItem2 = cAchieveItem.TryToGetMostRecentlyDoneItem();

            if (cAchieveItem2 == null)
            {
                component2.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem.GetAchieveImagePath(), false, false), false);
                CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem, null);
                component4.set_text(cAchieveItem.Cfg.szName);
                component5.set_text(cAchieveItem.GetGotTimeText(false, false));
                widget6.CustomSetActive(true);
            }
            else
            {
                component2.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem2.GetAchieveImagePath(), false, false), false);
                CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem2, null);
                component4.set_text(cAchieveItem2.Cfg.szName);
                if (cAchieveItem == cAchieveItem2)
                {
                    component5.set_text(cAchieveItem.GetGotTimeText(false, false));
                }
                else
                {
                    component5.set_text(cAchieveItem2.GetGotTimeText(false, true));
                }
                widget6.CustomSetActive(false);
            }
        }