Beispiel #1
0
        public string GetSkillUpTip(int slotId)
        {
            CHeroInfo info2;

            Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetHeroInfo(this.m_heroCfgId, out info2, true);

            DebugHelper.Assert(info2 != null);
            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey(this.skillIdArr[slotId]);

            DebugHelper.Assert(dataByKey != null);
            string skillDesc = StringHelper.UTF8BytesToString(ref dataByKey.szSkillUpTip);

            string[] escapeString = GetEscapeString(skillDesc);
            if (escapeString != null)
            {
                for (int i = 0; i < escapeString.Length; i++)
                {
                    int    num2     = CalcEscapeValue(escapeString[i], info2, this.GetSkillLevel(slotId));
                    string newValue = string.Empty;
                    if (num2 != 0)
                    {
                        newValue = num2.ToString();
                    }
                    skillDesc = skillDesc.Replace("[" + escapeString[i] + "]", newValue);
                }
            }
            return(skillDesc);
        }
Beispiel #2
0
        public string GetSkillUpTip(int slotId, uint heroId)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            CHeroInfo cHeroInfo;

            masterRoleInfo.GetHeroInfo(this.m_heroCfgId, out cHeroInfo, true);
            DebugHelper.Assert(cHeroInfo != null);
            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)this.skillIdArr[slotId]);

            DebugHelper.Assert(dataByKey != null);
            string text = StringHelper.UTF8BytesToString(ref dataByKey.szSkillUpTip);

            string[] escapeString = CSkillData.GetEscapeString(text);
            if (escapeString != null)
            {
                for (int i = 0; i < escapeString.Length; i++)
                {
                    int    num   = CSkillData.CalcEscapeValue(escapeString[i], cHeroInfo, this.GetSkillLevel(slotId), 1, heroId);
                    string text2 = string.Empty;
                    if (num != 0)
                    {
                        text2 = num.ToString();
                    }
                    text = text.Replace("[" + escapeString[i] + "]", text2);
                }
            }
            return(text);
        }
Beispiel #3
0
 public Skill(int id)
 {
     this.SkillID    = id;
     this.skillAbort = new SkillAbort();
     this.skillAbort.InitAbort(false);
     this.bDelayAbortSkill   = false;
     this.bProtectAbortSkill = false;
     this.cfgData            = GameDataMgr.skillDatabin.GetDataByKey((long)id);
     if (this.cfgData != null)
     {
         this.ActionName = StringHelper.UTF8BytesToString(ref this.cfgData.szPrefab);
         DebugHelper.Assert(this.ActionName != null, "Action name is null in skill databin id = {0}", new object[]
         {
             id
         });
         this.GuidePrefabName      = StringHelper.UTF8BytesToString(ref this.cfgData.szGuidePrefab);
         this.GuideWarnPrefabName  = StringHelper.UTF8BytesToString(ref this.cfgData.szGuideWarnPrefab);
         this.EffectPrefabName     = StringHelper.UTF8BytesToString(ref this.cfgData.szEffectPrefab);
         this.EffectWarnPrefabName = StringHelper.UTF8BytesToString(ref this.cfgData.szEffectWarnPrefab);
         this.FixedPrefabName      = StringHelper.UTF8BytesToString(ref this.cfgData.szFixedPrefab);
         this.FixedWarnPrefabName  = StringHelper.UTF8BytesToString(ref this.cfgData.szFixedWarnPrefab);
         this.IconName             = StringHelper.UTF8BytesToString(ref this.cfgData.szIconPath);
         this.SkillCD        = 5f;
         this.AppointType    = (SkillRangeAppointType)this.cfgData.bRangeAppointType;
         this.bAgeImmeExcute = (this.cfgData.bAgeImmeExcute == 1);
     }
     this.battleParam = GameDataMgr.battleParam.GetAnyData();
 }
Beispiel #4
0
 private int SkillEnergyCost(ResSkillCfgInfo cfgData, int CurSkillLevel)
 {
     if (cfgData.dwEnergyCostType == 0)
     {
         if (cfgData.iEnergyCostCalcType == 0)
         {
             return(((int)cfgData.iEnergyCost) + ((CurSkillLevel - 1) * cfgData.iEnergyCostGrowth));
         }
         if (cfgData.iEnergyCostCalcType == 1)
         {
             int  actorEpTotal = this.Actor.handle.ValueComponent.actorEpTotal;
             long num3         = (long)(cfgData.iEnergyCost + (((actorEpTotal * (CurSkillLevel - 1)) * cfgData.iEnergyCostGrowth) / 0x2710));
             return((int)num3);
         }
         if (cfgData.iEnergyCostCalcType == 2)
         {
             int  actorEp = this.Actor.handle.ValueComponent.actorEp;
             long num5    = (long)(cfgData.iEnergyCost + (((actorEp * (CurSkillLevel - 1)) * cfgData.iEnergyCostGrowth) / 0x2710));
             return((int)num5);
         }
         return(0);
     }
     if (this.SkillObj.cfgData.dwEnergyCostType == 1)
     {
         return(0);
     }
     return(0);
 }
Beispiel #5
0
    public static void OnRefresh(GameObject form, ushort addedSkillLevel)
    {
        CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
        int selected = component.GetSelected();

        for (int i = 0; i < component.GetElementAmount(); i++)
        {
            CUIListElementScript elemenet = component.GetElemenet(i);
            if (i == selected)
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = CAddSkillView.SELECTED_COLOR;
            }
            else
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = CAddSkillView.UN_SELECTED_COLOR;
            }
        }
        ResSkillUnlock  dataByKey       = GameDataMgr.addedSkiilDatabin.GetDataByKey((uint)addedSkillLevel);
        uint            dwUnlockSkillID = dataByKey.dwUnlockSkillID;
        ResSkillCfgInfo dataByKey2      = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);

        if (dataByKey2 == null)
        {
            DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
            return;
        }
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo();

        bool   flag       = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByKey.wAcntLevel;
        Image  component2 = form.transform.Find("Panel_SkillDesc/IconImg").GetComponent <Image>();
        Image  component3 = form.transform.Find("Panel_SkillDesc/ContentImg").GetComponent <Image>();
        Text   component4 = form.transform.Find("Panel_SkillDesc/SkillNameTxt").GetComponent <Text>();
        Text   component5 = form.transform.Find("Panel_SkillDesc/SkillNameTxt2").GetComponent <Text>();
        Text   component6 = form.transform.Find("Panel_SkillDesc/SkillUnlockTxt").GetComponent <Text>();
        Text   component7 = form.transform.Find("Panel_SkillDesc/SkillDescTxt").GetComponent <Text>();
        string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey2.szIconPath));

        component2.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_AddedSkill_Dir, dwUnlockSkillID);
        component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        Text   arg_1F6_0 = component4;
        string text      = Utility.UTF8Convert(dataByKey2.szSkillName);

        component5.text = text;
        arg_1F6_0.text  = text;
        component6.text = string.Format("Lv.{0}", dataByKey.wAcntLevel);
        component7.text = CUICommonSystem.GetSkillDescLobby(dataByKey2.szSkillDesc, CAddSkillView.HeroID);
        if (flag)
        {
            component6.text = Singleton <CTextManager> .get_instance().GetText("Added_Skill_Common_Tips_3", new string[]
            {
                dataByKey.wAcntLevel.ToString()
            });
        }
        else
        {
            component6.text = Singleton <CTextManager> .get_instance().GetText("Added_Skill_Common_Tips_4");
        }
    }
Beispiel #6
0
    public static void OnRefresh(GameObject form, ushort addedSkillLevel)
    {
        CUIToggleListScript  component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
        CUIListElementScript elemenet  = null;
        int selected = component.GetSelected();

        for (int i = 0; i < component.GetElementAmount(); i++)
        {
            elemenet = component.GetElemenet(i);
            if (i == selected)
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = SELECTED_COLOR;
            }
            else
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = UN_SELECTED_COLOR;
            }
        }
        ResSkillUnlock  dataByKey       = GameDataMgr.addedSkiilDatabin.GetDataByKey((int)addedSkillLevel);
        uint            dwUnlockSkillID = dataByKey.dwUnlockSkillID;
        ResSkillCfgInfo info            = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);

        if (info == null)
        {
            DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
        }
        else
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            bool   flag       = (masterRoleInfo == null) || (masterRoleInfo.PvpLevel < dataByKey.wAcntLevel);
            Image  image      = form.transform.Find("Panel_SkillDesc/IconImg").GetComponent <Image>();
            Image  image2     = form.transform.Find("Panel_SkillDesc/ContentImg").GetComponent <Image>();
            Text   text       = form.transform.Find("Panel_SkillDesc/SkillNameTxt").GetComponent <Text>();
            Text   text2      = form.transform.Find("Panel_SkillDesc/SkillNameTxt2").GetComponent <Text>();
            Text   text3      = form.transform.Find("Panel_SkillDesc/SkillUnlockTxt").GetComponent <Text>();
            Text   text4      = form.transform.Find("Panel_SkillDesc/SkillDescTxt").GetComponent <Text>();
            string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(info.szIconPath));
            image.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false);
            prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_AddedSkill_Dir, dwUnlockSkillID);
            image2.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false);
            string str2 = Utility.UTF8Convert(info.szSkillName);
            text2.text = str2;
            text.text  = str2;
            text3.text = string.Format("Lv.{0}", dataByKey.wAcntLevel);
            text4.text = Utility.UTF8Convert(info.szSkillDesc);
            if (flag)
            {
                string[] args = new string[] { dataByKey.wAcntLevel.ToString() };
                text3.text = Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", args);
            }
            else
            {
                text3.text = Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_4");
            }
        }
    }
Beispiel #7
0
    public void AnalyseSkill(ref ActorPreloadTab loadInfo, int skillID)
    {
        if (skillID <= 0)
        {
            return;
        }
        ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)skillID);

        if (dataByKey == null)
        {
            return;
        }
        if (!this.skillIdList.Contains((long)skillID))
        {
            this.skillIdList.Add((long)skillID);
        }
        AssetLoadBase assetLoadBase = default(AssetLoadBase);

        assetLoadBase.assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szPrefab);
        string checkerKey = this.GetCheckerKey(assetLoadBase.assetPath, loadInfo.MarkID);

        if (this.ageCheckerSet.ContainsKey(checkerKey))
        {
            return;
        }
        loadInfo.ageActions.Add(assetLoadBase);
        this.ageCheckerSet.Add(checkerKey, true);
        string text = StringHelper.UTF8BytesToString(ref dataByKey.szGuidePrefab);

        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
        text = StringHelper.UTF8BytesToString(ref dataByKey.szGuideWarnPrefab);
        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
        text = StringHelper.UTF8BytesToString(ref dataByKey.szEffectPrefab);
        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
        text = StringHelper.UTF8BytesToString(ref dataByKey.szEffectWarnPrefab);
        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
    }
Beispiel #8
0
        public static ResSkillCfgInfo GetSkillCfgInfo(int skillId)
        {
            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)skillId);

            if (dataByKey == null)
            {
                return(null);
            }
            return(dataByKey);
        }
Beispiel #9
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);
        }
    }
Beispiel #10
0
        public static int GetSkillCombatEft(int skillId, int level)
        {
            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey(skillId);

            if (((dataByKey != null) && (dataByKey.iSkillCombatType >= 1)) && (dataByKey.iSkillCombatType <= 5))
            {
                ResSkillLvlUpInfo info2 = GameDataMgr.skillLvlUpDatabin.GetDataByKey((uint)level);
                if (info2 != null)
                {
                    return(info2.SkillCombatEft[dataByKey.iSkillCombatType - 1]);
                }
            }
            return(0);
        }
Beispiel #11
0
        private void OnOpenLvlUp(CUIEvent uiEvent)
        {
            int tag  = uiEvent.m_eventParams.tag;
            int tag2 = uiEvent.m_eventParams.tag2;

            if (tag2 > this._lastlvTarget)
            {
                CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(PVESettleSys.PATH_LEVELUP, false, true);

                if (cUIFormScript != null)
                {
                    PVESettleView.ShowPlayerLevelUp(cUIFormScript, tag, tag2);
                    uint key = 0u;
                    if (CAddSkillView.NewPlayerLevelUnlockAddSkill(tag2, tag, out key))
                    {
                        Transform transform = cUIFormScript.transform.FindChild("PlayerLvlUp/Panel/groupPanel/SkillPanel");
                        if (transform != null)
                        {
                            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey(key);
                            if (dataByKey != null)
                            {
                                transform.gameObject.CustomSetActive(true);
                                Text component = transform.FindChild("Skill/SkillName").GetComponent <Text>();
                                if (component != null)
                                {
                                    component.text = Utility.UTF8Convert(dataByKey.szSkillName);
                                }
                                Image component2 = transform.FindChild("Skill/Icon").GetComponent <Image>();
                                if (component2 != null)
                                {
                                    string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                                    component2.SetSprite(prefabPath, cUIFormScript, true, false, false, false);
                                }
                            }
                        }
                    }
                    else
                    {
                        Transform transform2 = cUIFormScript.transform.FindChild("PlayerLvlUp/Panel/groupPanel/SkillPanel");
                        if (transform2 != null)
                        {
                            transform2.gameObject.CustomSetActive(false);
                        }
                    }
                }
                this._lastlvTarget = tag2;
            }
        }
Beispiel #12
0
 public void AnalyseSkill(ref ActorPreloadTab loadInfo, int skillID)
 {
     if (skillID > 0)
     {
         ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey(skillID);
         if (dataByKey != null)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szPrefab)
             };
             string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID);
             if (!this.ageCheckerSet.ContainsKey(checkerKey))
             {
                 loadInfo.ageActions.Add(item);
                 this.ageCheckerSet.Add(checkerKey, true);
                 string str2 = StringHelper.UTF8BytesToString(ref dataByKey.szGuidePrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
                 str2 = StringHelper.UTF8BytesToString(ref dataByKey.szGuideWarnPrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
                 str2 = StringHelper.UTF8BytesToString(ref dataByKey.szEffectPrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
                 str2 = StringHelper.UTF8BytesToString(ref dataByKey.szEffectWarnPrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
             }
         }
     }
 }
Beispiel #13
0
        public void ChangeSkillIcon(int skillID)
        {
            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)skillID);

            if (dataByKey != null)
            {
                GameObject skillImg = this.GetSkillImg();
                if (skillImg != null)
                {
                    Image component = skillImg.GetComponent <Image>();
                    if (component != null)
                    {
                        component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szIconPath), Singleton <CBattleSystem> .GetInstance().FightFormScript, true, false, false, false);
                    }
                }
            }
        }
Beispiel #14
0
    private void AddActionsFromSkill(DictionaryView <string, Action> actions, int skillID)
    {
        if (skillID <= 0)
        {
            return;
        }
        ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)skillID);

        if (dataByKey == null)
        {
            return;
        }
        this.AddAction(actions, dataByKey.szPrefab);
        string text = StringHelper.UTF8BytesToString(ref dataByKey.szGuidePrefab);

        if (text != null && !this.prefabDict.ContainsKey(text))
        {
            this.prefabDict.Add(text, false);
        }
    }
Beispiel #15
0
 public int NextSkillEnergyCostTotal()
 {
     if (((this.Actor == 0) || (this.Actor.handle.SkillControl == null)) || !this.Actor.handle.SkillControl.bZeroCd)
     {
         int skillLevel = this.skillLevel;
         if (skillLevel == 0)
         {
             skillLevel++;
         }
         if ((this.SkillObj != null) && (this.SkillObj.cfgData != null))
         {
             ResSkillCfgInfo cfgData = this.SkillObj.cfgData;
             if (this.NextSkillObj != null)
             {
                 cfgData = this.NextSkillObj.cfgData;
             }
             if (cfgData != null)
             {
                 return(this.SkillEnergyCost(cfgData, skillLevel));
             }
         }
     }
     return(0);
 }
 private void AddActionsFromSkill(DictionaryView <string, AGE.Action> actions, int skillID)
 {
     if (skillID > 0)
     {
         ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)skillID);
         if (dataByKey != null)
         {
             this.AddAction(actions, dataByKey.szPrefab);
             string key = StringHelper.UTF8BytesToString(ref dataByKey.szGuidePrefab);
             if ((key != null) && !this.prefabDict.ContainsKey(key))
             {
                 this.prefabDict.Add(key, false);
             }
             if (dataByKey.dwIsBullet != 0)
             {
                 ResBulletCfgInfo info2 = GameDataMgr.bulletDatabin.GetDataByKey((long)dataByKey.iBulletID);
                 if (info2 != null)
                 {
                     this.AddAction(actions, info2.szPrefab);
                 }
             }
         }
     }
 }
        private static void ShowMultiLoading()
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CUILoadingSystem.PVP_PATH_LOADING, false, false);

            if (cUIFormScript == null)
            {
                return;
            }
            if (!Singleton <CUIEventManager> .GetInstance().HasUIEventListener(enUIEventID.IntimacyRela_LoadingClick))
            {
                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_LoadingClick, new CUIEventManager.OnUIEventHandler(CUILoadingSystem.On_IntimacyRela_LoadingClick));
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

            IGameActorDataProvider actorDataProvider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorStaticData actorStaticData = default(ActorStaticData);
            ActorMeta       actorMeta       = default(ActorMeta);
            ActorMeta       actorMeta2      = default(ActorMeta);
            ActorServerData actorServerData = default(ActorServerData);

            actorMeta.ActorType = ActorTypeDef.Actor_Type_Hero;
            for (int i = 1; i <= 2; i++)
            {
                List <Player> allCampPlayers = Singleton <GamePlayerCenter> .GetInstance().GetAllCampPlayers((COM_PLAYERCAMP)i);

                if (allCampPlayers == null)
                {
                    DebugHelper.Assert(false, "Loading Players is Null");
                }
                else
                {
                    Transform transform = (i == 1) ? cUIFormScript.transform.FindChild("UpPanel") : cUIFormScript.transform.FindChild("DownPanel");
                    int       num       = 1;
                    while ((long)num <= 5L)
                    {
                        string     name       = (i == 1) ? string.Format("Up_Player{0}", num) : string.Format("Down_Player{0}", num);
                        GameObject gameObject = transform.FindChild(name).gameObject;
                        gameObject.CustomSetActive(false);
                        num++;
                    }
                    List <Player> .Enumerator enumerator = allCampPlayers.GetEnumerator();
                    Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

                    COM_PLAYERCAMP playerCamp = hostPlayer.PlayerCamp;
                    while (enumerator.MoveNext())
                    {
                        Player current = enumerator.get_Current();
                        if (current != null)
                        {
                            bool       flag        = current.PlayerId == hostPlayer.PlayerId;
                            string     name2       = (i == 1) ? string.Format("Up_Player{0}", current.CampPos + 1) : string.Format("Down_Player{0}", current.CampPos + 1);
                            GameObject gameObject2 = transform.FindChild(name2).gameObject;
                            gameObject2.CustomSetActive(true);
                            GameObject gameObject3 = gameObject2.transform.Find("RankFrame").gameObject;
                            bool       flag2       = current.PlayerCamp == playerCamp && (!Singleton <WatchController> .GetInstance().IsWatching || !Singleton <WatchController> .GetInstance().IsReplaying);
                            if (gameObject3 != null)
                            {
                                if (flag2)
                                {
                                    string rankFrameIconPath = CLadderView.GetRankFrameIconPath((byte)current.GradeOfRank, current.ClassOfRank);
                                    if (string.IsNullOrEmpty(rankFrameIconPath))
                                    {
                                        gameObject3.CustomSetActive(false);
                                    }
                                    else
                                    {
                                        Image component = gameObject3.GetComponent <Image>();
                                        if (component != null)
                                        {
                                            component.SetSprite(rankFrameIconPath, cUIFormScript, true, false, false, false);
                                        }
                                        gameObject3.CustomSetActive(true);
                                    }
                                }
                                else
                                {
                                    gameObject3.CustomSetActive(false);
                                }
                            }
                            Transform transform2 = gameObject2.transform.Find("RankClassText");
                            if (transform2 != null)
                            {
                                GameObject gameObject4 = transform2.gameObject;
                                if (flag2 && CLadderView.IsSuperKing((byte)current.GradeOfRank, current.ClassOfRank))
                                {
                                    gameObject4.CustomSetActive(true);
                                    gameObject4.GetComponent <Text>().set_text(current.ClassOfRank.ToString());
                                }
                                else
                                {
                                    gameObject4.CustomSetActive(false);
                                }
                            }
                            Text component2 = gameObject2.transform.Find("Txt_PlayerName/Name").gameObject.GetComponent <Text>();
                            component2.set_text(current.Name);
                            Image component3 = gameObject2.transform.Find("Txt_PlayerName/NobeIcon").gameObject.GetComponent <Image>();
                            if (component3)
                            {
                                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component3, (int)current.VipLv, true, flag, current.privacyBits);
                            }
                            Text component4 = gameObject2.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>();
                            actorMeta.ConfigId = (int)current.CaptainId;
                            component4.set_text(actorDataProvider.GetActorStaticData(ref actorMeta, ref actorStaticData) ? actorStaticData.TheResInfo.Name : null);
                            GameObject gameObject5 = gameObject2.transform.Find("Txt_Qinmidu").gameObject;
                            if (gameObject5 != null)
                            {
                                if (current.IntimacyData != null)
                                {
                                    gameObject5.CustomSetActive(true);
                                    Text component5 = gameObject5.transform.Find("Text").gameObject.GetComponent <Text>();
                                    if (component5 != null)
                                    {
                                        component5.set_text(current.IntimacyData.title);
                                    }
                                    GameObject gameObject6 = gameObject5.transform.Find("BlueBg").gameObject;
                                    GameObject gameObject7 = gameObject5.transform.Find("RedBg").gameObject;
                                    if (current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_GAY || current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_SIDEKICK)
                                    {
                                        gameObject6.CustomSetActive(true);
                                        gameObject7.CustomSetActive(false);
                                    }
                                    else if (current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_LOVER || current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_BESTIE)
                                    {
                                        gameObject6.CustomSetActive(false);
                                        gameObject7.CustomSetActive(true);
                                    }
                                }
                                else
                                {
                                    gameObject5.CustomSetActive(false);
                                }
                            }
                            GameObject gameObject8 = gameObject2.transform.Find("btns").gameObject;
                            if (gameObject8 != null)
                            {
                                if (current.IntimacyData != null && IntimacyRelationViewUT.IsRelaState(current.IntimacyData.state))
                                {
                                    int    relaLevel           = IntimacyRelationViewUT.CalcRelaLevel(current.IntimacyData.intimacyValue);
                                    string relaIconByRelaLevel = IntimacyRelationViewUT.GetRelaIconByRelaLevel(relaLevel, current.IntimacyData.state);
                                    if (!string.IsNullOrEmpty(relaIconByRelaLevel))
                                    {
                                        Image componetInChild = Utility.GetComponetInChild <Image>(gameObject8, "btnRela");
                                        if (componetInChild != null)
                                        {
                                            componetInChild.gameObject.CustomSetActive(true);
                                            componetInChild.SetSprite(relaIconByRelaLevel, cUIFormScript, true, false, false, false);
                                        }
                                    }
                                }
                                else
                                {
                                    gameObject8.CustomSetActive(false);
                                }
                            }
                            component2.set_color(Color.white);
                            GameObject gameObject9 = gameObject2.transform.Find("Txt_PlayerName_Mine").gameObject;
                            if (flag)
                            {
                                gameObject9.CustomSetActive(true);
                            }
                            else
                            {
                                gameObject9.CustomSetActive(false);
                            }
                            GameObject gameObject10 = gameObject2.transform.Find("Txt_LoadingPct").gameObject;
                            if (gameObject10)
                            {
                                Text component6 = gameObject10.GetComponent <Text>();
                                if (current.Computer)
                                {
                                    component6.set_text(curLvelContext.m_isWarmBattle ? "1%" : "100%");
                                }
                                else
                                {
                                    component6.set_text((MonoSingleton <Reconnection> .instance.isProcessingRelayRecover || Singleton <WatchController> .GetInstance().IsWatching) ? "100%" : "1%");
                                }
                            }
                            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(current.CaptainId);
                            if (dataByKey != null)
                            {
                                actorMeta2.PlayerId  = current.PlayerId;
                                actorMeta2.ActorCamp = (COM_PLAYERCAMP)i;
                                actorMeta2.ConfigId  = (int)dataByKey.dwCfgID;
                                actorMeta2.ActorType = ActorTypeDef.Actor_Type_Hero;
                                Image component7 = gameObject2.transform.Find("Hero").gameObject.GetComponent <Image>();
                                if (actorDataProvider2.GetActorServerData(ref actorMeta2, ref actorServerData))
                                {
                                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)actorServerData.TheActorMeta.ConfigId, actorServerData.SkinId);
                                    if (heroSkin != null)
                                    {
                                        component7.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID), cUIFormScript, true, false, false, true);
                                        if (heroSkin.dwSkinID > 0u)
                                        {
                                            component4.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("LoadingSkinNameTxt"), heroSkin.szSkinName, heroSkin.szHeroName));
                                        }
                                        if (flag)
                                        {
                                            component4.set_color(CUIUtility.s_Text_Color_MyHeroName);
                                            Outline component8 = component4.gameObject.GetComponent <Outline>();
                                            if (component8 != null)
                                            {
                                                component8.set_effectColor(CUIUtility.s_Text_OutLineColor_MyHeroName);
                                            }
                                        }
                                    }
                                    bool      flag3      = current.PlayerCamp == playerCamp && (!Singleton <WatchController> .GetInstance().IsWatching || !Singleton <WatchController> .GetInstance().IsReplaying) && (curLvelContext.m_isWarmBattle || !current.Computer);
                                    Transform transform3 = gameObject2.transform.Find("heroProficiencyBgImg");
                                    if (transform3 != null)
                                    {
                                        transform3.gameObject.CustomSetActive(flag3);
                                        if (flag3)
                                        {
                                            CUICommonSystem.SetHeroProficiencyBgImage(cUIFormScript, transform3.gameObject, (int)actorServerData.TheProficiencyInfo.Level, true);
                                        }
                                    }
                                    Transform transform4 = gameObject2.transform.Find("heroProficiencyImg");
                                    if (transform4 != null)
                                    {
                                        transform4.gameObject.CustomSetActive(flag3);
                                        if (flag3)
                                        {
                                            CUICommonSystem.SetHeroProficiencyIconImage(cUIFormScript, transform4.gameObject, (int)actorServerData.TheProficiencyInfo.Level);
                                        }
                                    }
                                }
                                else
                                {
                                    component7.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), cUIFormScript, true, false, false, true);
                                }
                                uint num2 = 0u;
                                if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta2, out num2) && num2 != 0u)
                                {
                                    ResSkillCfgInfo dataByKey2 = GameDataMgr.skillDatabin.GetDataByKey(num2);
                                    if (dataByKey2 != null)
                                    {
                                        gameObject2.transform.Find("SelSkill").gameObject.CustomSetActive(true);
                                        string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey2.szIconPath));
                                        Image  component9 = gameObject2.transform.Find("SelSkill/Icon").GetComponent <Image>();
                                        component9.SetSprite(prefabPath, cUIFormScript.GetComponent <CUIFormScript>(), true, false, false, false);
                                    }
                                    else
                                    {
                                        gameObject2.transform.Find("SelSkill").gameObject.CustomSetActive(false);
                                    }
                                }
                                else
                                {
                                    gameObject2.transform.Find("SelSkill").gameObject.CustomSetActive(false);
                                }
                                Transform transform5 = gameObject2.transform.Find("skinLabelImage");
                                if (transform5 != null)
                                {
                                    CUICommonSystem.SetHeroSkinLabelPic(cUIFormScript, transform5.gameObject, dataByKey.dwCfgID, actorServerData.SkinId);
                                }
                            }
                        }
                        else
                        {
                            DebugHelper.Assert(false, "Loading Player is Null");
                        }
                    }
                }
            }
            GameObject widget  = cUIFormScript.GetWidget(0);
            GameObject widget2 = cUIFormScript.GetWidget(1);
            GameObject widget3 = cUIFormScript.GetWidget(2);

            if (curLvelContext.IsGameTypeGuildMatch())
            {
                widget.CustomSetActive(false);
                widget2.CustomSetActive(false);
                widget3.CustomSetActive(true);
                CSDT_CAMP_EXT_GUILDMATCH[] campExtGuildMatchInfo = curLvelContext.GetCampExtGuildMatchInfo();
                if (campExtGuildMatchInfo != null && campExtGuildMatchInfo.Length == 2)
                {
                    Image component10 = cUIFormScript.GetWidget(3).GetComponent <Image>();
                    Text  component11 = cUIFormScript.GetWidget(4).GetComponent <Text>();
                    Image component12 = cUIFormScript.GetWidget(5).GetComponent <Image>();
                    Text  component13 = cUIFormScript.GetWidget(6).GetComponent <Text>();
                    component10.SetSprite(CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + campExtGuildMatchInfo[0].dwGuildHeadID, cUIFormScript, true, false, false, false);
                    component11.set_text(StringHelper.UTF8BytesToString(ref campExtGuildMatchInfo[0].szGuildName));
                    component12.SetSprite(CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + campExtGuildMatchInfo[1].dwGuildHeadID, cUIFormScript, true, false, false, false);
                    component13.set_text(StringHelper.UTF8BytesToString(ref campExtGuildMatchInfo[1].szGuildName));
                }
            }
            else
            {
                widget.CustomSetActive(true);
                widget2.CustomSetActive(true);
                widget3.CustomSetActive(false);
                Text component14 = cUIFormScript.GetWidget(7).GetComponent <Text>();
                component14.set_text(CUILoadingSystem.GenerateRandomPvpLoadingTips(CUILoadingSystem.GenerateMultiRandomNum()));
                widget2.CustomSetActive(MonoSingleton <Reconnection> .instance.isProcessingRelayRecover);
            }
        }
Beispiel #18
0
        private static void ShowMultiLoading()
        {
            CUIFormScript formScript = Singleton <CUIManager> .GetInstance().OpenForm(PVP_PATH_LOADING, false, false);

            if (formScript != null)
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                GameObject widget = formScript.GetWidget(0);
                if (widget != null)
                {
                    if (MonoSingleton <Reconnection> .instance.isProcessingRelayRecover)
                    {
                        widget.CustomSetActive(true);
                    }
                    else
                    {
                        widget.CustomSetActive(false);
                    }
                }
                IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

                IGameActorDataProvider provider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

                ActorStaticData actorData = new ActorStaticData();
                ActorMeta       actorMeta = new ActorMeta();
                ActorMeta       meta2     = new ActorMeta();
                ActorServerData data2     = new ActorServerData();
                actorMeta.ActorType = ActorTypeDef.Actor_Type_Hero;
                string name = null;
                for (int i = 1; i <= 2; i++)
                {
                    List <Player> allCampPlayers = Singleton <GamePlayerCenter> .GetInstance().GetAllCampPlayers((COM_PLAYERCAMP)i);

                    if (allCampPlayers != null)
                    {
                        Transform transform = (i != 1) ? formScript.transform.FindChild("DownPanel") : formScript.transform.FindChild("UpPanel");
                        for (int j = 1; j <= 5L; j++)
                        {
                            name = (i != 1) ? string.Format("Down_Player{0}", j) : string.Format("Up_Player{0}", j);
                            transform.FindChild(name).gameObject.CustomSetActive(false);
                        }
                        List <Player> .Enumerator enumerator = allCampPlayers.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            Player current = enumerator.Current;
                            if (current != null)
                            {
                                name = (i != 1) ? string.Format("Down_Player{0}", current.CampPos + 1) : string.Format("Up_Player{0}", current.CampPos + 1);
                                GameObject gameObject = transform.FindChild(name).gameObject;
                                gameObject.CustomSetActive(true);
                                GameObject obj5 = gameObject.transform.Find("RankFrame").gameObject;
                                if (obj5 != null)
                                {
                                    if ((curLvelContext != null) && (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER))
                                    {
                                        string rankFrameIconPath = CLadderView.GetRankFrameIconPath((byte)current.GradeOfRank);
                                        if (string.IsNullOrEmpty(rankFrameIconPath))
                                        {
                                            obj5.CustomSetActive(false);
                                        }
                                        else
                                        {
                                            Image image = obj5.GetComponent <Image>();
                                            if (image != null)
                                            {
                                                image.SetSprite(rankFrameIconPath, formScript, true, false, false);
                                            }
                                            obj5.CustomSetActive(true);
                                        }
                                    }
                                    else
                                    {
                                        obj5.CustomSetActive(false);
                                    }
                                }
                                Text component = gameObject.transform.Find("Txt_PlayerName/Name").gameObject.GetComponent <Text>();
                                component.text = current.Name;
                                Image image2 = gameObject.transform.Find("Txt_PlayerName/NobeIcon").gameObject.GetComponent <Image>();
                                if (image2 != null)
                                {
                                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(image2, (int)current.VipLv, true);
                                }
                                Text text2 = gameObject.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>();
                                actorMeta.ConfigId = (int)current.CaptainId;
                                text2.text         = !actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData) ? null : actorData.TheResInfo.Name;
                                if (current.PlayerId == Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerId)
                                {
                                    component.color = CUIUtility.s_Text_Color_Self;
                                }
                                else
                                {
                                    component.color = CUIUtility.s_Text_Color_CommonGray;
                                }
                                GameObject obj6 = gameObject.transform.Find("Txt_LoadingPct").gameObject;
                                if (obj6 != null)
                                {
                                    Text text3 = obj6.GetComponent <Text>();
                                    if (current.Computer)
                                    {
                                        text3.text = !curLvelContext.isWarmBattle ? "100%" : "1%";
                                    }
                                    else
                                    {
                                        text3.text = !MonoSingleton <Reconnection> .instance.isProcessingRelayRecover ? "1%" : "100%";
                                    }
                                }
                                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(current.CaptainId);
                                if (dataByKey != null)
                                {
                                    meta2.PlayerId  = current.PlayerId;
                                    meta2.ActorCamp = (COM_PLAYERCAMP)i;
                                    meta2.ConfigId  = (int)dataByKey.dwCfgID;
                                    meta2.ActorType = ActorTypeDef.Actor_Type_Hero;
                                    Image image3 = gameObject.transform.Find("Hero").gameObject.GetComponent <Image>();
                                    if (provider2.GetActorServerData(ref meta2, ref data2))
                                    {
                                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)data2.TheActorMeta.ConfigId, data2.SkinId);
                                        if (heroSkin != null)
                                        {
                                            image3.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID), formScript, true, false, false);
                                        }
                                        bool      bActive    = curLvelContext.isWarmBattle || !current.Computer;
                                        Transform transform2 = gameObject.transform.Find("heroProficiencyBgImg");
                                        if (transform2 != null)
                                        {
                                            transform2.gameObject.CustomSetActive(bActive);
                                            if (bActive)
                                            {
                                                CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform2.gameObject, (int)data2.TheProficiencyInfo.Level, true);
                                            }
                                        }
                                        Transform transform3 = gameObject.transform.Find("heroProficiencyImg");
                                        if (transform3 != null)
                                        {
                                            transform3.gameObject.CustomSetActive(bActive);
                                            if (bActive)
                                            {
                                                CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform3.gameObject, (int)data2.TheProficiencyInfo.Level);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        image3.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), formScript, true, false, false);
                                    }
                                    uint skillID = 0;
                                    if (provider2.GetActorServerCommonSkillData(ref meta2, out skillID) && (skillID != 0))
                                    {
                                        ResSkillCfgInfo info2 = GameDataMgr.skillDatabin.GetDataByKey(skillID);
                                        if (info2 != null)
                                        {
                                            gameObject.transform.Find("SelSkill").gameObject.CustomSetActive(true);
                                            string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(info2.szIconPath));
                                            gameObject.transform.Find("SelSkill/Icon").GetComponent <Image>().SetSprite(prefabPath, formScript.GetComponent <CUIFormScript>(), true, false, false);
                                        }
                                        else
                                        {
                                            gameObject.transform.Find("SelSkill").gameObject.CustomSetActive(false);
                                        }
                                    }
                                    else
                                    {
                                        gameObject.transform.Find("SelSkill").gameObject.CustomSetActive(false);
                                    }
                                    Transform transform4 = gameObject.transform.Find("skinLabelImage");
                                    if (transform4 != null)
                                    {
                                        CUICommonSystem.SetHeroSkinLabelPic(formScript, transform4.gameObject, dataByKey.dwCfgID, data2.SkinId);
                                    }
                                }
                            }
                        }
                    }
                }
                formScript.gameObject.transform.FindChild("Img_Tiao").FindChild("Tips").gameObject.GetComponent <Text>().text = GenerateRandomPvpLoadingTips(GenerateMultiRandomNum());
            }
        }
    public static void OnRefresh(GameObject form, ushort addedSkillLevel)
    {
        CUIToggleListScript  component            = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
        CUIListElementScript cUIListElementScript = null;
        int selected = component.GetSelected();

        for (int i = 0; i < component.GetElementAmount(); i++)
        {
            cUIListElementScript = component.GetElemenet(i);
            if (i == selected)
            {
                cUIListElementScript.transform.Find("SkillNameTxt").GetComponent <Text>().set_color(CAddSkillView.SELECTED_COLOR);
            }
            else
            {
                cUIListElementScript.transform.Find("SkillNameTxt").GetComponent <Text>().set_color(CAddSkillView.UN_SELECTED_COLOR);
            }
        }
        ResSkillUnlock  dataByKey       = GameDataMgr.addedSkiilDatabin.GetDataByKey((uint)addedSkillLevel);
        uint            dwUnlockSkillID = dataByKey.dwUnlockSkillID;
        ResSkillCfgInfo dataByKey2      = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);

        if (dataByKey2 == null)
        {
            DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
            return;
        }
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        bool   flag       = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByKey.wAcntLevel;
        Image  component2 = form.transform.Find("Panel_SkillDesc/IconImg").GetComponent <Image>();
        Image  component3 = form.transform.Find("Panel_SkillDesc/ContentImg").GetComponent <Image>();
        Text   component4 = form.transform.Find("Panel_SkillDesc/SkillNameTxt").GetComponent <Text>();
        Text   component5 = form.transform.Find("Panel_SkillDesc/SkillNameTxt2").GetComponent <Text>();
        Text   component6 = form.transform.Find("Panel_SkillDesc/SkillUnlockTxt").GetComponent <Text>();
        Text   component7 = form.transform.Find("Panel_SkillDesc/SkillDescTxt").GetComponent <Text>();
        string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey2.szIconPath));

        component2.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_AddedSkill_Dir, dwUnlockSkillID);
        component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        Text   text  = component4;
        string text2 = Utility.UTF8Convert(dataByKey2.szSkillName);

        component5.set_text(text2);
        text.set_text(text2);
        component6.set_text(string.Format("Lv.{0}", dataByKey.wAcntLevel));
        component7.set_text(CUICommonSystem.GetSkillDescLobby(dataByKey2.szSkillDesc, CAddSkillView.HeroID));
        if (flag)
        {
            component6.set_text(Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", new string[]
            {
                dataByKey.wAcntLevel.ToString()
            }));
        }
        else
        {
            component6.set_text(Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_4"));
        }
        if ((ulong)dwUnlockSkillID == (ulong)((long)CAddSkillSys.SendSkillId) && masterRoleInfo.PvpLevel >= (uint)addedSkillLevel)
        {
            Singleton <CBattleGuideManager> .GetInstance().OpenBannerDlgByBannerGuideId(21u, null, false);

            Singleton <CUINewFlagSystem> .GetInstance().AddNewFlag(cUIListElementScript.gameObject, enNewFlagKey.New_SendSkill_V14, enNewFlagPos.enTopRight, 1f, 0f, 0f, enNewFlagType.enNewFlag);
        }
    }
    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);
            }
        }
    }