Exemple #1
0
        public int GetUnlockNeedPieces()
        {
            RarityParam rarityParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetRarityParam((int)this.rare);

            if (rarityParam != null)
            {
                return((int)rarityParam.UnitUnlockPieceNum);
            }
            return(0);
        }
Exemple #2
0
 public void Reset()
 {
     this.mArtifactParam = (ArtifactParam)null;
     this.mRarityParam   = (RarityParam)null;
     this.mRarity        = (OInt)0;
     this.mExp           = (OInt)0;
     this.mLv            = (OInt)1;
     this.mUniqueID      = (OLong)0L;
     this.mFavorite      = false;
 }
Exemple #3
0
        public static int GetJobRankCap(int unitRarity)
        {
            RarityParam rarityParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetRarityParam(unitRarity);

            if (rarityParam != null)
            {
                return((int)rarityParam.UnitJobLvCap);
            }
            return(1);
        }
Exemple #4
0
        private void RefreshAbilitList()
        {
            if (Object.op_Equality((Object)this.mAbilityTemplate, (Object)null))
            {
                return;
            }
            GameUtility.DestroyGameObjects(this.mAbilits);
            this.mAbilits.Clear();
            UnitData dataOfClass = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);

            if (dataOfClass == null)
            {
                return;
            }
            Transform          parent           = this.mAbilityTemplate.get_transform().get_parent();
            List <AbilityData> learnedAbilities = dataOfClass.GetAllLearnedAbilities();

            for (int index = 0; index < learnedAbilities.Count; ++index)
            {
                GameObject  gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.mAbilityTemplate);
                AbilityData data        = learnedAbilities[index];
                GameObject  gameObject2 = ((Component)gameObject1.get_transform().FindChild("icon")).get_gameObject();
                ((Component)gameObject1.get_transform().FindChild("locked")).get_gameObject().SetActive(false);
                ((ImageArray)gameObject2.GetComponent <ImageArray>()).ImageIndex = (int)data.SlotType;
                gameObject1.get_transform().SetParent(parent, false);
                DataSource.Bind <AbilityData>(gameObject1, data);
                gameObject1.SetActive(true);
                this.mAbilits.Add(gameObject1);
            }
            RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam((int)dataOfClass.UnitParam.raremax);

            for (int lv = dataOfClass.CurrentJob.Rank + 1; lv < JobParam.MAX_JOB_RANK; ++lv)
            {
                OString[] learningAbilitys = dataOfClass.CurrentJob.Param.GetLearningAbilitys(lv);
                if (learningAbilitys != null && (int)rarityParam.UnitJobLvCap >= lv)
                {
                    for (int index = 0; index < learningAbilitys.Length; ++index)
                    {
                        string key = (string)learningAbilitys[index];
                        if (!string.IsNullOrEmpty(key))
                        {
                            AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.GetAbilityParam(key);

                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.mAbilityTemplate);
                            ((ImageArray)((Component)gameObject.get_transform().FindChild("icon")).get_gameObject().GetComponent <ImageArray>()).ImageIndex = (int)abilityParam.slot;
                            gameObject.get_transform().SetParent(parent, false);
                            DataSource.Bind <AbilityParam>(gameObject, abilityParam);
                            gameObject.SetActive(true);
                            this.mAbilits.Add(gameObject);
                        }
                    }
                }
            }
            GameParameter.UpdateAll(((Component)parent).get_gameObject());
        }
Exemple #5
0
        public bool Setup(long iid, string iname, int num)
        {
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            this.mItemParam = instanceDirect.GetItemParam(iname);
            DebugUtility.Assert(this.mItemParam != null, "Failed ItemParam iname \"" + iname + "\" not found.");
            this.mRarityParam = instanceDirect.GetRarityParam((int)this.mItemParam.rare);
            this.mUniqueID    = iid;
            this.mNum         = num;
            if (!string.IsNullOrEmpty((string)this.mItemParam.skill))
            {
                int rank = 1;
                this.mSkill = new SkillData();
                this.mSkill.Setup((string)this.mItemParam.skill, rank, this.GetRankCap(), (MasterParam)null);
            }
            return(true);
        }
Exemple #6
0
        public bool Setup(string item_iname)
        {
            this.Reset();
            if (string.IsNullOrEmpty(item_iname))
            {
                return(false);
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            this.mItemParam   = instance.GetItemParam(item_iname);
            this.mRarityParam = instance.GetRarityParam(this.mItemParam.rare);
            if (!string.IsNullOrEmpty(this.mItemParam.skill))
            {
                int rank = this.CalcRank();
                this.mSkill = new SkillData();
                this.mSkill.Setup(this.mItemParam.skill, rank, (int)this.mRarityParam.EquipEnhanceParam.rankcap, (MasterParam)null);
            }
            return(true);
        }
Exemple #7
0
        private void UpdateEquipEffect()
        {
            RarityParam rarityParam = MonoSingleton <GameManager> .GetInstanceDirect().GetRarityParam(this.mArtifactParam.raremax);

            int rankcap = 1;

            if (rarityParam != null)
            {
                rankcap = (int)rarityParam.ArtifactLvCap;
            }
            if (this.mArtifactParam.equip_effects != null && (int)this.mRarity >= 0 && (int)this.mRarity < this.mArtifactParam.equip_effects.Length)
            {
                if (!string.IsNullOrEmpty(this.mArtifactParam.equip_effects[(int)this.mRarity]))
                {
                    if (this.mEquipSkill == null)
                    {
                        this.mEquipSkill = new SkillData();
                    }
                    this.mEquipSkill.Setup(this.mArtifactParam.equip_effects[(int)this.mRarity], (int)this.mLv, rankcap, (MasterParam)null);
                }
            }
            else
            {
                this.mEquipSkill = (SkillData)null;
            }
            if (this.mArtifactParam.attack_effects != null && (int)this.mRarity >= 0 && (int)this.mRarity < this.mArtifactParam.attack_effects.Length)
            {
                if (string.IsNullOrEmpty(this.mArtifactParam.attack_effects[(int)this.mRarity]))
                {
                    return;
                }
                if (this.mBattleEffectSkill == null)
                {
                    this.mBattleEffectSkill = new SkillData();
                }
                this.mBattleEffectSkill.Setup(this.mArtifactParam.attack_effects[(int)this.mRarity], (int)this.mLv, rankcap, (MasterParam)null);
            }
            else
            {
                this.mBattleEffectSkill = (SkillData)null;
            }
        }
Exemple #8
0
        public bool Deserialize(JSON_ConceptCardParam json, MasterParam master = null)
        {
            this.iname             = json.iname;
            this.name              = json.name;
            this.expr              = json.expr;
            this.type              = (eCardType)json.type;
            this.icon              = json.icon;
            this.rare              = json.rare;
            this.sell              = json.sell;
            this.en_cost           = json.en_cost;
            this.en_exp            = json.en_exp;
            this.en_trust          = json.en_trust;
            this.trust_reward      = json.trust_reward;
            this.first_get_unit    = json.first_get_unit;
            this.is_override_lvcap = true;
            this.lvcap             = json.lvcap;
            if (json.lvcap <= 0)
            {
                this.is_override_lvcap = false;
                RarityParam rarityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetRarityParam(this.rare);

                if (rarityParam != null)
                {
                    this.lvcap = (int)rarityParam.ConceptCardLvCap;
                }
            }
            if (json.effects != null)
            {
                this.effects = new ConceptCardEffectsParam[json.effects.Length];
                for (int index = 0; index < json.effects.Length; ++index)
                {
                    ConceptCardEffectsParam cardEffectsParam = new ConceptCardEffectsParam();
                    if (!cardEffectsParam.Deserialize(json.effects[index]))
                    {
                        return(false);
                    }
                    this.effects[index] = cardEffectsParam;
                }
            }
            this.not_sale = json.not_sale == 1;
            return(true);
        }
        private void RefreshStatus()
        {
            DataSource.Bind <UnitData>(this.UnitInfo, this.mCurrentUnit);
            RarityParam rarityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetRarityParam(this.mCurrentUnit.Rarity);

            this.UnitLv.set_text("1");
            this.UnitLvMax.set_text(rarityParam.UnitLvCap.ToString());
            for (int index = 0; index < StatusParam.MAX_STATUS; ++index)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStatusParamSlots[index], (UnityEngine.Object)null))
                {
                    this.mStatusParamSlots[index].set_text(this.mCurrentUnit.Status.param[(StatusTypes)index].ToString());
                }
            }
            this.Status_Renkei.set_text(this.mCurrentUnit.GetCombination().ToString());
            JobData jobData = this.mCurrentUnit.GetJobData(0);

            this.Status_Move.set_text(jobData.Param.mov.ToString());
            this.Status_Jump.set_text(jobData.Param.jmp.ToString());
            GameParameter.UpdateAll(this.UnitInfo);
        }
Exemple #10
0
        public void Deserialize(Json_Artifact json)
        {
            if (json == null || string.IsNullOrEmpty(json.iname))
            {
                this.Reset();
            }
            else
            {
                GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

                this.mArtifactParam = instanceDirect.MasterParam.GetArtifactParam(json.iname);
                this.mUniqueID      = (OLong)json.iid;
                this.mRarity        = (OInt)Math.Min(Math.Max(json.rare, this.mArtifactParam.rareini), this.mArtifactParam.raremax);
                this.mRarityParam   = instanceDirect.GetRarityParam((int)this.mRarity);
                this.mExp           = (OInt)json.exp;
                this.mLv            = (OInt)this.GetLevelFromExp((int)this.mExp);
                this.mFavorite      = json.fav != 0;
                this.UpdateEquipEffect();
                this.UpdateLearningAbilities(false);
            }
        }
Exemple #11
0
        private List <GenericBadge <ArtifactData> > AddCreatableInfo(List <ArtifactData> artifactDataList)
        {
            List <GenericBadge <ArtifactData> > genericBadgeList = new List <GenericBadge <ArtifactData> >();
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null) || instanceDirect.Player == null)
            {
                return(genericBadgeList);
            }
            List <ItemData> all = instanceDirect.Player.Items.FindAll((Predicate <ItemData>)(i => i.ItemType == EItemType.ArtifactPiece));

            using (List <ArtifactData> .Enumerator enumerator = artifactDataList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ArtifactData current = enumerator.Current;
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    ArtifactList.\u003CAddCreatableInfo\u003Ec__AnonStorey2F9 infoCAnonStorey2F9 = new ArtifactList.\u003CAddCreatableInfo\u003Ec__AnonStorey2F9();
                    // ISSUE: reference to a compiler-generated field
                    infoCAnonStorey2F9.artifactParam = current.ArtifactParam;
                    // ISSUE: reference to a compiler-generated method
                    ItemData itemData = all.Find(new Predicate <ItemData>(infoCAnonStorey2F9.\u003C\u003Em__301));
                    if (itemData == null)
                    {
                        genericBadgeList.Add(new GenericBadge <ArtifactData>(current, false));
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam(infoCAnonStorey2F9.artifactParam.rareini);

                        bool flag = itemData.Num >= (int)rarityParam.ArtifactCreatePieceNum;
                        genericBadgeList.Add(new GenericBadge <ArtifactData>(current, flag));
                    }
                }
            }
            return(genericBadgeList);
        }
Exemple #12
0
        private static bool ShouldShowKakera(ArtifactParam artifact, GameManager gm, ArtifactList.KakeraHideFlags flags)
        {
            RarityParam rarityParam = (RarityParam)null;

            if (artifact == null)
            {
                return(false);
            }
            if ((flags & (ArtifactList.KakeraHideFlags.EnoughKakera | ArtifactList.KakeraHideFlags.EnoughGold)) != (ArtifactList.KakeraHideFlags) 0)
            {
                rarityParam = gm.MasterParam.GetRarityParam(artifact.rareini);
            }
            if ((flags & (ArtifactList.KakeraHideFlags.LeastKakera | ArtifactList.KakeraHideFlags.EnoughKakera)) != (ArtifactList.KakeraHideFlags) 0)
            {
                int itemAmount = gm.Player.GetItemAmount(artifact.kakera);
                if ((flags & ArtifactList.KakeraHideFlags.LeastKakera) != (ArtifactList.KakeraHideFlags) 0 && itemAmount < 1 || (flags & ArtifactList.KakeraHideFlags.EnoughKakera) != (ArtifactList.KakeraHideFlags) 0 && itemAmount < (int)rarityParam.ArtifactCreatePieceNum)
                {
                    return(false);
                }
            }
            return((flags & ArtifactList.KakeraHideFlags.EnoughGold) == (ArtifactList.KakeraHideFlags) 0 || gm.Player.Gold >= (int)rarityParam.ArtifactCreateCost);
        }
Exemple #13
0
        private bool IsCreatableArtifact(List <ArtifactData> artifactDataList)
        {
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null) || instanceDirect.Player == null)
            {
                return(false);
            }
            List <ItemData> all = instanceDirect.Player.Items.FindAll((Predicate <ItemData>)(i => i.ItemType == EItemType.ArtifactPiece));

            using (List <ArtifactData> .Enumerator enumerator = artifactDataList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ArtifactData current = enumerator.Current;
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    ArtifactList.\u003CIsCreatableArtifact\u003Ec__AnonStorey2F8 artifactCAnonStorey2F8 = new ArtifactList.\u003CIsCreatableArtifact\u003Ec__AnonStorey2F8();
                    // ISSUE: reference to a compiler-generated field
                    artifactCAnonStorey2F8.artifactParam = current.ArtifactParam;
                    // ISSUE: reference to a compiler-generated method
                    ItemData itemData = all.Find(new Predicate <ItemData>(artifactCAnonStorey2F8.\u003C\u003Em__2FF));
                    if (itemData != null)
                    {
                        // ISSUE: reference to a compiler-generated field
                        RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam(artifactCAnonStorey2F8.artifactParam.rareini);

                        if (itemData.Num >= (int)rarityParam.ArtifactCreatePieceNum)
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
        private void Refresh()
        {
            UnitData data1 = (UnitData)null;

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)UnitEnhanceV3.Instance))
            {
                data1 = UnitEnhanceV3.Instance.CurrentUnit;
            }
            if (data1 == null)
            {
                data1 = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);
            }
            if (data1 == null && AbilityDetailWindow.BindObject != null)
            {
                data1 = AbilityDetailWindow.BindObject;
            }
            if (data1 == null)
            {
                DebugUtility.LogError("Not found bind unit data.");
            }
            else
            {
                AbilityData  abilityData  = data1.GetAbilityData((long)GlobalVars.SelectedAbilityUniqueID);
                AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.GetAbilityParam((string)GlobalVars.SelectedAbilityID);

                QuestClearUnlockUnitDataParam[]      unlockedSkills          = data1.UnlockedSkills;
                List <QuestClearUnlockUnitDataParam> unlockUnitDataParamList = new List <QuestClearUnlockUnitDataParam>();
                QuestClearUnlockUnitDataParam[]      allUnlockUnitDatas      = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnlockUnitDatas();

                if (allUnlockUnitDatas != null)
                {
                    for (int index = 0; index < allUnlockUnitDatas.Length; ++index)
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        AbilityDetailWindow.\u003CRefresh\u003Ec__AnonStorey2F5 refreshCAnonStorey2F5 = new AbilityDetailWindow.\u003CRefresh\u003Ec__AnonStorey2F5();
                        // ISSUE: reference to a compiler-generated field
                        refreshCAnonStorey2F5.param = allUnlockUnitDatas[index];
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated method
                        if (refreshCAnonStorey2F5.param.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill && refreshCAnonStorey2F5.param.uid == data1.UnitID && refreshCAnonStorey2F5.param.parent_id == abilityParam.iname && (unlockedSkills == null || Array.FindIndex <QuestClearUnlockUnitDataParam>(unlockedSkills, new Predicate <QuestClearUnlockUnitDataParam>(refreshCAnonStorey2F5.\u003C\u003Em__2F6)) == -1))
                        {
                            // ISSUE: reference to a compiler-generated field
                            unlockUnitDataParamList.Add(refreshCAnonStorey2F5.param);
                        }
                    }
                }
                RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam((int)data1.UnitParam.raremax);

                int num = Math.Min((int)rarityParam.UnitLvCap + (int)rarityParam.UnitAwakeLvCap, abilityParam.GetRankCap());
                DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data1);
                DataSource.Bind <AbilityData>(((Component)this).get_gameObject(), abilityData);
                AbilityParam data2 = abilityParam;
                if (AbilityDetailWindow.IsEnableSkillChange)
                {
                    string key = data1.SearchAbilityReplacementSkill(abilityParam.iname);
                    if (!string.IsNullOrEmpty(key))
                    {
                        data2 = MonoSingleton <GameManager> .Instance.GetAbilityParam(key);
                    }
                }
                DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), data2);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null))
                {
                    List <SkillParam> skillParamList = new List <SkillParam>();
                    if (abilityData != null && abilityData.LearningSkills != null)
                    {
                        for (int index1 = 0; index1 < abilityData.LearningSkills.Length; ++index1)
                        {
                            if (abilityData.LearningSkills[index1].locklv <= num)
                            {
                                string str1 = abilityData.LearningSkills[index1].iname;
                                if (unlockedSkills != null)
                                {
                                    for (int index2 = 0; index2 < unlockedSkills.Length; ++index2)
                                    {
                                        if (unlockedSkills[index2].old_id == str1)
                                        {
                                            str1 = unlockedSkills[index2].new_id;
                                            break;
                                        }
                                    }
                                }
                                if (AbilityDetailWindow.IsEnableSkillChange)
                                {
                                    string str2 = data1.SearchReplacementSkill(str1);
                                    if (!string.IsNullOrEmpty(str2))
                                    {
                                        str1 = str2;
                                    }
                                }
                                skillParamList.Add(MonoSingleton <GameManager> .Instance.GetSkillParam(str1));
                            }
                        }
                        if (unlockedSkills != null)
                        {
                            for (int index = 0; index < unlockedSkills.Length; ++index)
                            {
                                if (unlockedSkills[index].add && unlockedSkills[index].parent_id == abilityData.AbilityID)
                                {
                                    skillParamList.Add(MonoSingleton <GameManager> .Instance.GetSkillParam(unlockedSkills[index].new_id));
                                }
                            }
                        }
                    }
                    else
                    {
                        for (int index = 0; index < abilityParam.skills.Length; ++index)
                        {
                            if (abilityParam.skills[index].locklv <= num)
                            {
                                skillParamList.Add(MonoSingleton <GameManager> .Instance.GetSkillParam(abilityParam.skills[index].iname));
                            }
                        }
                    }
                    if (abilityData == data1.MasterAbility && data1.CollaboAbility != null)
                    {
                        using (List <SkillData> .Enumerator enumerator = data1.CollaboAbility.Skills.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                SkillData current = enumerator.Current;
                                skillParamList.Add(current.SkillParam);
                            }
                        }
                    }
                    for (int index = 0; index < skillParamList.Count; ++index)
                    {
                        GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate);
                        DataSource.Bind <SkillParam>(gameObject, skillParamList[index]);
                        gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                        gameObject.SetActive(true);
                    }
                    for (int index = 0; index < unlockUnitDataParamList.Count; ++index)
                    {
                        GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillLockedTemplate);
                        DataSource.Bind <SkillParam>(gameObject, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockUnitDataParamList[index].new_id));
                        DataSource.Bind <QuestClearUnlockUnitDataParam>(gameObject, unlockUnitDataParamList[index]);
                        gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                        gameObject.SetActive(true);
                    }
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
        }
        public void DisplaySlotType(EAbilitySlot slotType, bool hideEquipped = false)
        {
            this.mLastDisplayMode = UnitAbilityList.RefreshTypes.DisplayAll;
            this.mLastDisplaySlot = slotType;
            for (int index = 0; index < this.mItems.Count; ++index)
            {
                Object.Destroy((Object)((Component)this.mItems[index]).get_gameObject());
            }
            this.mItems.Clear();
            if (this.Unit == null)
            {
                this.Unit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            }
            if (this.Unit == null)
            {
                return;
            }
            List <AbilityData> learnedAbilities = this.Unit.GetAllLearnedAbilities();
            Transform          transform1       = ((Component)this).get_transform();
            bool        flag1    = false;
            GameManager instance = MonoSingleton <GameManager> .Instance;

            if ((instance.Player.TutorialFlags & 1L) == 0L && instance.GetNextTutorialStep() == "ShowAbilityTab")
            {
                instance.CompleteTutorialStep();
                if (instance.GetNextTutorialStep() == "ShowAbilityLvUp")
                {
                    flag1 = true;
                }
            }
            if (Object.op_Inequality((Object)this.Item_Normal, (Object)null))
            {
                for (int index1 = 0; index1 < learnedAbilities.Count; ++index1)
                {
                    AbilityData data = learnedAbilities[index1];
                    if ((slotType == ~EAbilitySlot.Action || slotType == data.SlotType) && (this.ShowFixedAbilities || !data.Param.is_fixed) && (this.ShowMasterAbilities || !((string)this.Unit.UnitParam.ability == data.AbilityID) && !this.Unit.IsQuestClearUnlocked(data.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)))
                    {
                        if (hideEquipped)
                        {
                            bool flag2 = false;
                            for (int index2 = 0; index2 < this.Unit.CurrentJob.AbilitySlots.Length; ++index2)
                            {
                                if (this.Unit.CurrentJob.AbilitySlots[index2] == data.UniqueID)
                                {
                                    flag2 = true;
                                    break;
                                }
                            }
                            if (flag2)
                            {
                                continue;
                            }
                        }
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Normal);
                        this.mItems.Add(abilityListItemEvents);
                        DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), data);
                        abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                        abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                        abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                        abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                        abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        JobData job;
                        int     rank;
                        if (this.GetAbilitySource(data.AbilityID, out job, out rank))
                        {
                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                            {
                                JobName = job.Name,
                                Rank    = rank
                            });
                        }
                        if (flag1 && index1 == 0)
                        {
                            SGHighlightObject.Instance().highlightedObject = ((Component)abilityListItemEvents.RankupButton).get_gameObject();
                            SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_1.023", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.TopLeft, true, false, false);
                        }
                    }
                }
            }
            if (slotType != ~EAbilitySlot.Action && Object.op_Inequality((Object)this.Item_SlotMismatch, (Object)null))
            {
                for (int index = 0; index < learnedAbilities.Count; ++index)
                {
                    AbilityData data = learnedAbilities[index];
                    if (slotType != data.SlotType && (this.ShowFixedAbilities || !data.Param.is_fixed) && (this.ShowMasterAbilities || !((string)this.Unit.UnitParam.ability == data.AbilityID) && !this.Unit.IsQuestClearUnlocked(data.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)))
                    {
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_SlotMismatch);
                        this.mItems.Add(abilityListItemEvents);
                        DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), data);
                        abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                        abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                        abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                        abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        JobData job;
                        int     rank;
                        if (this.GetAbilitySource(data.AbilityID, out job, out rank))
                        {
                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                            {
                                JobName = job.Name,
                                Rank    = rank
                            });
                        }
                    }
                }
            }
            if (Object.op_Inequality((Object)this.Item_Locked, (Object)null))
            {
                GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

                for (int index1 = 0; index1 < this.Unit.Jobs.Length; ++index1)
                {
                    if (this.ShowLockedJobAbilities || this.Unit.Jobs[index1].Rank > 0)
                    {
                        RarityParam rarityParam = instanceDirect.GetRarityParam((int)this.Unit.UnitParam.raremax);
                        for (int lv = this.Unit.Jobs[index1].Rank + 1; lv < JobParam.MAX_JOB_RANK; ++lv)
                        {
                            OString[] learningAbilitys = this.Unit.Jobs[index1].Param.GetLearningAbilitys(lv);
                            if (learningAbilitys != null && (int)rarityParam.UnitJobLvCap >= lv)
                            {
                                for (int index2 = 0; index2 < learningAbilitys.Length; ++index2)
                                {
                                    string key = (string)learningAbilitys[index2];
                                    if (!string.IsNullOrEmpty(key))
                                    {
                                        AbilityParam abilityParam = instanceDirect.GetAbilityParam(key);
                                        if (this.ShowFixedAbilities || !abilityParam.is_fixed)
                                        {
                                            UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                                            this.mItems.Add(abilityListItemEvents);
                                            DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                                            abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                                            abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                                            abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                                            abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                                            abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                                            ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                                            ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                                            {
                                                JobName = this.Unit.Jobs[index1].Name,
                                                Rank    = lv
                                            });
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (this.ShowMasterAbilities && !string.IsNullOrEmpty((string)this.Unit.UnitParam.ability) && this.Unit.LearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == (string)this.Unit.UnitParam.ability)) == null)
                {
                    AbilityParam abilityParam = instanceDirect.GetAbilityParam((string)this.Unit.UnitParam.ability);
                    UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                    this.mItems.Add(abilityListItemEvents);
                    DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                    abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                    abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                    abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                    abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                    abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                    ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                    ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                }
            }
            if (Object.op_Inequality((Object)this.ScrollParent, (Object)null))
            {
                this.mDecelerationRate = this.ScrollParent.get_decelerationRate();
                this.ScrollParent.set_decelerationRate(0.0f);
            }
            RectTransform transform2 = ((Component)this).get_transform() as RectTransform;

            transform2.set_anchoredPosition(new Vector2((float)transform2.get_anchoredPosition().x, 0.0f));
            this.StartCoroutine(this.RefreshScrollRect());
        }
        public void DisplaySlotType(EAbilitySlot slotType, bool hideEquipped = false, bool showDerivedAbility = false)
        {
            this.mLastDisplayMode = UnitAbilityList.RefreshTypes.DisplayAll;
            this.mLastDisplaySlot = slotType;
            for (int index = 0; index < this.mItems.Count; ++index)
            {
                UnityEngine.Object.Destroy((UnityEngine.Object)((Component)this.mItems[index]).get_gameObject());
            }
            this.mItems.Clear();
            if (this.Unit == null)
            {
                this.Unit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            }
            if (this.Unit == null)
            {
                return;
            }
            List <AbilityData> abilityDataList = !showDerivedAbility?this.Unit.GetAllLearnedAbilities(false) : this.Unit.GetAllLearnedAbilities(true);

            Transform transform = ((Component)this).get_transform();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_Normal, (UnityEngine.Object)null))
            {
                for (int index1 = 0; index1 < abilityDataList.Count; ++index1)
                {
                    AbilityData abilityData = abilityDataList[index1];
                    if ((slotType == ~EAbilitySlot.Action || slotType == abilityData.SlotType) && (this.ShowFixedAbilities || !abilityData.Param.is_fixed) && (this.ShowMasterAbilities || !(this.Unit.UnitParam.ability == abilityData.AbilityID) && !this.Unit.IsQuestClearUnlocked(abilityData.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)) && (this.Unit.MapEffectAbility != abilityData && (this.ShowMasterAbilities || !this.Unit.TobiraMasterAbilitys.Contains(abilityData))) && (!abilityData.IsDerivedAbility || (this.ShowFixedAbilities || !abilityData.DeriveBaseAbility.Param.is_fixed) && (this.ShowMasterAbilities || !(this.Unit.UnitParam.ability == abilityData.DeriveBaseAbility.AbilityID) && !this.Unit.IsQuestClearUnlocked(abilityData.DeriveBaseAbility.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)) && (this.Unit.MapEffectAbility != abilityData.DeriveBaseAbility && (this.ShowMasterAbilities || !this.Unit.TobiraMasterAbilitys.Contains(abilityData.DeriveBaseAbility)))))
                    {
                        if (hideEquipped)
                        {
                            bool flag = false;
                            for (int index2 = 0; index2 < this.Unit.CurrentJob.AbilitySlots.Length; ++index2)
                            {
                                if (this.Unit.CurrentJob.AbilitySlots[index2] == abilityData.UniqueID)
                                {
                                    flag = true;
                                    break;
                                }
                            }
                            if (flag)
                            {
                                continue;
                            }
                        }
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Normal);
                        this.mItems.Add(abilityListItemEvents);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        AbilityDeriveList component = (AbilityDeriveList)((Component)abilityListItemEvents).get_gameObject().GetComponent <AbilityDeriveList>();
                        if (UnityEngine.Object.op_Equality((UnityEngine.Object)component, (UnityEngine.Object)null))
                        {
                            DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), abilityData);
                            abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                            abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                            abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                            abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                            abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                            JobData job;
                            int     rank;
                            if (this.GetAbilitySource(abilityData.AbilityID, out job, out rank))
                            {
                                DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                                {
                                    JobName = job.Name,
                                    Rank    = rank
                                });
                            }
                        }
                        else if (abilityData.IsDerivedAbility)
                        {
                            component.SetupWithAbilityData(abilityData.DeriveBaseAbility, new List <AbilityData>()
                            {
                                abilityData
                            });
                            // ISSUE: method pointer
                            component.AddDetailOpenEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityDetail)));
                            // ISSUE: method pointer
                            component.AddSelectEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilitySelect)));
                            // ISSUE: method pointer
                            component.AddRankUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityRankUp)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnPressEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnPress)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnUp)));
                        }
                        else
                        {
                            component.SetupWithAbilityData(abilityData, (List <AbilityData>)null);
                            // ISSUE: method pointer
                            component.AddDetailOpenEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityDetail)));
                            // ISSUE: method pointer
                            component.AddSelectEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilitySelect)));
                            // ISSUE: method pointer
                            component.AddRankUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityRankUp)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnPressEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnPress)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnUp)));
                        }
                    }
                }
            }
            if (slotType != ~EAbilitySlot.Action && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_SlotMismatch, (UnityEngine.Object)null))
            {
                for (int index = 0; index < abilityDataList.Count; ++index)
                {
                    AbilityData data = abilityDataList[index];
                    if (slotType != data.SlotType && (this.ShowFixedAbilities || !data.Param.is_fixed) && (this.ShowMasterAbilities || !(this.Unit.UnitParam.ability == data.AbilityID) && !this.Unit.IsQuestClearUnlocked(data.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)) && (this.Unit.MapEffectAbility != data && (this.ShowMasterAbilities || !this.Unit.TobiraMasterAbilitys.Contains(data))))
                    {
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_SlotMismatch);
                        this.mItems.Add(abilityListItemEvents);
                        DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), data);
                        abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                        abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                        abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                        abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        JobData job;
                        int     rank;
                        if (this.GetAbilitySource(data.AbilityID, out job, out rank))
                        {
                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                            {
                                JobName = job.Name,
                                Rank    = rank
                            });
                        }
                    }
                }
            }
            List <string> overwrittenAbilitys = TobiraUtility.GetOverwrittenAbilitys(this.Unit);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_Locked, (UnityEngine.Object)null))
            {
                GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

                for (int index1 = 0; index1 < this.Unit.Jobs.Length; ++index1)
                {
                    if (this.ShowLockedJobAbilities || this.Unit.Jobs[index1].Rank > 0)
                    {
                        RarityParam rarityParam = instanceDirect.GetRarityParam((int)this.Unit.UnitParam.raremax);
                        for (int lv = this.Unit.Jobs[index1].Rank + 1; lv <= JobParam.MAX_JOB_RANK; ++lv)
                        {
                            OString[] learningAbilitys = this.Unit.Jobs[index1].Param.GetLearningAbilitys(lv);
                            if (learningAbilitys != null && (int)rarityParam.UnitJobLvCap >= lv)
                            {
                                for (int index2 = 0; index2 < learningAbilitys.Length; ++index2)
                                {
                                    string key = (string)learningAbilitys[index2];
                                    if (!string.IsNullOrEmpty(key))
                                    {
                                        AbilityParam abilityParam = instanceDirect.GetAbilityParam(key);
                                        if ((this.ShowFixedAbilities || !abilityParam.is_fixed) && !overwrittenAbilitys.Contains(abilityParam.iname))
                                        {
                                            UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                                            this.mItems.Add(abilityListItemEvents);
                                            DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                                            abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                                            abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                                            abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                                            abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                                            abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                                            ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                                            ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                                            {
                                                JobName = this.Unit.Jobs[index1].Name,
                                                Rank    = lv
                                            });
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (this.ShowMasterAbilities && !string.IsNullOrEmpty(this.Unit.UnitParam.ability) && (this.Unit.LearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == this.Unit.UnitParam.ability)) == null && !overwrittenAbilitys.Exists((Predicate <string>)(abil => abil == this.Unit.UnitParam.ability))))
                {
                    AbilityParam abilityParam = instanceDirect.GetAbilityParam(this.Unit.UnitParam.ability);
                    UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                    this.mItems.Add(abilityListItemEvents);
                    DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                    abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                    abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                    abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                    abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                    abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                    ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                    ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                }
            }
            this.ResetScrollPos();
        }
Exemple #17
0
        public override void UpdateValue()
        {
            ArtifactData  data          = (ArtifactData)null;
            ArtifactParam artifactParam = (ArtifactParam)null;
            GameManager   instance1     = MonoSingleton <GameManager> .Instance;

            if (this.InstanceType == ArtifactIcon.InstanceTypes.ArtifactData)
            {
                data = DataSource.FindDataOfClass <ArtifactData>(((Component)this).get_gameObject(), (ArtifactData)null);
            }
            else
            {
                artifactParam = DataSource.FindDataOfClass <ArtifactParam>(((Component)this).get_gameObject(), (ArtifactParam)null);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lv, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if ((int)data.Lv != this.mLastLv)
                    {
                        this.mLastLv = (int)data.Lv;
                        this.Lv.set_text(data.Lv.ToString());
                    }
                    ((Component)this.Lv).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.Lv).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PreLvCap, (UnityEngine.Object)null))
            {
                if (data != null && (int)data.Rarity > 0)
                {
                    this.PreLvCap.set_text(MonoSingleton <GameManager> .Instance.GetRarityParam((int)data.Rarity - 1).ArtifactLvCap.ToString());
                    ((Component)this.PreLvCap).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.PreLvCap).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LvCap, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if ((int)data.LvCap != this.mLastLvCap)
                    {
                        this.mLastLvCap = (int)data.LvCap;
                        this.LvCap.set_text(data.LvCap.ToString());
                    }
                    ((Component)this.LvCap).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.LvCap).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LvGauge, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if (data.Exp != this.mLastExpNum)
                    {
                        this.LvGauge.set_minValue(1f);
                        this.LvGauge.set_maxValue((float)(int)data.LvCap);
                        this.LvGauge.set_value((float)(int)data.Lv);
                    }
                    ((Component)this.LvGauge).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.LvGauge).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ExpGauge, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if (data.Exp != this.mLastExpNum)
                    {
                        if ((int)data.Lv >= (int)data.LvCap)
                        {
                            this.ExpGauge.set_minValue(0.0f);
                            Slider expGauge = this.ExpGauge;
                            float  num1     = 1f;
                            this.ExpGauge.set_value(num1);
                            double num2 = (double)num1;
                            expGauge.set_maxValue((float)num2);
                        }
                        else
                        {
                            int showExp = data.GetShowExp();
                            int nextExp = data.GetNextExp();
                            this.ExpGauge.set_minValue(0.0f);
                            this.ExpGauge.set_maxValue((float)(showExp + nextExp));
                            this.ExpGauge.set_value((float)showExp);
                        }
                    }
                    ((Component)this.ExpGauge).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.ExpGauge).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PieceGauge, (UnityEngine.Object)null))
            {
                if (artifactParam != null)
                {
                    this.PieceGauge.set_minValue(0.0f);
                    ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera);

                    this.PieceGauge.set_maxValue((float)(int)MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini).ArtifactCreatePieceNum);
                    this.PieceGauge.set_value(itemDataByItemId == null ? 0.0f : (float)itemDataByItemId.Num);
                    ((Component)this.PieceGauge).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.PieceGauge).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null))
            {
                if (data != null || artifactParam != null)
                {
                    string path = AssetPath.ArtifactIcon(data == null ? artifactParam : data.ArtifactParam);
                    instance1.ApplyTextureAsync(this.Icon, path);
                }
                else
                {
                    instance1.CancelTextureLoadRequest(this.Icon);
                    this.Icon.set_texture((Texture)null);
                }
            }
            int index1 = 0;
            int index2 = 0;

            if (data != null)
            {
                index1 = (int)data.Rarity;
                index2 = (int)data.RarityCap;
            }
            else if (artifactParam != null)
            {
                index1 = artifactParam.rareini;
                index2 = artifactParam.raremax;
            }
            if (data != null || artifactParam != null)
            {
                bool flag1 = data != null && data.CheckEnableRarityUp() == ArtifactData.RarityUpResults.Success;
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUp, (UnityEngine.Object)null))
                {
                    this.RarityUp.SetActive(flag1);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUpBack, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null))
                {
                    ((Behaviour)this.RarityUpBack).set_enabled(flag1);
                    ((Behaviour)this.DefaultBack).set_enabled(!flag1);
                }
                bool flag2 = false;
                if (artifactParam != null)
                {
                    ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera);

                    if (itemDataByItemId != null)
                    {
                        RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini);

                        flag2 = itemDataByItemId.Num >= (int)rarityParam.ArtifactCreatePieceNum;
                    }
                    else
                    {
                        flag2 = false;
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreate, (UnityEngine.Object)null))
                {
                    this.CanCreate.SetActive(flag2);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreateBack, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null))
                {
                    ((Behaviour)this.CanCreateBack).set_enabled(flag2);
                    ((Behaviour)this.DefaultBack).set_enabled(!flag2);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreateGauge, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null))
                {
                    ((Behaviour)this.CanCreateGauge).set_enabled(flag2);
                    ((Behaviour)this.DefaultBack).set_enabled(!flag2);
                }
                if (this.NotCreateGrayIcon != null && this.NotCreateGrayIcon.Length > 0)
                {
                    if (flag2)
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayIcon[index3]).set_color(Color.get_white());
                        }
                    }
                    else
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayIcon[index3]).set_color(Color.get_cyan());
                        }
                    }
                }
                if (this.NotCreateGrayRawIcon != null && this.NotCreateGrayRawIcon.Length > 0)
                {
                    if (flag2)
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayRawIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayRawIcon[index3]).set_color(Color.get_white());
                        }
                    }
                    else
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayRawIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayRawIcon[index3]).set_color(Color.get_cyan());
                        }
                    }
                }
                if (data != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NotRarityUp, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanRarityUp, (UnityEngine.Object)null))
                {
                    bool flag3 = (int)data.Rarity == (int)data.RarityCap;
                    this.NotRarityUp.SetActive(flag3);
                    this.CanRarityUp.SetActive(!flag3);
                }
                if (data != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUpCost, (UnityEngine.Object)null))
                {
                    this.RarityUpCost.set_text(data.GetKakeraNeedNum().ToString());
                }
                if (artifactParam != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TransmuteCost, (UnityEngine.Object)null))
                {
                    this.TransmuteCost.set_text((int)MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini).ArtifactCreatePieceNum.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PieceNum, (UnityEngine.Object)null))
                {
                    ItemData itemData = data == null ? MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera) : MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(data.Kakera);

                    if (itemData != null)
                    {
                        this.PieceNum.set_text(itemData.Num.ToString());
                        if (data != null && data.CheckEnableRarityUp() == ArtifactData.RarityUpResults.Success)
                        {
                            ((Graphic)this.PieceNum).set_color(Color.get_yellow());
                        }
                        else
                        {
                            ((Graphic)this.PieceNum).set_color(Color.get_white());
                        }
                    }
                    else
                    {
                        this.PieceNum.set_text("0");
                        ((Graphic)this.PieceNum).set_color(Color.get_white());
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Rarity, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index1 < instance2.ArtifactIcon_Rarity.Length)
                    {
                        this.Rarity.set_sprite(instance2.ArtifactIcon_Rarity[index1]);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMax, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index2 < instance2.ArtifactIcon_RarityBG.Length)
                    {
                        this.RarityMax.set_sprite(instance2.ArtifactIcon_RarityBG[index2]);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityText, (UnityEngine.Object)null))
                {
                    this.RarityText.set_text((index1 + 1).ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMaxText, (UnityEngine.Object)null))
                {
                    this.RarityMaxText.set_text((index2 + 1).ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Frame, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index1 < instance2.ArtifactIcon_Frames.Length)
                    {
                        this.Frame.set_sprite(instance2.ArtifactIcon_Frames[index1]);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Category, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && (data != null || artifactParam != null))
                    {
                        switch (data == null ? (int)artifactParam.type : (int)data.ArtifactParam.type)
                        {
                        case 1:
                            this.Category.set_sprite(instance2.ArtifactIcon_Weapon);
                            break;

                        case 2:
                            this.Category.set_sprite(instance2.ArtifactIcon_Armor);
                            break;

                        case 3:
                            this.Category.set_sprite(instance2.ArtifactIcon_Misc);
                            break;
                        }
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecKakeraNum, (UnityEngine.Object)null))
                {
                    this.DecKakeraNum.set_text(data.GetKakeraChangeNum().ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecCost, (UnityEngine.Object)null))
                {
                    this.DecCost.set_text(data.RarityParam.ArtifactChangeCost.ToString());
                }
            }
            else
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Rarity, (UnityEngine.Object)null))
                {
                    this.Rarity.set_sprite((Sprite)null);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMax, (UnityEngine.Object)null))
                {
                    this.RarityMax.set_sprite((Sprite)null);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Frame, (UnityEngine.Object)null))
                {
                    this.Frame.set_sprite((Sprite)null);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Category, (UnityEngine.Object)null))
                {
                    this.Category.set_sprite((Sprite)null);
                }
            }
            bool flag = false;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Owner, (UnityEngine.Object)null))
            {
                if (data != null && this.SetOwnerIcon(instance1, data))
                {
                    this.Owner.SetActive(true);
                    flag = true;
                }
                else
                {
                    this.Owner.SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Favorite, (UnityEngine.Object)null))
            {
                if (data != null && data.IsFavorite)
                {
                    this.Favorite.SetActive(true);
                    flag = true;
                }
                else
                {
                    this.Favorite.SetActive(false);
                }
            }
            if (this.ForceMask)
            {
                flag = true;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LockMask, (UnityEngine.Object)null))
            {
                this.LockMask.SetActive(flag);
            }
            if (data == null)
            {
                return;
            }
            this.mLastExpNum = data.Exp;
        }
Exemple #18
0
        public Json_Unit GetJson_Unit()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            if (Object.op_Equality((Object)instance, (Object)null))
            {
                return((Json_Unit)null);
            }
            if (instance.GetUnitParam(this.mUnitIName) == null)
            {
                return((Json_Unit)null);
            }
            Json_Unit jsonUnit = new Json_Unit();

            jsonUnit.iid    = this.mDraftUnitId;
            jsonUnit.iname  = this.mUnitIName;
            jsonUnit.rare   = this.mRare;
            jsonUnit.plus   = this.mAwake;
            jsonUnit.exp    = instance.MasterParam.GetUnitLevelExp(this.mLevel);
            jsonUnit.lv     = this.mLevel;
            jsonUnit.fav    = 0;
            jsonUnit.elem   = 0;
            jsonUnit.select = new Json_UnitSelectable();
            jsonUnit.jobs   = new Json_Job[this.mVersusDraftUnitJobs.Count];
            for (int index1 = 0; index1 < this.mVersusDraftUnitJobs.Count; ++index1)
            {
                JobParam jobParam = instance.GetJobParam(this.mVersusDraftUnitJobs[index1].mIName);
                if (jobParam != null && jobParam.ranks.Length > this.mVersusDraftUnitJobs[index1].mRank)
                {
                    JobRankParam rank    = jobParam.ranks[this.mVersusDraftUnitJobs[index1].mRank];
                    Json_Job     jsonJob = new Json_Job();
                    jsonJob.iid    = this.mDummyIID * 10L + (long)index1;
                    jsonJob.iname  = this.mVersusDraftUnitJobs[index1].mIName;
                    jsonJob.rank   = this.mVersusDraftUnitJobs[index1].mRank;
                    jsonJob.equips = new Json_Equip[JobRankParam.MAX_RANKUP_EQUIPS];
                    if (this.mVersusDraftUnitJobs[index1].mEquip)
                    {
                        for (int index2 = 0; index2 < JobRankParam.MAX_RANKUP_EQUIPS; ++index2)
                        {
                            jsonJob.equips[index2] = new Json_Equip()
                            {
                                iid   = jsonJob.iid * 10L + (long)index2,
                                iname = rank.equips[index2]
                            }
                        }
                        ;
                    }
                    jsonJob.select           = new Json_JobSelectable();
                    jsonJob.select.abils     = new long[5];
                    jsonJob.select.artifacts = new long[3];
                    List <Json_Ability> jsonAbilityList = new List <Json_Ability>();
                    List <string>       stringList      = new List <string>();
                    stringList.Add(jobParam.fixed_ability);
                    for (int index2 = 1; index2 <= jsonJob.rank; ++index2)
                    {
                        if (jobParam.ranks.Length >= index2 && jobParam.ranks[index2] != null && jobParam.ranks[index2].learnings != null)
                        {
                            for (int index3 = 0; index3 < jobParam.ranks[index2].learnings.Length; ++index3)
                            {
                                stringList.Add((string)jobParam.ranks[index2].learnings[index3]);
                            }
                        }
                    }
                    for (int index2 = 0; index2 < stringList.Count; ++index2)
                    {
                        Json_Ability jsonAbility = new Json_Ability();
                        jsonAbility.iid   = jsonJob.iid * 10L + (long)index2;
                        jsonAbility.iname = stringList[index2];
                        jsonAbility.exp   = 0;
                        jsonAbilityList.Add(jsonAbility);
                        if (this.mAbilities.ContainsKey(jsonAbility.iname))
                        {
                            jsonAbility.exp = this.mAbilities[jsonAbility.iname].mLevel - 1;
                            jsonAbility.iid = this.mAbilities[jsonAbility.iname].mIID;
                        }
                    }
                    jsonJob.abils = jsonAbilityList.ToArray();
                    if (index1 == this.mSelectJobIndex)
                    {
                        jsonUnit.select.job = jsonJob.iid;
                        jsonJob.artis       = new Json_Artifact[3];
                        for (int index2 = 0; index2 < this.mVersusDraftUnitArtifacts.Count; ++index2)
                        {
                            Json_Artifact jsonArtifact = new Json_Artifact();
                            jsonArtifact.iid                 = jsonJob.iid * 100L + (long)index2;
                            jsonArtifact.iname               = this.mVersusDraftUnitArtifacts[index2].mIName;
                            jsonArtifact.rare                = this.mVersusDraftUnitArtifacts[index2].mRare;
                            jsonArtifact.exp                 = ArtifactData.StaticCalcExpFromLevel(this.mVersusDraftUnitArtifacts[index2].mLevel);
                            jsonJob.artis[index2]            = jsonArtifact;
                            jsonJob.select.artifacts[index2] = jsonArtifact.iid;
                        }
                        int index3 = 0;
                        using (Dictionary <string, VersusDraftUnitAbility> .ValueCollection.Enumerator enumerator = this.mAbilities.Values.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                VersusDraftUnitAbility current = enumerator.Current;
                                jsonJob.select.abils[index3] = current.mIID;
                                ++index3;
                            }
                        }
                        jsonJob.cur_skin = this.mSkinIName;
                    }
                    jsonUnit.jobs[index1] = jsonJob;
                }
            }
            if (!string.IsNullOrEmpty(this.mMasterAbilityIName))
            {
                jsonUnit.abil       = new Json_MasterAbility();
                jsonUnit.abil.iid   = this.mDummyIID;
                jsonUnit.abil.iname = this.mMasterAbilityIName;
                jsonUnit.abil.exp   = 0;
            }
            ConceptCardParam conceptCardParam = instance.MasterParam.GetConceptCardParam(this.mConceptCardIName);

            if (conceptCardParam != null)
            {
                RarityParam rarityParam = instance.GetRarityParam(conceptCardParam.rare);
                jsonUnit.concept_card             = new JSON_ConceptCard();
                jsonUnit.concept_card.iname       = this.mConceptCardIName;
                jsonUnit.concept_card.iid         = this.mDummyIID;
                jsonUnit.concept_card.plus        = (int)rarityParam.ConceptCardAwakeCountMax;
                jsonUnit.concept_card.exp         = instance.MasterParam.GetConceptCardLevelExp(conceptCardParam.rare, this.mConceptCardLevel);
                jsonUnit.concept_card.trust       = 0;
                jsonUnit.concept_card.trust_bonus = 0;
                jsonUnit.concept_card.fav         = 0;
            }
            jsonUnit.doors = new Json_Tobira[this.mVersusDraftUnitDoors.Count];
            List <Json_Ability> jsonAbilityList1 = new List <Json_Ability>();

            for (int index1 = 0; index1 < this.mVersusDraftUnitDoors.Count; ++index1)
            {
                Json_Tobira jsonTobira = new Json_Tobira();
                jsonTobira.category    = (int)this.mVersusDraftUnitDoors[index1].mCategory;
                jsonTobira.lv          = this.mVersusDraftUnitDoors[index1].mLevel;
                jsonUnit.doors[index1] = jsonTobira;
                TobiraParam tobiraParam = instance.MasterParam.GetTobiraParam(this.mUnitIName, this.mVersusDraftUnitDoors[index1].mCategory);
                if (tobiraParam != null)
                {
                    for (int index2 = 0; index2 < tobiraParam.LeanAbilityParam.Length; ++index2)
                    {
                        TobiraLearnAbilityParam learnAbilityParam = tobiraParam.LeanAbilityParam[index2];
                        if (learnAbilityParam.Level <= jsonTobira.lv)
                        {
                            switch (learnAbilityParam.AbilityAddType)
                            {
                            case TobiraLearnAbilityParam.AddType.JobOverwrite:
                                for (int index3 = 0; index3 < jsonUnit.jobs.Length; ++index3)
                                {
                                    for (int index4 = 0; index4 < jsonUnit.jobs[index3].abils.Length; ++index4)
                                    {
                                        if (jsonUnit.jobs[index3].abils[index4].iname == learnAbilityParam.AbilityOverwrite)
                                        {
                                            jsonUnit.jobs[index3].abils[index4].iname = learnAbilityParam.AbilityIname;
                                            if (this.mAbilities.ContainsKey(learnAbilityParam.AbilityIname))
                                            {
                                                jsonUnit.jobs[index3].abils[index4].iid = this.mAbilities[learnAbilityParam.AbilityIname].mIID;
                                                jsonUnit.jobs[index3].abils[index4].exp = this.mAbilities[learnAbilityParam.AbilityIname].mLevel - 1;
                                            }
                                        }
                                    }
                                }
                                continue;

                            case TobiraLearnAbilityParam.AddType.MasterAdd:
                                jsonAbilityList1.Add(new Json_Ability()
                                {
                                    iid   = this.mDummyIID * 100L + (long)(index1 * 10) + (long)index2,
                                    iname = learnAbilityParam.AbilityIname,
                                    exp   = 0
                                });
                                continue;

                            default:
                                continue;
                            }
                        }
                    }
                }
            }
            jsonUnit.door_abils = jsonAbilityList1.ToArray();
            return(jsonUnit);
        }
    }
        private void Refresh()
        {
            UnitData data1 = (UnitData)null;

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)UnitEnhanceV3.Instance))
            {
                data1 = UnitEnhanceV3.Instance.CurrentUnit;
            }
            if (data1 == null)
            {
                data1 = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);
            }
            if (data1 == null && AbilityDetailWindow.BindUnit != null)
            {
                data1 = AbilityDetailWindow.BindUnit;
            }
            if (data1 == null && AbilityDetailWindow.BindAbility == null)
            {
                DebugUtility.LogError("Not found bind unit data.");
            }
            else
            {
                if (AbilityDetailWindow.BindAbility != null)
                {
                    DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), AbilityDetailWindow.BindAbility);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null))
                    {
                        List <AbilityDetailWindow.ViewContentParam> viewContentParams = new List <AbilityDetailWindow.ViewContentParam>();
                        if (AbilityDetailWindow.BindAbility.skills != null)
                        {
                            for (int index = 0; index < AbilityDetailWindow.BindAbility.skills.Length; ++index)
                            {
                                SkillParam skillParam = MonoSingleton <GameManager> .Instance.GetSkillParam(AbilityDetailWindow.BindAbility.skills[index].iname);

                                AbilityDetailWindow.AddSkillParam(viewContentParams, skillParam, (SkillDeriveParam)null);
                            }
                        }
                        for (int index = 0; index < viewContentParams.Count; ++index)
                        {
                            GameObject      gameObject          = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate);
                            SkillDeriveList componentInChildren = (SkillDeriveList)gameObject.GetComponentInChildren <SkillDeriveList>();
                            componentInChildren.Setup(viewContentParams[index].m_SkillParam, viewContentParams[index].m_SkillDeriveParams);
                            gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                            gameObject.SetActive(true);
                            this.m_SkillDeriveList.Add(componentInChildren);
                        }
                    }
                }
                else
                {
                    AbilityData  data2        = data1.GetAbilityData((long)GlobalVars.SelectedAbilityUniqueID);
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.GetAbilityParam((string)GlobalVars.SelectedAbilityID);

                    QuestClearUnlockUnitDataParam[]      unlockedSkills          = data1.UnlockedSkills;
                    List <QuestClearUnlockUnitDataParam> unlockUnitDataParamList = new List <QuestClearUnlockUnitDataParam>();
                    QuestClearUnlockUnitDataParam[]      allUnlockUnitDatas      = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnlockUnitDatas();

                    if (allUnlockUnitDatas != null)
                    {
                        for (int index = 0; index < allUnlockUnitDatas.Length; ++index)
                        {
                            QuestClearUnlockUnitDataParam param = allUnlockUnitDatas[index];
                            if (param.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill && param.uid == data1.UnitID && param.parent_id == abilityParam.iname && (unlockedSkills == null || Array.FindIndex <QuestClearUnlockUnitDataParam>(unlockedSkills, (Predicate <QuestClearUnlockUnitDataParam>)(p => p.iname == param.iname)) == -1))
                            {
                                unlockUnitDataParamList.Add(param);
                            }
                        }
                    }
                    if (data2 != null && data2.Param != null && data2.IsDeriveBaseAbility)
                    {
                        data2 = data2.DerivedAbility;
                    }
                    RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam((int)data1.UnitParam.raremax);

                    int num = Math.Min((int)rarityParam.UnitLvCap + (int)rarityParam.UnitAwakeLvCap, abilityParam.GetRankCap());
                    DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data1);
                    DataSource.Bind <AbilityData>(((Component)this).get_gameObject(), data2);
                    AbilityParam data3 = abilityParam;
                    if (AbilityDetailWindow.IsEnableSkillChange)
                    {
                        string key = data1.SearchAbilityReplacementSkill(abilityParam.iname);
                        if (!string.IsNullOrEmpty(key))
                        {
                            data3 = MonoSingleton <GameManager> .Instance.GetAbilityParam(key);
                        }
                    }
                    DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), data3);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null))
                    {
                        List <AbilityDetailWindow.ViewContentParam> viewContentParams = new List <AbilityDetailWindow.ViewContentParam>();
                        if (data2 != null && data2.LearningSkills != null)
                        {
                            for (int index1 = 0; index1 < data2.LearningSkills.Length; ++index1)
                            {
                                if (data2.LearningSkills[index1].locklv <= num)
                                {
                                    string str1 = data2.LearningSkills[index1].iname;
                                    if (unlockedSkills != null)
                                    {
                                        for (int index2 = 0; index2 < unlockedSkills.Length; ++index2)
                                        {
                                            if (unlockedSkills[index2].old_id == str1)
                                            {
                                                str1 = unlockedSkills[index2].new_id;
                                                break;
                                            }
                                        }
                                    }
                                    if (AbilityDetailWindow.IsEnableSkillChange)
                                    {
                                        string str2 = data1.SearchReplacementSkill(str1);
                                        if (!string.IsNullOrEmpty(str2))
                                        {
                                            str1 = str2;
                                        }
                                    }
                                    SkillData[] deriveSkills = data2.FindDeriveSkills(str1);
                                    if (deriveSkills.Length > 0)
                                    {
                                        foreach (SkillData skillData in deriveSkills)
                                        {
                                            AbilityDetailWindow.AddSkillParam(viewContentParams, skillData.SkillParam, skillData.DeriveParam);
                                        }
                                    }
                                    else
                                    {
                                        AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(str1), (SkillDeriveParam)null);
                                    }
                                }
                            }
                            if (unlockedSkills != null)
                            {
                                for (int index = 0; index < unlockedSkills.Length; ++index)
                                {
                                    if (unlockedSkills[index].add && unlockedSkills[index].parent_id == data2.AbilityID)
                                    {
                                        AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockedSkills[index].new_id), (SkillDeriveParam)null);
                                    }
                                }
                            }
                        }
                        else
                        {
                            for (int index = 0; index < abilityParam.skills.Length; ++index)
                            {
                                if (abilityParam.skills[index].locklv <= num)
                                {
                                    AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(abilityParam.skills[index].iname), (SkillDeriveParam)null);
                                }
                            }
                        }
                        if (data1.MasterAbility != null && data1.CollaboAbility != null)
                        {
                            AbilityData abilityData = data1.MasterAbility;
                            if (data1.MasterAbility.IsDeriveBaseAbility)
                            {
                                abilityData = data1.MasterAbility.DerivedAbility;
                            }
                            if (abilityData == data2)
                            {
                                using (List <SkillData> .Enumerator enumerator = data1.CollaboAbility.Skills.GetEnumerator())
                                {
                                    while (enumerator.MoveNext())
                                    {
                                        SkillData current = enumerator.Current;
                                        AbilityDetailWindow.AddSkillParam(viewContentParams, current.SkillParam, (SkillDeriveParam)null);
                                    }
                                }
                            }
                        }
                        for (int index = 0; index < viewContentParams.Count; ++index)
                        {
                            GameObject      gameObject          = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate);
                            SkillDeriveList componentInChildren = (SkillDeriveList)gameObject.GetComponentInChildren <SkillDeriveList>();
                            componentInChildren.Setup(viewContentParams[index].m_SkillParam, viewContentParams[index].m_SkillDeriveParams);
                            gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                            gameObject.SetActive(true);
                            this.m_SkillDeriveList.Add(componentInChildren);
                        }
                        for (int index = 0; index < unlockUnitDataParamList.Count; ++index)
                        {
                            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillLockedTemplate);
                            DataSource.Bind <SkillParam>(gameObject, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockUnitDataParamList[index].new_id));
                            DataSource.Bind <QuestClearUnlockUnitDataParam>(gameObject, unlockUnitDataParamList[index]);
                            gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                            gameObject.SetActive(true);
                        }
                        for (int index = 0; index < viewContentParams.Count; ++index)
                        {
                            if (viewContentParams[index].m_SkillDeriveParams != null && viewContentParams[index].m_SkillDeriveParams.Count >= 1)
                            {
                                this.m_ShowBaseToggle.set_interactable(true);
                                break;
                            }
                        }
                    }
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
        }