예제 #1
0
 public void AnalyseHeroTalent(ref ActorPreloadTab loadInfo, ResTalentHero talentCfg)
 {
     for (int i = 0; i < talentCfg.astTalentList.Length; i++)
     {
         RESDT_TALENT_DETAIL resdt_talent_detail = talentCfg.astTalentList[i];
         ResTalentLib        dataByKey           = GameDataMgr.talentLib.GetDataByKey(resdt_talent_detail.dwLvl1ID);
         if (dataByKey != null)
         {
             this.AnalyseSkill(ref loadInfo, (int)dataByKey.dwSkillID);
             this.AnalysePassiveSkill(ref loadInfo, (int)dataByKey.dwPassiveSkillID);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID1);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID2);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID3);
         }
         dataByKey = GameDataMgr.talentLib.GetDataByKey(resdt_talent_detail.dwLvl2ID);
         if (dataByKey != null)
         {
             this.AnalyseSkill(ref loadInfo, (int)dataByKey.dwSkillID);
             this.AnalysePassiveSkill(ref loadInfo, (int)dataByKey.dwPassiveSkillID);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID1);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID2);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID3);
         }
         dataByKey = GameDataMgr.talentLib.GetDataByKey(resdt_talent_detail.dwLvl3ID);
         if (dataByKey != null)
         {
             this.AnalyseSkill(ref loadInfo, (int)dataByKey.dwSkillID);
             this.AnalysePassiveSkill(ref loadInfo, (int)dataByKey.dwPassiveSkillID);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID1);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID2);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID3);
         }
     }
 }
예제 #2
0
        public void OpenAwakeAwardForm()
        {
            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_heroAwakeFinishFormPath, false, true);

            if (script != null)
            {
                Text             component = script.transform.Find("Panel/panelRewards/award1/lblDesc").GetComponent <Text>();
                Text             text2     = script.transform.Find("Panel/panelRewards/award2/lblDesc").GetComponent <Text>();
                CUI3DImageScript script2   = script.transform.Find("3DImage").GetComponent <CUI3DImageScript>();
                ResTalentLib     dataByKey = GameDataMgr.talentLib.GetDataByKey(this.m_heroInfo.cfgInfo.dwWakeTalentID);
                if (dataByKey != null)
                {
                    component.text = StringHelper.UTF8BytesToString(ref dataByKey.szDesc);
                }
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_heroInfo.cfgInfo.dwWakeSkinID);
                if (heroSkin != null)
                {
                    string[] args = new string[] { StringHelper.UTF8BytesToString(ref heroSkin.szSkinName) };
                    text2.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips3", args);
                }
                ObjNameData data  = CUICommonSystem.GetHeroPrefabPath(this.m_heroInfo.cfgInfo.dwCfgID, (int)heroSkin.dwSkinID, true);
                GameObject  model = (script2 == null) ? null : script2.AddGameObject(data.ObjectName, false, false);
                if (model != null)
                {
                    CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance();

                    instance.Set3DModel(model);
                    instance.InitAnimatList();
                    instance.InitAnimatSoundList(this.m_heroInfo.cfgInfo.dwCfgID, heroSkin.dwSkinID);
                    instance.OnModePlayAnima("Come");
                }
            }
        }
예제 #3
0
        public void OpenStartAwakeForm()
        {
            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_heroAwakeFormPath, false, true);

            if (script != null)
            {
                Image      component = script.transform.Find("Panel/PanelLeft/HeroCell/Hero").GetComponent <Image>();
                Text       text      = script.transform.Find("Panel/PanelLeft/lblContent").GetComponent <Text>();
                Text       text2     = script.transform.Find("Panel/PanelLeft/panelRewards/award1/lblDesc").GetComponent <Text>();
                Text       text3     = script.transform.Find("Panel/PanelLeft/panelRewards/award2/lblDesc").GetComponent <Text>();
                GameObject prefab    = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szImagePath), true, true);
                component.SetSprite(prefab);
                text.text = StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szWakeDesc);
                ResTalentLib dataByKey = GameDataMgr.talentLib.GetDataByKey(this.m_heroInfo.cfgInfo.dwWakeTalentID);
                if (dataByKey != null)
                {
                    text2.text = StringHelper.UTF8BytesToString(ref dataByKey.szDesc);
                }
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_heroInfo.cfgInfo.dwWakeSkinID);
                if (heroSkin != null)
                {
                    string[] args = new string[] { StringHelper.UTF8BytesToString(ref heroSkin.szSkinName) };
                    text3.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips3", args);
                }
            }
        }
예제 #4
0
        public void OnHeroLearnTalent(PoolObjHandle <ActorRoot> hero, sbyte talentLevel, uint talentID)
        {
            HeroTalentViewInfo heroTalentViewInfo = this.GetHeroTalentViewInfo(hero);

            if (heroTalentViewInfo != null)
            {
                ResTalentLib dataByKey = GameDataMgr.talentLib.GetDataByKey(talentID);
                heroTalentViewInfo.m_learnTalentList[(int)talentLevel] = dataByKey.dwID;
                if (hero == this.m_heroCaption)
                {
                    this.Refresh();
                    if (dataByKey.bType == 3)
                    {
                        Singleton <CBattleSystem> .GetInstance().ResetSkillButtonManager(this.m_heroCaption);

                        Singleton <CBattleSystem> .GetInstance().m_skillButtonManager.SetButtonCDOver(SkillSlotType.SLOT_SKILL_3, false);
                    }
                    string   str  = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                    string[] args = new string[] { str };
                    Singleton <CBattleSystem> .GetInstance().CreateOtherFloatText(enOtherFloatTextContent.LearnTalent, (Vector3)this.m_heroCaption.handle.location, args);

                    Singleton <CSoundManager> .GetInstance().PlayBattleSound("UI_Prompt_get_tianfu", null);
                }
                Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();
            }
        }
예제 #5
0
 public void AutoLearnTalent(PoolObjHandle <ActorRoot> hero, int level)
 {
     if (hero.handle.ActorAgent.IsAutoAI())
     {
         int          bID  = 0;
         bool         flag = false;
         int          num2 = 0;
         ResTalentLib lib  = null;
         for (int i = 0; i < this.m_talentRuleList.Count; i++)
         {
             if (this.m_talentRuleList[i].bSoulRequestValue == level)
             {
                 bID  = this.m_talentRuleList[i].bID;
                 flag = true;
                 break;
             }
         }
         if (flag)
         {
             ResTalentHero dataByKey = GameDataMgr.talentHero.GetDataByKey((uint)hero.handle.TheActorMeta.ConfigId);
             if (dataByKey != null)
             {
                 num2 = FrameRandom.Random(2);
                 if (bID == 2)
                 {
                     lib = GameDataMgr.talentLib.GetDataByKey(dataByKey.astTalentList[bID - 1].dwLvl1ID);
                 }
                 else if ((bID >= 1) && (bID <= dataByKey.astTalentList.Length))
                 {
                     if (num2 == 0)
                     {
                         lib = GameDataMgr.talentLib.GetDataByKey(dataByKey.astTalentList[bID - 1].dwLvl1ID);
                     }
                     else
                     {
                         lib = GameDataMgr.talentLib.GetDataByKey(dataByKey.astTalentList[bID - 1].dwLvl2ID);
                     }
                 }
                 if (lib != null)
                 {
                     this.DirectLearnTalentCommand(hero, lib.dwID, (sbyte)(bID - 1));
                 }
             }
         }
     }
 }
        private static void SetHeroStat_Share(CUIFormScript formScript, GameObject item, HeroKDA kda, bool bSelf, bool bMvp, bool bWin)
        {
            Text componetInChild = Utility.GetComponetInChild <Text>(item, "Txt_PlayerLevel");

            componetInChild.set_text(string.Format("Lv.{0}", kda.SoulLevel.ToString()));
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)kda.HeroId);

            DebugHelper.Assert(dataByKey != null);
            item.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>().set_text(StringHelper.UTF8BytesToString(ref dataByKey.szName));
            string text  = (kda.numKill < 10) ? string.Format(" {0} ", kda.numKill.ToString()) : kda.numKill.ToString();
            string text2 = (kda.numDead < 10) ? string.Format(" {0} ", kda.numDead.ToString()) : kda.numDead.ToString();
            string text3 = (kda.numAssist < 10) ? string.Format(" {0}", kda.numAssist.ToString()) : kda.numAssist.ToString();

            item.transform.Find("Txt_KDA").gameObject.GetComponent <Text>().set_text(string.Format("{0} / {1} / {2}", text, text2, text3));
            Image component = item.transform.Find("KillerImg").gameObject.GetComponent <Image>();

            component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kda.HeroId, 0u)), formScript, true, false, false, false);
            GameObject gameObject = item.transform.Find("Mvp").gameObject;

            gameObject.CustomSetActive(bMvp);
            if (bMvp)
            {
                Image component2 = gameObject.GetComponent <Image>();
                if (bWin)
                {
                    component2.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Red_Mvp", formScript, true, false, false, false);
                    component2.gameObject.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
                }
                else
                {
                    component2.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Blue_Mvp", formScript, true, false, false, false);
                    component2.gameObject.transform.localScale = new Vector3(0.6f, 0.6f, 1f);
                }
            }
            for (int i = 0; i < 5; i++)
            {
                uint  dwTalentID = kda.TalentArr[i].dwTalentID;
                Image component3 = item.transform.FindChild(string.Format("TianFu/TianFuIcon{0}", (i + 1).ToString())).GetComponent <Image>();
                if (dwTalentID == 0u)
                {
                    component3.gameObject.CustomSetActive(false);
                }
                else
                {
                    component3.gameObject.CustomSetActive(true);
                    ResTalentLib dataByKey2 = GameDataMgr.talentLib.GetDataByKey(dwTalentID);
                    component3.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + dataByKey2.dwIcon, formScript, true, false, false, false);
                }
            }
            int num = 1;

            for (int j = 1; j < 13; j++)
            {
                switch (j)
                {
                case 1:
                    if (kda.LegendaryNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.Legendary, num);
                        num++;
                    }
                    break;

                case 2:
                    if (kda.PentaKillNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.PentaKill, num);
                        num++;
                    }
                    break;

                case 3:
                    if (kda.QuataryKillNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.QuataryKill, num);
                        num++;
                    }
                    break;

                case 4:
                    if (kda.TripleKillNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.TripleKill, num);
                        num++;
                    }
                    break;

                case 5:
                    if (kda.DoubleKillNum > 0)
                    {
                    }
                    break;

                case 6:
                    if (kda.bKillMost)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.KillMost, num);
                        num++;
                    }
                    break;

                case 7:
                    if (kda.bHurtMost && kda.hurtToEnemy > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.HurtMost, num);
                        num++;
                    }
                    break;

                case 8:
                    if (kda.bHurtTakenMost && kda.hurtTakenByEnemy > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.HurtTakenMost, num);
                        num++;
                    }
                    break;

                case 9:
                    if (kda.bAsssistMost)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.AsssistMost, num);
                        num++;
                    }
                    break;
                }
            }
            for (int k = num; k <= 6; k++)
            {
                CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.NULL, k);
            }
        }
예제 #7
0
        private static void SetHeroStat_Share(CUIFormScript formScript, GameObject item, HeroKDA kda, bool bSelf, bool bMvp, bool bWin)
        {
            Utility.GetComponetInChild <Text>(item, "Txt_PlayerLevel").text = string.Format("Lv.{0}", kda.SoulLevel.ToString());
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)kda.HeroId);

            DebugHelper.Assert(dataByKey != null);
            item.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>().text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            string str  = (kda.numKill >= 10) ? kda.numKill.ToString() : string.Format(" {0} ", kda.numKill.ToString());
            string str2 = (kda.numDead >= 10) ? kda.numDead.ToString() : string.Format(" {0} ", kda.numDead.ToString());
            string str3 = (kda.numAssist >= 10) ? kda.numAssist.ToString() : string.Format(" {0}", kda.numAssist.ToString());

            item.transform.Find("Txt_KDA").gameObject.GetComponent <Text>().text = string.Format("{0} / {1} / {2}", str, str2, str3);
            item.transform.Find("KillerImg").gameObject.GetComponent <Image>().SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kda.HeroId, 0)), formScript, true, false, false);
            GameObject gameObject = item.transform.Find("Mvp").gameObject;

            gameObject.CustomSetActive(bMvp);
            if (bMvp)
            {
                Image component = gameObject.GetComponent <Image>();
                if (bWin)
                {
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Red_Mvp", formScript, true, false, false);
                    component.gameObject.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
                }
                else
                {
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Blue_Mvp", formScript, true, false, false);
                    component.gameObject.transform.localScale = new Vector3(0.6f, 0.6f, 1f);
                }
            }
            for (int i = 0; i < 5; i++)
            {
                uint  dwTalentID = kda.TalentArr[i].dwTalentID;
                int   num12      = i + 1;
                Image image      = item.transform.FindChild(string.Format("TianFu/TianFuIcon{0}", num12.ToString())).GetComponent <Image>();
                if (dwTalentID == 0)
                {
                    image.gameObject.CustomSetActive(false);
                }
                else
                {
                    image.gameObject.CustomSetActive(true);
                    ResTalentLib lib = GameDataMgr.talentLib.GetDataByKey(dwTalentID);
                    image.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + lib.dwIcon, formScript, true, false, false);
                }
            }
            int count = 1;

            for (int j = 1; j < 13; j++)
            {
                switch (((PvpAchievement)j))
                {
                case PvpAchievement.Legendary:
                    if (kda.LegendaryNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.Legendary, count);
                        count++;
                    }
                    break;

                case PvpAchievement.PentaKill:
                    if (kda.PentaKillNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.PentaKill, count);
                        count++;
                    }
                    break;

                case PvpAchievement.QuataryKill:
                    if (kda.QuataryKillNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.QuataryKill, count);
                        count++;
                    }
                    break;

                case PvpAchievement.TripleKill:
                    if (kda.TripleKillNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.TripleKill, count);
                        count++;
                    }
                    break;

                case PvpAchievement.DoubleKill:
                    if (kda.DoubleKillNum <= 0)
                    {
                    }
                    break;

                case PvpAchievement.KillMost:
                    if (kda.bKillMost)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.KillMost, count);
                        count++;
                    }
                    break;

                case PvpAchievement.HurtMost:
                    if (kda.bHurtMost && (kda.hurtToEnemy > 0))
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.HurtMost, count);
                        count++;
                    }
                    break;

                case PvpAchievement.HurtTakenMost:
                    if (kda.bHurtTakenMost && (kda.hurtTakenByEnemy > 0))
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.HurtTakenMost, count);
                        count++;
                    }
                    break;

                case PvpAchievement.AsssistMost:
                    if (kda.bAsssistMost)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.AsssistMost, count);
                        count++;
                    }
                    break;
                }
            }
            for (int k = count; k <= 6; k++)
            {
                SetAchievementIcon(formScript, item, PvpAchievement.NULL, k);
            }
        }
예제 #8
0
        public void Refresh()
        {
            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo() != null)
            {
                HeroTalentViewInfo heroTalentViewInfo = this.GetHeroTalentViewInfo(this.m_heroCaption);
                if (heroTalentViewInfo != null)
                {
                    uint configId = (uint)heroTalentViewInfo.m_hero.handle.TheActorMeta.ConfigId;
                    List <stTalentEventParams> list = new List <stTalentEventParams>();
                    for (int i = heroTalentViewInfo.m_talentLevel - 1; i >= 0; i--)
                    {
                        if (heroTalentViewInfo.m_learnTalentList[i] == 0)
                        {
                            for (int k = 0; k < heroTalentViewInfo.m_heroTalentLevelInfoList[i].m_tarlentLibList.Count; k++)
                            {
                                if (heroTalentViewInfo.m_heroTalentLevelInfoList[i].m_tarlentLibList[k] == null)
                                {
                                    return;
                                }
                                stTalentEventParams item = new stTalentEventParams {
                                    talentLevelIndex = (byte)i,
                                    talentInfo       = heroTalentViewInfo.m_heroTalentLevelInfoList[i].m_tarlentLibList[k],
                                    isCanLearn       = true
                                };
                                if (!IsNeedBuy(i, k) || IsBuyTalent(configId, i))
                                {
                                    item.isHaveTalent = true;
                                    list.Add(item);
                                }
                            }
                            break;
                        }
                    }
                    GameObject   gameObject = this.m_root.transform.Find("List1").gameObject;
                    GameObject[] objArray   = new GameObject[] { gameObject.transform.Find("talentCell1").gameObject, gameObject.transform.Find("talentCell2").gameObject, gameObject.transform.Find("talentCell3").gameObject };
                    for (int j = 0; j < objArray.Length; j++)
                    {
                        GameObject obj3 = objArray[j];
                        if (j < list.Count)
                        {
                            obj3.CustomSetActive(true);
                            stTalentEventParams params2 = list[j];
                            Image component             = obj3.transform.Find("imgIcon").GetComponent <Image>();
                            Text  text = obj3.transform.Find("panelDesc/Text").GetComponent <Text>();
                            component.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + params2.talentInfo.dwIcon, Singleton <CBattleSystem> .GetInstance().m_FormScript, true, false, false);
                            text.text = StringHelper.UTF8BytesToString(ref params2.talentInfo.szDesc2);
                            CUIEventScript  script      = obj3.GetComponent <CUIEventScript>();
                            stUIEventParams eventParams = new stUIEventParams {
                                talentParams = params2
                            };
                            script.SetUIEvent(enUIEventType.Click, enUIEventID.Talent_BtnLearnClick, eventParams);
                        }
                        else
                        {
                            obj3.CustomSetActive(false);
                        }
                    }
                    if (list.Count > 0)
                    {
                        gameObject.gameObject.CustomSetActive(true);
                    }
                    else
                    {
                        gameObject.gameObject.CustomSetActive(false);
                    }
                    CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_TalentFormPath);

                    if (form != null)
                    {
                        CUIListScript[] scriptArray = new CUIListScript[] { form.gameObject.transform.Find("Panel/PanelLeft/List1").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List2").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List3").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List4").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List5").GetComponent <CUIListScript>() };
                        for (int m = 0; m < this.m_talentRuleList.Count; m++)
                        {
                            HeroTalentLevelInfo info3 = heroTalentViewInfo.m_heroTalentLevelInfoList[m];
                            uint          num6        = heroTalentViewInfo.m_learnTalentList[m];
                            bool          flag        = heroTalentViewInfo.m_talentLevel > m;
                            CUIListScript script3     = scriptArray[m];
                            script3.SetElementAmount(info3.m_tarlentLibList.Count);
                            GameObject obj4 = script3.gameObject.transform.Find("Current").gameObject;
                            obj4.CustomSetActive(false);
                            for (int n = 0; n < info3.m_tarlentLibList.Count; n++)
                            {
                                GameObject     obj5    = script3.GetElemenet(n).gameObject.transform.Find("talentCell").gameObject;
                                Image          image   = obj5.transform.Find("imgIcon").GetComponent <Image>();
                                Image          image3  = obj5.transform.Find("lock").GetComponent <Image>();
                                Text           text2   = obj5.transform.Find("lblName").GetComponent <Text>();
                                CanvasGroup    group   = obj5.GetComponent <CanvasGroup>();
                                CUIEventScript script4 = obj5.GetComponent <CUIEventScript>();
                                ResTalentLib   lib     = info3.m_tarlentLibList[n];
                                if (lib == null)
                                {
                                    return;
                                }
                                image.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + lib.dwIcon, form, true, false, false);
                                image.color = CUIUtility.s_Color_White;
                                text2.text  = StringHelper.UTF8BytesToString(ref lib.szName);
                                stTalentEventParams params4 = new stTalentEventParams {
                                    talentLevelIndex = (byte)m,
                                    talentInfo       = info3.m_tarlentLibList[n],
                                    isCanLearn       = false
                                };
                                if (IsNeedBuy(m, n) && !IsBuyTalent(configId, m))
                                {
                                    params4.isHaveTalent = false;
                                    image3.gameObject.CustomSetActive(true);
                                }
                                else
                                {
                                    params4.isHaveTalent = true;
                                    image3.gameObject.CustomSetActive(false);
                                }
                                if (flag)
                                {
                                    if (num6 == 0)
                                    {
                                        if (params4.isHaveTalent)
                                        {
                                            params4.isCanLearn = true;
                                        }
                                        obj4.CustomSetActive(true);
                                    }
                                    else if (lib.dwID != num6)
                                    {
                                        group.alpha = 0.25f;
                                    }
                                    else
                                    {
                                        group.alpha = 1f;
                                    }
                                    image.color  = CUIUtility.s_Color_White;
                                    image3.color = CUIUtility.s_Color_White;
                                    text2.color  = CUIUtility.s_Color_White;
                                }
                                else
                                {
                                    image.color  = CUIUtility.s_Color_GrayShader;
                                    image3.color = CUIUtility.s_Color_GrayShader;
                                    text2.color  = CUIUtility.s_Color_Grey;
                                }
                                stUIEventParams params5 = new stUIEventParams {
                                    talentParams = params4
                                };
                                script4.SetUIEvent(enUIEventType.Click, enUIEventID.Talent_ItemClick, params5);
                            }
                        }
                    }
                }
            }
        }
예제 #9
0
        public void RefreshForm(int effectIndex = -1)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_talentBuyFormPath);

            if (form != null)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    CHeroInfo          heroInfo           = masterRoleInfo.GetHeroInfo(this.m_heroID, false);
                    HeroTalentViewInfo heroTalentViewInfo = TalentView.GetHeroTalentViewInfo(this.m_heroID);
                    if (heroTalentViewInfo != null)
                    {
                        CUIListScript[] scriptArray = new CUIListScript[] { form.gameObject.transform.Find("Panel/PanelLeft/List1").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List2").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List3").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List4").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List5").GetComponent <CUIListScript>() };
                        for (int i = 0; i < 5; i++)
                        {
                            CUIListScript       script2 = scriptArray[i];
                            HeroTalentLevelInfo info4   = heroTalentViewInfo.m_heroTalentLevelInfoList[i];
                            ResTalentLib        lib     = info4.m_tarlentLibList[info4.m_tarlentLibList.Count - 1];
                            Button component            = script2.transform.Find("BtnBuyCoin").GetComponent <Button>();
                            Text   text  = script2.transform.Find("lblTips").GetComponent <Text>();
                            Text   text2 = text.transform.Find("Text").GetComponent <Text>();
                            Image  image = text.transform.Find("Image").GetComponent <Image>();
                            component.gameObject.CustomSetActive(false);
                            text2.gameObject.CustomSetActive(false);
                            image.gameObject.CustomSetActive(false);
                            if (!TalentView.IsHaveTalentBuyFunc(this.m_heroID))
                            {
                                text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_3");
                            }
                            else if ((heroInfo == null) && (i == 0))
                            {
                                text.text = Singleton <CTextManager> .instance.GetText("Skin_NeedToBuyAHero");
                            }
                            else if (TalentView.IsBuyTalent(this.m_heroID, i))
                            {
                                text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_2");
                            }
                            else if ((i > 0) && !TalentView.IsBuyTalent(this.m_heroID, i - 1))
                            {
                                int      num2 = heroTalentViewInfo.m_heroTalentLevelInfoList[i - 1].m_tarlentLibList.Count - 1;
                                string   str  = StringHelper.UTF8BytesToString(ref heroTalentViewInfo.m_heroTalentLevelInfoList[i - 1].m_tarlentLibList[num2].szName);
                                string[] args = new string[] { str };
                                text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_4", args);
                            }
                            else
                            {
                                if (heroInfo == null)
                                {
                                    continue;
                                }
                                string str2 = StringHelper.UTF8BytesToString(ref CHeroInfo.GetHeroProficiency(heroInfo.cfgInfo.bJob, heroInfo.m_ProficiencyLV).szTitle);
                                string str3 = StringHelper.UTF8BytesToString(ref CHeroInfo.GetHeroProficiency(heroInfo.cfgInfo.bJob, info4.m_levelDetail.bLvl3UnlockLvl).szTitle);
                                if (heroInfo.m_ProficiencyLV < info4.m_levelDetail.bLvl3UnlockLvl)
                                {
                                    component.gameObject.CustomSetActive(true);
                                    stUIEventParams eventParams = new stUIEventParams {
                                        tag     = info4.m_levelDetail.bLvl3LockCostType,
                                        tagUInt = info4.m_levelDetail.dwLvl3LockCostPrice,
                                        tag2    = i,
                                        tagStr  = StringHelper.UTF8BytesToString(ref lib.szName)
                                    };
                                    CMallSystem.SetPayButton(form, (RectTransform)component.transform, CMallSystem.ResBuyTypeToPayType(info4.m_levelDetail.bLvl3LockCostType), info4.m_levelDetail.dwLvl3LockCostPrice, enUIEventID.Talent_Buy_BtnSellClick, ref eventParams);
                                    string[] textArray2 = new string[] { str3 };
                                    text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_7", textArray2);

                                    text2.gameObject.CustomSetActive(true);
                                    image.gameObject.CustomSetActive(true);
                                    CMallSystem.SetPayButton(form, (RectTransform)text.transform, CMallSystem.ResBuyTypeToPayType(info4.m_levelDetail.bLvl3UnLockCostType), info4.m_levelDetail.dwLvl3UnLockCostPrice, enUIEventID.None, ref eventParams);
                                }
                                else
                                {
                                    component.gameObject.CustomSetActive(true);
                                    stUIEventParams params2 = new stUIEventParams {
                                        tag     = info4.m_levelDetail.bLvl3UnLockCostType,
                                        tagUInt = info4.m_levelDetail.dwLvl3UnLockCostPrice,
                                        tag2    = i,
                                        tagStr  = StringHelper.UTF8BytesToString(ref lib.szName)
                                    };
                                    CMallSystem.SetPayButton(form, (RectTransform)component.transform, CMallSystem.ResBuyTypeToPayType(info4.m_levelDetail.bLvl3UnLockCostType), info4.m_levelDetail.dwLvl3UnLockCostPrice, enUIEventID.Talent_Buy_BtnSellClick, ref params2);
                                    string[] textArray3 = new string[] { str2 };
                                    text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_8", textArray3);
                                }
                            }
                            script2.SetElementAmount(info4.m_tarlentLibList.Count);
                            for (int j = 0; j < info4.m_tarlentLibList.Count; j++)
                            {
                                GameObject     gameObject = script2.GetElemenet(j).gameObject.transform.Find("talentCell").gameObject;
                                Image          image2     = gameObject.transform.Find("imgIcon").GetComponent <Image>();
                                Image          image3     = gameObject.transform.Find("lock").GetComponent <Image>();
                                Text           text3      = gameObject.transform.Find("lblName").GetComponent <Text>();
                                CanvasGroup    group      = gameObject.GetComponent <CanvasGroup>();
                                CUIEventScript script3    = gameObject.GetComponent <CUIEventScript>();
                                ResTalentLib   lib2       = info4.m_tarlentLibList[j];
                                if (lib2 == null)
                                {
                                    return;
                                }
                                image2.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + lib2.dwIcon, form, true, false, false);
                                image2.color = CUIUtility.s_Color_White;
                                text3.text   = StringHelper.UTF8BytesToString(ref lib2.szName);
                                stTalentEventParams params3 = new stTalentEventParams {
                                    talentLevelIndex = (byte)i,
                                    talentInfo       = info4.m_tarlentLibList[j],
                                    isCanLearn       = false
                                };
                                if (TalentView.IsNeedBuy(i, j) && !TalentView.IsBuyTalent(this.m_heroID, i))
                                {
                                    params3.isHaveTalent = false;
                                    image3.gameObject.CustomSetActive(true);
                                    image2.color = CUIUtility.s_Color_GrayShader;
                                }
                                else
                                {
                                    params3.isHaveTalent = true;
                                    image3.gameObject.CustomSetActive(false);
                                    image2.color = CUIUtility.s_Color_White;
                                    if ((effectIndex == i) && (j == (info4.m_tarlentLibList.Count - 1)))
                                    {
                                        CUICommonSystem.PlayAnimator(gameObject, "UnLock_Anim");
                                    }
                                }
                                string strContent = StringHelper.UTF8BytesToString(ref lib2.szDesc);
                                CUICommonSystem.SetCommonTipsEvent(form, gameObject, strContent, enUseableTipsPos.enTop);
                            }
                        }
                    }
                }
            }
        }