Beispiel #1
0
        public void UnlockConditionChanged()
        {
            if (Singleton <GameStateCtrl> .instance.GetCurrentState() is LobbyState)
            {
                int num  = 1;
                int num2 = 0x1c;
                for (int i = num; i < num2; i++)
                {
                    ResSpecialFucUnlock        dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)i);
                    RES_SPECIALFUNCUNLOCK_TYPE type      = (RES_SPECIALFUNCUNLOCK_TYPE)i;
                    if (((dataByKey != null) && !this.TipsHasShow(type)) && ((dataByKey.bIsShowUnlockTip == 1) && this.FucIsUnlock(type)))
                    {
                        if (this.IsBottomBtn(type))
                        {
                            Singleton <LobbyUISys> .instance.Play_UnLock_Animation(type);

                            Singleton <CTimerManager> .GetInstance().AddTimer(0xbb8, 1, new CTimer.OnTimeUpHandler(this.on_checkunlock_time));

                            this.SetUnlockTipsMask(type);
                            this.ReqUnlockTipsMask();
                            return;
                        }
                        this.SetUnlockTipsMask(type);
                        this.ReqUnlockTipsMask();
                    }
                }
            }
        }
        public void UnlockConditionChanged()
        {
            if (!(Singleton <GameStateCtrl> .instance.GetCurrentState() is LobbyState))
            {
                return;
            }
            int num  = 1;
            int num2 = 29;

            for (int i = num; i < num2; i++)
            {
                ResSpecialFucUnlock        dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)i);
                RES_SPECIALFUNCUNLOCK_TYPE rES_SPECIALFUNCUNLOCK_TYPE = (RES_SPECIALFUNCUNLOCK_TYPE)i;
                if (dataByKey != null && !this.TipsHasShow(rES_SPECIALFUNCUNLOCK_TYPE) && dataByKey.bIsShowUnlockTip == 1 && this.FucIsUnlock(rES_SPECIALFUNCUNLOCK_TYPE))
                {
                    if (this.IsBottomBtn(rES_SPECIALFUNCUNLOCK_TYPE))
                    {
                        Singleton <CLobbySystem> .instance.Play_UnLock_Animation(rES_SPECIALFUNCUNLOCK_TYPE);

                        this.SetUnlockTipsMask(rES_SPECIALFUNCUNLOCK_TYPE);
                        this.ReqUnlockTipsMask();
                        return;
                    }
                    this.SetUnlockTipsMask(rES_SPECIALFUNCUNLOCK_TYPE);
                    this.ReqUnlockTipsMask();
                }
            }
        }
Beispiel #3
0
        private void On_Burn_OpenForm(CUIEvent uievent)
        {
            if (Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(4))
            {
                if (!Singleton <SCModuleControl> .get_instance().GetActiveModule(4))
                {
                    Singleton <CUIManager> .get_instance().OpenMessageBox(Singleton <SCModuleControl> .get_instance().PvpAndPvpOffTips, false);

                    return;
                }
                if (Singleton <CMatchingSystem> .GetInstance().IsInMatching)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("PVP_Matching", true, 1.5f, null, new object[0]);

                    return;
                }
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(16, true, false);

                if (this.model._data == null)
                {
                    BurnExpeditionNetCore.Send_Get_BURNING_PROGRESS_REQ();
                }
                if (this.view != null)
                {
                    this.view.OpenForm();
                }
            }
            else
            {
                ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(4u);
                Singleton <CUIManager> .get_instance().OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1.5f, null, new object[0]);
            }
        }
        private void On_Burn_OpenForm(CUIEvent uievent)
        {
            if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG))
            {
                if (Singleton <CMatchingSystem> .GetInstance().IsInMatching)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("PVP_Matching", true, 1f, null, new object[0]);
                }
                else
                {
                    MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(0x10, true);

                    if (this.model._data == null)
                    {
                        BurnExpeditionNetCore.Send_Get_BURNING_PROGRESS_REQ();
                    }
                    if (this.view != null)
                    {
                        this.view.OpenForm();
                    }
                }
            }
            else
            {
                ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)4);
                Singleton <CUIManager> .instance.OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1f, null, new object[0]);
            }
        }
        private void On_Burn_OpenForm(CUIEvent uievent)
        {
            if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG))
            {
                if (!Singleton <SCModuleControl> .instance.GetActiveModule(COM_CLIENT_PLAY_TYPE.COM_CLIENT_PLAY_BURNING))
                {
                    Singleton <CUIManager> .instance.OpenMessageBox(Singleton <SCModuleControl> .instance.PvpAndPvpOffTips, false);

                    return;
                }
                if (Singleton <CMatchingSystem> .GetInstance().IsInMatching)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("PVP_Matching", true, 1.5f, null, new object[0]);

                    return;
                }
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(16, true, false);

                if (this.model._data == null)
                {
                    BurnExpeditionNetCore.Send_Get_BURNING_PROGRESS_REQ();
                }
                if (this.view != null)
                {
                    this.view.OpenForm();
                }
                MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.onEnterBurn, new uint[0]);
            }
            else
            {
                ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(4u);
                Singleton <CUIManager> .instance.OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1.5f, null, new object[0]);
            }
        }
Beispiel #6
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);
            }
        }
Beispiel #7
0
    public bool IsOpenAddSkillSys()
    {
        if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ADDEDSKILL))
        {
            return(true);
        }
        ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(22u);

        Singleton <CUIManager> .instance.OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1.5f, null, new object[0]);

        return(false);
    }
Beispiel #8
0
        public void OpenUnlockTip(RES_SPECIALFUNCUNLOCK_TYPE type)
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);

            DebugHelper.Assert(dataByKey != null);
            if (dataByKey != null)
            {
                string tips = Utility.UTF8Convert(dataByKey.szUnlockTip);
                string icon = Utility.UTF8Convert(dataByKey.szUnlockTipIcon);
                this.OpenUnlockTip(tips, icon);
                Singleton <CUIManager> .instance.GetForm(FUC_UNLOCK_FORM_PATH).GetComponent <CUITimerScript>().m_eventParams[1].tag = (int)type;
            }
        }
Beispiel #9
0
 public void OnOpenTaskForm(CUIEvent uiEvent)
 {
     if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_TASK))
     {
         this.m_taskView.OpenForm(uiEvent);
         TaskNetUT.Send_Update_Task(0);
         CMiShuSystem.SendReqCoinGetPathData();
     }
     else
     {
         ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)0x10);
         Singleton <CUIManager> .instance.OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1f, null, new object[0]);
     }
 }
Beispiel #10
0
 public void OnOpenTaskForm(CUIEvent uiEvent)
 {
     if (Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(16))
     {
         this.m_taskView.OpenForm(uiEvent);
         TaskNetUT.Send_Update_Task(0u);
         CMiShuSystem.SendReqCoinGetPathData();
     }
     else
     {
         ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(16u);
         Singleton <CUIManager> .get_instance().OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1.5f, null, new object[0]);
     }
 }
Beispiel #11
0
        public void OpenUnlockTip(RES_SPECIALFUNCUNLOCK_TYPE type)
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(type);

            DebugHelper.Assert(dataByKey != null);
            if (dataByKey == null)
            {
                return;
            }
            string tips = Utility.UTF8Convert(dataByKey.szUnlockTip);
            string icon = Utility.UTF8Convert(dataByKey.szUnlockTipIcon);

            this.OpenUnlockTip(tips, icon);
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CFunctionUnlockSys.FUC_UNLOCK_FORM_PATH);

            form.GetComponent <CUITimerScript>().m_eventParams[1].tag = type;
        }
Beispiel #12
0
        public bool IsTypeHasCondition(RES_SPECIALFUNCUNLOCK_TYPE type)
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);

            if (dataByKey != null)
            {
                for (int i = 0; i < dataByKey.UnlockArray.Length; i++)
                {
                    uint num2 = dataByKey.UnlockArray[i];
                    if (num2 > 0)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #13
0
    private void OnOpenForm(CUIEvent cuiEvent)
    {
        if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ADDEDSKILL))
        {
            CUIFormScript script = Singleton <CUIManager> .instance.OpenForm("UGUI/Form/System/AddedSkill/Form_AddedSkill.prefab", false, true);

            if (script != null)
            {
                CAddSkillView.OpenForm(script.gameObject);
            }
        }
        else
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)0x16);
            Singleton <CUIManager> .instance.OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1f, null, new object[0]);
        }
    }
Beispiel #14
0
    private void OnOpenForm(CUIEvent cuiEvent)
    {
        if (Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(22))
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .get_instance().OpenForm("UGUI/Form/System/AddedSkill/Form_AddedSkill.prefab", false, true);

            if (cUIFormScript != null)
            {
                CAddSkillView.OpenForm(cUIFormScript.gameObject);
            }
        }
        else
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(22u);
            Singleton <CUIManager> .get_instance().OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1.5f, null, new object[0]);
        }
        CMiShuSystem.SendUIClickToServer(enUIClickReprotID.rp_AddSkillBtn);
    }
Beispiel #15
0
        private void OnRoom_SelectMap(CUIEvent uiEvent)
        {
            int selectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex();

            if ((selectedIndex >= 0) && (selectedIndex < this.mapList.Count))
            {
                ResAcntBattleLevelInfo info = this.mapList[selectedIndex];
                this.mapId = info.dwMapId;
                if ((selectedIndex == 3) && !Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ENTERTAINMENT))
                {
                    ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)0x19);
                    Singleton <CUIManager> .GetInstance().OpenTips(dataByKey.szLockedTip, false, 1f, null, new object[0]);
                }
                else
                {
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Room_CreateRoom);
                }
            }
        }
Beispiel #16
0
        private void entertainmentAddLock(CUIFormScript form)
        {
            Transform transform = form.transform.FindChild("Panel_Main/List").GetComponent <CUIListScript>().GetElemenet(3).transform;

            if (transform != null)
            {
                if (!Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ENTERTAINMENT))
                {
                    transform.GetComponent <Image>().color = CUIUtility.s_Color_Button_Disable;
                    transform.FindChild("Lock").gameObject.CustomSetActive(true);
                    ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)0x19);
                    transform.FindChild("Lock/Text").GetComponent <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip);
                }
                else
                {
                    transform.GetComponent <Image>().color = CUIUtility.s_Color_White;
                    transform.FindChild("Lock").gameObject.CustomSetActive(false);
                }
            }
        }
        public uint[] GetConditionParam(RES_SPECIALFUNCUNLOCK_TYPE type, RES_UNLOCKCONDITION_TYPE conditionType)
        {
            uint[]    result         = new uint[0];
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);

            if (dataByKey != null && masterRoleInfo != null)
            {
                for (int i = 0; i < dataByKey.UnlockArray.Length; i++)
                {
                    uint num = dataByKey.UnlockArray[i];
                    if (num > 0u)
                    {
                        ResUnlockCondition dataByKey2 = GameDataMgr.unlockConditionDatabin.GetDataByKey(num);
                        if (dataByKey2 != null && (RES_UNLOCKCONDITION_TYPE)dataByKey2.wUnlockType == conditionType)
                        {
                            return(dataByKey2.UnlockParam);
                        }
                    }
                }
            }
            return(result);
        }
        public bool FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE type)
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);

            if (dataByKey == null)
            {
                return(true);
            }
            if (dataByKey.bIsAnd == 1)
            {
                for (int i = 0; i < dataByKey.UnlockArray.Length; i++)
                {
                    uint num = dataByKey.UnlockArray[i];
                    if (num > 0u && !this.CheckUnlock(num))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            bool flag = false;

            for (int j = 0; j < dataByKey.UnlockArray.Length; j++)
            {
                uint num2 = dataByKey.UnlockArray[j];
                if (num2 > 0u)
                {
                    flag = true;
                }
                if (num2 > 0u && this.CheckUnlock(num2))
                {
                    return(true);
                }
            }
            return(!flag);
        }
Beispiel #19
0
        public uint[] GetConditionParam(RES_SPECIALFUNCUNLOCK_TYPE type, RES_UNLOCKCONDITION_TYPE conditionType)
        {
            uint[]    numArray       = new uint[0];
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);

            if ((dataByKey != null) && (masterRoleInfo != null))
            {
                for (int i = 0; i < dataByKey.UnlockArray.Length; i++)
                {
                    uint key = dataByKey.UnlockArray[i];
                    if (key > 0)
                    {
                        ResUnlockCondition condition = GameDataMgr.unlockConditionDatabin.GetDataByKey(key);
                        if ((condition != null) && (((RES_UNLOCKCONDITION_TYPE)condition.wUnlockType) == conditionType))
                        {
                            return(condition.UnlockParam);
                        }
                    }
                }
            }
            return(numArray);
        }
        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);
                }
            }
        }
Beispiel #21
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);
                    }
                }
            }
        }