Beispiel #1
0
 public int GetTotalExpFromLevel(int lv)
 {
     return(ArtifactData.StaticCalcExpFromLevel(Math.Min(lv, this.GetLevelCap())));
 }
Beispiel #2
0
        public void UpdateValue()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem, (UnityEngine.Object)null))
            {
                return;
            }
            ArtifactData  dataOfClass   = DataSource.FindDataOfClass <ArtifactData>(((Component)this).get_gameObject(), (ArtifactData)null);
            ArtifactParam artifactParam = dataOfClass == null?DataSource.FindDataOfClass <ArtifactParam>(((Component)this).get_gameObject(), (ArtifactParam)null) : dataOfClass.ArtifactParam;

            if (artifactParam == null)
            {
                for (int index = 0; index < this.mJobListItems.Count; ++index)
                {
                    this.mJobListItems[index].SetActive(false);
                }
            }
            else
            {
                Transform   transform     = ((Component)this).get_transform();
                MasterParam masterParam   = MonoSingleton <GameManager> .Instance.MasterParam;
                string[]    conditionJobs = artifactParam.condition_jobs;
                int         index1        = 0;
                if (conditionJobs != null)
                {
                    for (int index2 = 0; index2 < conditionJobs.Length; ++index2)
                    {
                        if (!string.IsNullOrEmpty(conditionJobs[index2]))
                        {
                            JobParam jobParam;
                            try
                            {
                                jobParam = masterParam.GetJobParam(conditionJobs[index2]);
                            }
                            catch (Exception ex)
                            {
                                continue;
                            }
                            if (jobParam != null)
                            {
                                if (this.mJobListItems.Count <= index1)
                                {
                                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ListItem);
                                    gameObject.get_transform().SetParent(transform, false);
                                    this.mJobListItems.Add(gameObject);
                                    this.mCurrentJobs.Add((JobParam)null);
                                }
                                this.mJobListItems[index1].SetActive(true);
                                if (this.mCurrentJobs[index1] == jobParam)
                                {
                                    ++index1;
                                }
                                else
                                {
                                    this.mCurrentJobs[index1] = jobParam;
                                    DataSource.Bind <JobParam>(this.mJobListItems[index1], jobParam);
                                    GameParameter.UpdateAll(this.mJobListItems[index1]);
                                    ++index1;
                                }
                            }
                        }
                    }
                }
                for (int index2 = index1; index2 < this.mJobListItems.Count; ++index2)
                {
                    this.mJobListItems[index2].SetActive(false);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AnyJob, (UnityEngine.Object)null))
                {
                    this.AnyJob.SetActive(index1 == 0);
                }
                this.mUpdated = true;
            }
        }
Beispiel #3
0
        private void Init()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListParent, (UnityEngine.Object)null) || UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            this.master = MonoSingleton <GameManager> .Instance.MasterParam;
            if (this.master == null)
            {
                return;
            }
            this.player = MonoSingleton <GameManager> .Instance.Player;
            if (this.player == null)
            {
                return;
            }
            ArtifactData dataOfClass1 = DataSource.FindDataOfClass <ArtifactData>(((Component)this).get_gameObject(), (ArtifactData)null);

            if (dataOfClass1 != null)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CurrentLevel, (UnityEngine.Object)null))
                {
                    this.CurrentLevel.set_text(dataOfClass1.Lv.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.FinishedLevel, (UnityEngine.Object)null))
                {
                    this.FinishedLevel.set_text(this.CurrentLevel.get_text());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MaxLevel, (UnityEngine.Object)null))
                {
                    this.MaxLevel.set_text("/" + dataOfClass1.GetLevelCap().ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NextExp, (UnityEngine.Object)null))
                {
                    this.NextExp.set_text(dataOfClass1.GetNextExp().ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LevelGauge, (UnityEngine.Object)null))
                {
                    int   totalExpFromLevel = dataOfClass1.GetTotalExpFromLevel((int)dataOfClass1.Lv);
                    float num1 = (float)(dataOfClass1.GetTotalExpFromLevel((int)dataOfClass1.Lv + 1) - totalExpFromLevel);
                    float num2 = (float)(dataOfClass1.Exp - totalExpFromLevel);
                    if ((double)num1 <= 0.0)
                    {
                        num1 = 1f;
                    }
                    this.LevelGauge.AnimateValue(Mathf.Clamp01(num2 / num1), 0.0f);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GetAllExp, (UnityEngine.Object)null))
                {
                    this.GetAllExp.set_text("0");
                }
                this.mOriginArtifact = dataOfClass1;
            }
            List <string>   stringList   = new List <string>((IEnumerable <string>)PlayerPrefsUtility.GetString(PlayerPrefsUtility.ARTIFACT_BULK_LEVELUP, string.Empty).Split('|'));
            List <ItemData> itemDataList = this.player.Items;
            ArtifactWindow  dataOfClass2 = DataSource.FindDataOfClass <ArtifactWindow>(((Component)this).get_gameObject(), (ArtifactWindow)null);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)dataOfClass2, (UnityEngine.Object)null))
            {
                itemDataList = dataOfClass2.TmpItems;
            }
            for (int index = 0; index < itemDataList.Count; ++index)
            {
                ItemData data = itemDataList[index];
                if (data != null && data.Param != null && (data.Param.type == EItemType.ExpUpArtifact && data.Num > 0))
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ListItemTemplate);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                    {
                        DataSource.Bind <ItemData>(gameObject, data);
                        gameObject.get_transform().SetParent((Transform)this.ListParent, false);
                        ArtifactLevelUpListItem component = (ArtifactLevelUpListItem)gameObject.GetComponent <ArtifactLevelUpListItem>();
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                        {
                            component.OnSelect     = new ArtifactLevelUpListItem.SelectExpItem(this.RefreshExpSelectItems);
                            component.ChangeUseMax = new ArtifactLevelUpListItem.ChangeToggleEvent(this.RefreshUseMaxItems);
                            component.OnCheck      = new ArtifactLevelUpListItem.CheckSliderValue(this.OnCheck);
                            this.mArtifactLevelupLists.Add(component);
                            if (stringList != null && stringList.Count > 0)
                            {
                                component.SetUseMax(stringList.IndexOf(data.Param.iname) != -1);
                            }
                            if (component.IsUseMax())
                            {
                                this.mCacheExpItemList.Add(data);
                            }
                            gameObject.SetActive(true);
                        }
                        this.mItems.Add(gameObject);
                    }
                }
            }
            if (this.mCacheExpItemList != null && this.mCacheExpItemList.Count > 0)
            {
                this.mCacheExpItemList.Sort((Comparison <ItemData>)((a, b) => (int)b.Param.value - (int)a.Param.value));
            }
            ((Selectable)this.MaxBtn).set_interactable(this.mCacheExpItemList != null && this.mCacheExpItemList.Count > 0);
            ((Selectable)this.DecideBtn).set_interactable(this.mSelectExpItems != null && this.mSelectExpItems.Count > 0);
        }
Beispiel #4
0
 public int GetLevelFromExp(int exp)
 {
     return(Math.Min(ArtifactData.StaticCalcLevelFromExp(exp), this.GetLevelCap()));
 }
Beispiel #5
0
        private void Refresh()
        {
            ArtifactData artifactData = new ArtifactData();

            artifactData.Deserialize(new Json_Artifact()
            {
                iname = GlobalVars.ArtifactListItem.param.iname,
                rare  = GlobalVars.ArtifactListItem.param.rareini
            });
            this.UnlockArtifact = artifactData;
            DataSource.Bind <ArtifactData>(((Component)this).get_gameObject(), this.UnlockArtifact);
            DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), this.UnlockArtifact.ArtifactParam);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AbilityListItem, (UnityEngine.Object)null))
            {
                MasterParam        masterParam       = MonoSingleton <GameManager> .Instance.MasterParam;
                GameObject         abilityListItem   = this.AbilityListItem;
                CanvasGroup        component         = (CanvasGroup)abilityListItem.GetComponent <CanvasGroup>();
                bool               flag              = false;
                ArtifactParam      artifactParam     = artifactData.ArtifactParam;
                List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                if (artifactParam.abil_inames != null)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    ArtifactGetUnlockWindow.\u003CRefresh\u003Ec__AnonStorey2F6 refreshCAnonStorey2F6 = new ArtifactGetUnlockWindow.\u003CRefresh\u003Ec__AnonStorey2F6();
                    AbilityParam data1 = (AbilityParam)null;
                    // ISSUE: reference to a compiler-generated field
                    refreshCAnonStorey2F6.abil_iname = (string)null;
                    for (int index = 0; index < artifactParam.abil_inames.Length; ++index)
                    {
                        if (!string.IsNullOrEmpty(artifactParam.abil_inames[index]) && artifactParam.abil_shows[index] != 0)
                        {
                            // ISSUE: reference to a compiler-generated field
                            refreshCAnonStorey2F6.abil_iname = artifactParam.abil_inames[index];
                            data1 = masterParam.GetAbilityParam(artifactParam.abil_inames[index]);
                            if (data1 != null)
                            {
                                break;
                            }
                        }
                    }
                    if (data1 == null)
                    {
                        component.set_alpha(this.ability_hidden_alpha);
                        DataSource.Bind <AbilityParam>(this.AbilityListItem, (AbilityParam)null);
                        DataSource.Bind <AbilityData>(this.AbilityListItem, (AbilityData)null);
                        return;
                    }
                    DataSource.Bind <AbilityParam>(this.AbilityListItem, data1);
                    DataSource.Bind <AbilityData>(abilityListItem, (AbilityData)null);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && learningAbilities != null && learningAbilities != null)
                    {
                        // ISSUE: reference to a compiler-generated method
                        AbilityData data2 = learningAbilities.Find(new Predicate <AbilityData>(refreshCAnonStorey2F6.\u003C\u003Em__2F7));
                        if (data2 != null)
                        {
                            DataSource.Bind <AbilityData>(abilityListItem, data2);
                            flag = true;
                        }
                    }
                }
                if (flag)
                {
                    component.set_alpha(this.ability_unlock_alpha);
                }
                else
                {
                    component.set_alpha(this.ability_hidden_alpha);
                }
            }
            BaseStatus fixed_status = new BaseStatus();
            BaseStatus scale_status = new BaseStatus();

            this.UnlockArtifact.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
            this.ArtifactStatus.SetValues(fixed_status, scale_status);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Beispiel #6
0
        private void RefreshFinishedStatus()
        {
            if (this.mSelectExpItems == null || this.mSelectExpItems.Count <= 0)
            {
                return;
            }
            int exp1 = 0;

            using (Dictionary <string, int> .KeyCollection.Enumerator enumerator = this.mSelectExpItems.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string   current          = enumerator.Current;
                    ItemData itemDataByItemId = this.player.FindItemDataByItemID(current);
                    if (itemDataByItemId != null)
                    {
                        int mSelectExpItem = this.mSelectExpItems[current];
                        if (mSelectExpItem != 0 && mSelectExpItem <= itemDataByItemId.Num)
                        {
                            int num = (int)itemDataByItemId.Param.value * mSelectExpItem;
                            exp1 += num;
                        }
                    }
                }
            }
            int          gainExpCap   = this.mOriginArtifact.GetGainExpCap();
            int          num1         = Math.Min(this.mOriginArtifact.Exp + exp1, gainExpCap);
            ArtifactData artifactData = this.mOriginArtifact.Copy();

            artifactData.GainExp(exp1);
            using (List <ArtifactLevelUpListItem> .Enumerator enumerator = this.mArtifactLevelupLists.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    enumerator.Current.SetInputLock(num1 < gainExpCap);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.FinishedLevel, (UnityEngine.Object)null))
            {
                this.FinishedLevel.set_text(artifactData.Lv.ToString());
                if ((int)artifactData.Lv >= this.mOriginArtifact.GetLevelCap())
                {
                    ((Graphic)this.FinishedLevel).set_color(Color.get_red());
                }
                else if ((int)artifactData.Lv > (int)this.mOriginArtifact.Lv)
                {
                    ((Graphic)this.FinishedLevel).set_color(Color.get_green());
                }
                else
                {
                    ((Graphic)this.FinishedLevel).set_color(Color.get_white());
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AddLevelGauge, (UnityEngine.Object)null))
            {
                if (num1 == this.mOriginArtifact.Exp || exp1 == 0)
                {
                    this.AddLevelGauge.AnimateValue(0.0f, 0.0f);
                }
                else
                {
                    int   totalExpFromLevel = this.mOriginArtifact.GetTotalExpFromLevel((int)this.mOriginArtifact.Lv);
                    float num2 = (float)(this.mOriginArtifact.GetTotalExpFromLevel((int)this.mOriginArtifact.Lv + 1) - totalExpFromLevel);
                    float num3 = (float)(num1 - totalExpFromLevel);
                    if ((double)num2 <= 0.0)
                    {
                        num2 = 1f;
                    }
                    this.AddLevelGauge.AnimateValue(Mathf.Clamp01(num3 / num2), 0.0f);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NextExp, (UnityEngine.Object)null))
            {
                int num2 = 0;
                if (num1 < this.mOriginArtifact.GetGainExpCap())
                {
                    int exp2    = artifactData.Exp;
                    int nextExp = artifactData.GetNextExp();
                    int num3    = num1 - exp2;
                    num2 = Math.Max(0, nextExp <= num3 ? 0 : nextExp - num3);
                }
                this.NextExp.set_text(num2.ToString());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GetAllExp, (UnityEngine.Object)null))
            {
                this.GetAllExp.set_text(exp1.ToString());
            }
            ((Selectable)this.DecideBtn).set_interactable(exp1 > 0);
        }
        private void Refresh()
        {
            LimitedShopItem data = MonoSingleton <GameManager> .Instance.Player.GetLimitedShopData().items[GlobalVars.ShopBuyIndex];

            this.ItemWindow.SetActive(!data.IsArtifact);
            this.ArtifactWindow.SetActive(data.IsArtifact);
            if (Object.op_Inequality((Object)this.AmountNum, (Object)null))
            {
                this.AmountNum.set_text(data.remaining_num.ToString());
            }
            if (Object.op_Inequality((Object)this.Sold, (Object)null))
            {
                this.Sold.SetActive(!data.IsNotLimited);
            }
            if (data.IsArtifact)
            {
                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data.iname);

                DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), artifactParam);
                this.mArtifactParam = artifactParam;
                ArtifactData artifactData = new ArtifactData();
                artifactData.Deserialize(new Json_Artifact()
                {
                    iname = artifactParam.iname,
                    rare  = artifactParam.rareini
                });
                BaseStatus fixed_status = new BaseStatus();
                BaseStatus scale_status = new BaseStatus();
                artifactData.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
                this.ArtifactStatus.SetValues(fixed_status, scale_status);
                if (artifactParam.abil_inames != null && artifactParam.abil_inames.Length > 0)
                {
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(artifactParam.abil_inames[0]);

                    List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                    bool flag = false;
                    if (learningAbilities != null)
                    {
                        for (int index = 0; index < learningAbilities.Count; ++index)
                        {
                            AbilityData abilityData = learningAbilities[index];
                            if (abilityData != null && abilityParam.iname == abilityData.Param.iname)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    DataSource.Bind <AbilityParam>(this.ArtifactAbility, abilityParam);
                    if (flag)
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Unlocked);
                    }
                    else
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                    }
                }
                else
                {
                    this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                }
            }
            else
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(data.iname);

                this.limited_shop_item_set_list.Clear();
                if (data.IsSet)
                {
                    for (int index = 0; index < data.children.Length; ++index)
                    {
                        GameObject gameObject = index >= this.limited_shop_item_set_list.Count ? (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate) : ((Component)this.limited_shop_item_set_list[index]).get_gameObject();
                        if (Object.op_Inequality((Object)gameObject, (Object)null))
                        {
                            gameObject.SetActive(true);
                            Vector3 localScale = gameObject.get_transform().get_localScale();
                            gameObject.get_transform().SetParent(this.ItemParent.get_transform());
                            gameObject.get_transform().set_localScale(localScale);
                            LimitedShopSetItemListElement component = (LimitedShopSetItemListElement)gameObject.GetComponent <LimitedShopSetItemListElement>();
                            StringBuilder stringBuilder             = GameUtility.GetStringBuilder();
                            if (data.children[index].IsArtifact)
                            {
                                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data.children[index].iname);

                                if (artifactParam != null)
                                {
                                    stringBuilder.Append(artifactParam.name);
                                }
                                component.ArtifactParam = artifactParam;
                            }
                            else
                            {
                                ItemData itemData = new ItemData();
                                itemData.Setup(0L, data.children[index].iname, data.children[index].num);
                                if (itemData != null)
                                {
                                    stringBuilder.Append(itemData.Param.name);
                                }
                                component.itemData = itemData;
                            }
                            stringBuilder.Append(" × ");
                            stringBuilder.Append(data.children[index].num.ToString());
                            component.itemName.set_text(stringBuilder.ToString());
                            component.SetShopItemDesc(data.children[index]);
                            this.limited_shop_item_set_list.Add(component);
                        }
                    }
                }
                DataSource.Bind <ItemData>(((Component)this).get_gameObject(), itemDataByItemId);
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), MonoSingleton <GameManager> .Instance.GetItemParam(data.iname));
            }
            DataSource.Bind <LimitedShopItem>(((Component)this).get_gameObject(), data);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
        private void Refresh()
        {
            ArtifactParam data1 = GlobalVars.ArtifactListItem.param;
            ArtifactData  data2 = new ArtifactData();

            data2.Deserialize(new Json_Artifact()
            {
                iname = GlobalVars.ArtifactListItem.param.iname,
                rare  = GlobalVars.ArtifactListItem.param.rareini
            });
            DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), data1);
            DataSource.Bind <ArtifactData>(((Component)this).get_gameObject(), data2);
            if (Object.op_Inequality((Object)this.AbilityListItem, (Object)null))
            {
                MasterParam        masterParam       = MonoSingleton <GameManager> .Instance.MasterParam;
                GameObject         abilityListItem   = this.AbilityListItem;
                CanvasGroup        component         = (CanvasGroup)abilityListItem.GetComponent <CanvasGroup>();
                bool               flag              = false;
                ArtifactParam      artifactParam     = data2.ArtifactParam;
                List <AbilityData> learningAbilities = data2.LearningAbilities;
                if (artifactParam.abil_inames != null)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    SelectArtifactInfo.\u003CRefresh\u003Ec__AnonStorey26F refreshCAnonStorey26F = new SelectArtifactInfo.\u003CRefresh\u003Ec__AnonStorey26F();
                    AbilityParam data3 = (AbilityParam)null;
                    // ISSUE: reference to a compiler-generated field
                    refreshCAnonStorey26F.abil_iname = (string)null;
                    for (int index = 0; index < artifactParam.abil_inames.Length; ++index)
                    {
                        if (!string.IsNullOrEmpty(artifactParam.abil_inames[index]) && artifactParam.abil_shows[index] != 0)
                        {
                            // ISSUE: reference to a compiler-generated field
                            refreshCAnonStorey26F.abil_iname = artifactParam.abil_inames[index];
                            data3 = masterParam.GetAbilityParam(artifactParam.abil_inames[index]);
                            if (data3 != null)
                            {
                                break;
                            }
                        }
                    }
                    if (data3 == null)
                    {
                        component.set_alpha(this.ability_hidden_alpha);
                        DataSource.Bind <AbilityParam>(this.AbilityListItem, (AbilityParam)null);
                        DataSource.Bind <AbilityData>(this.AbilityListItem, (AbilityData)null);
                        return;
                    }
                    DataSource.Bind <AbilityParam>(this.AbilityListItem, data3);
                    DataSource.Bind <AbilityData>(abilityListItem, (AbilityData)null);
                    if (Object.op_Inequality((Object)component, (Object)null) && learningAbilities != null && learningAbilities != null)
                    {
                        // ISSUE: reference to a compiler-generated method
                        AbilityData data4 = learningAbilities.Find(new Predicate <AbilityData>(refreshCAnonStorey26F.\u003C\u003Em__2DE));
                        if (data4 != null)
                        {
                            DataSource.Bind <AbilityData>(abilityListItem, data4);
                            flag = true;
                        }
                    }
                }
                if (flag)
                {
                    component.set_alpha(this.ability_unlock_alpha);
                }
                else
                {
                    component.set_alpha(this.ability_hidden_alpha);
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Beispiel #9
0
        private void OnSelect(ArtifactData artifact, ArtifactTypes type = ArtifactTypes.None)
        {
            if (artifact != null)
            {
                PlayerData player = MonoSingleton <GameManager> .GetInstanceDirect().Player;

                UnitData unit = (UnitData)null;
                JobData  job1 = (JobData)null;
                if (player.FindOwner(artifact, out unit, out job1))
                {
                    for (int slot = 0; slot < job1.Artifacts.Length; ++slot)
                    {
                        if (job1.Artifacts[slot] == (long)artifact.UniqueID)
                        {
                            job1.SetEquipArtifact(slot, (ArtifactData)null);
                            break;
                        }
                    }
                    if (this.mCurrentUnit.UniqueID == unit.UniqueID)
                    {
                        JobData jobData = (JobData)null;
                        foreach (JobData job2 in this.mCurrentUnit.Jobs)
                        {
                            if (job2.UniqueID == job1.UniqueID)
                            {
                                jobData = job2;
                            }
                        }
                        if (jobData != null)
                        {
                            for (int slot = 0; slot < jobData.Artifacts.Length; ++slot)
                            {
                                if (jobData.Artifacts[slot] == (long)artifact.UniqueID)
                                {
                                    jobData.SetEquipArtifact(slot, (ArtifactData)null);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            ArtifactData[] view_artifact_datas = new List <ArtifactData>()
            {
                DataSource.FindDataOfClass <ArtifactData>(((Component)this.ArtifactSlot).get_gameObject(), (ArtifactData)null),
                DataSource.FindDataOfClass <ArtifactData>(((Component)this.ArtifactSlot2).get_gameObject(), (ArtifactData)null),
                DataSource.FindDataOfClass <ArtifactData>(((Component)this.ArtifactSlot3).get_gameObject(), (ArtifactData)null)
            }.ToArray();
            int artifactSlotIndex = JobData.GetArtifactSlotIndex(type);
            List <ArtifactData> artifactDataList1 = new List <ArtifactData>((IEnumerable <ArtifactData>) this.mCurrentUnit.CurrentJob.ArtifactDatas);

            if (artifactDataList1.Count != view_artifact_datas.Length)
            {
                return;
            }
            for (int i = 0; i < view_artifact_datas.Length; ++i)
            {
                if (view_artifact_datas[i] != null && artifactDataList1.Find((Predicate <ArtifactData>)(x =>
                {
                    if (x != null)
                    {
                        return((long)x.UniqueID == (long)view_artifact_datas[i].UniqueID);
                    }
                    return(false);
                })) == null)
                {
                    return;
                }
            }
            view_artifact_datas[artifactSlotIndex] = artifact;
            List <ArtifactData> artifactDataList2 = new List <ArtifactData>();

            for (int slot = 0; slot < this.mCurrentUnit.CurrentJob.ArtifactDatas.Length; ++slot)
            {
                this.mCurrentUnit.CurrentJob.SetEquipArtifact(slot, (ArtifactData)null);
            }
            for (int index = 0; index < view_artifact_datas.Length; ++index)
            {
                if (view_artifact_datas[index] != null)
                {
                    if (view_artifact_datas[index].ArtifactParam.type == ArtifactTypes.Accessory)
                    {
                        artifactDataList2.Add(view_artifact_datas[index]);
                    }
                    else
                    {
                        this.mCurrentUnit.CurrentJob.SetEquipArtifact(JobData.GetArtifactSlotIndex(view_artifact_datas[index].ArtifactParam.type), view_artifact_datas[index]);
                    }
                }
            }
            for (int index = 0; index < artifactDataList2.Count; ++index)
            {
                for (int slot = 0; slot < this.mCurrentUnit.CurrentJob.ArtifactDatas.Length; ++slot)
                {
                    if (this.mCurrentUnit.CurrentJob.ArtifactDatas[slot] == null)
                    {
                        this.mCurrentUnit.CurrentJob.SetEquipArtifact(slot, artifactDataList2[index]);
                        break;
                    }
                }
            }
            this.mCurrentUnit.UpdateArtifact(this.mCurrentUnit.JobIndex, true, true);
            Network.RequestAPI((WebAPI) new ReqArtifactSet(this.mCurrentUnit.UniqueID, this.mCurrentUnit.CurrentJob.UniqueID, this.mCurrentUnit.CurrentJob.Artifacts, new Network.ResponseCallback(this.OnArtifactSetResult)), false);
        }
        private void Refresh()
        {
            this.mShopitem = MonoSingleton <GameManager> .Instance.Player.GetEventShopData().items.FirstOrDefault <EventShopItem>((Func <EventShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));

            this.ItemWindow.SetActive(!this.mShopitem.IsArtifact);
            this.ArtifactWindow.SetActive(this.mShopitem.IsArtifact);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountNum, (UnityEngine.Object)null))
            {
                this.AmountNum.set_text(this.mShopitem.remaining_num.ToString());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Sold, (UnityEngine.Object)null))
            {
                this.Sold.SetActive(!this.mShopitem.IsNotLimited);
            }
            if (this.mShopitem.IsArtifact)
            {
                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(this.mShopitem.iname);

                DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), artifactParam);
                this.mArtifactParam = artifactParam;
                ArtifactData artifactData = new ArtifactData();
                artifactData.Deserialize(new Json_Artifact()
                {
                    iname = artifactParam.iname,
                    rare  = artifactParam.rareini
                });
                BaseStatus fixed_status = new BaseStatus();
                BaseStatus scale_status = new BaseStatus();
                artifactData.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
                this.ArtifactStatus.SetValues(fixed_status, scale_status, false);
                if (artifactParam.abil_inames != null && artifactParam.abil_inames.Length > 0)
                {
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(artifactParam.abil_inames[0]);

                    List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                    bool flag = false;
                    if (learningAbilities != null)
                    {
                        for (int index = 0; index < learningAbilities.Count; ++index)
                        {
                            AbilityData abilityData = learningAbilities[index];
                            if (abilityData != null && abilityParam.iname == abilityData.Param.iname)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    DataSource.Bind <AbilityParam>(this.ArtifactAbility, abilityParam);
                    if (flag)
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Unlocked);
                    }
                    else
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                    }
                }
                else
                {
                    this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SetEffectsButton, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SetEffectsButton, (UnityEngine.Object)null) && artifactParam != null)
                {
                    ((Selectable)this.m_SetEffectsButton).set_interactable(MonoSingleton <GameManager> .Instance.MasterParam.ExistSkillAbilityDeriveDataWithArtifact(artifactParam.iname));
                    if (((Selectable)this.m_SetEffectsButton).get_interactable())
                    {
                        ArtifactSetList.SetSelectedArtifactParam(artifactParam);
                    }
                }
            }
            else
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(this.mShopitem.iname);

                this.event_shop_item_set_list.Clear();
                if (this.mShopitem.IsSet)
                {
                    for (int index = 0; index < this.mShopitem.children.Length; ++index)
                    {
                        GameObject gameObject = index >= this.event_shop_item_set_list.Count ? (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate) : ((Component)this.event_shop_item_set_list[index]).get_gameObject();
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                        {
                            gameObject.SetActive(true);
                            Vector3 localScale = gameObject.get_transform().get_localScale();
                            gameObject.get_transform().SetParent(this.ItemParent.get_transform());
                            gameObject.get_transform().set_localScale(localScale);
                            EventShopSetItemListElement component = (EventShopSetItemListElement)gameObject.GetComponent <EventShopSetItemListElement>();
                            StringBuilder stringBuilder           = GameUtility.GetStringBuilder();
                            if (this.mShopitem.children[index].IsArtifact)
                            {
                                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(this.mShopitem.children[index].iname);

                                if (artifactParam != null)
                                {
                                    stringBuilder.Append(artifactParam.name);
                                }
                                component.ArtifactParam = artifactParam;
                            }
                            else if (this.mShopitem.children[index].IsConceptCard)
                            {
                                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(this.mShopitem.children[index].iname);
                                if (cardDataForDisplay != null)
                                {
                                    stringBuilder.Append(cardDataForDisplay.Param.name);
                                }
                                component.SetupConceptCard(cardDataForDisplay);
                            }
                            else
                            {
                                ItemData itemData = new ItemData();
                                itemData.Setup(0L, this.mShopitem.children[index].iname, this.mShopitem.children[index].num);
                                if (itemData != null)
                                {
                                    stringBuilder.Append(itemData.Param.name);
                                }
                                component.itemData = itemData;
                            }
                            stringBuilder.Append("×");
                            stringBuilder.Append(this.mShopitem.children[index].num.ToString());
                            component.itemName.set_text(stringBuilder.ToString());
                            component.SetShopItemDesc(this.mShopitem.children[index]);
                            this.event_shop_item_set_list.Add(component);
                        }
                    }
                }
                DataSource.Bind <ItemData>(((Component)this).get_gameObject(), itemDataByItemId);
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), MonoSingleton <GameManager> .Instance.GetItemParam(this.mShopitem.iname));
            }
            if (this.mShopitem.IsArtifact)
            {
                this.AmountSliderHolder = this.ArtifactAmountSliderHolder;
                this.AmountSlider       = this.ArtifactAmountSlider;
                this.AmountSliderNum    = this.ArtifactAmountSliderNum;
                this.IncrementButton    = this.ArtifactIncrementButton;
                this.DecrementButton    = this.ArtifactDecrementButton;
            }
            else
            {
                this.AmountSliderHolder = this.ItemAmountSliderHolder;
                this.AmountSlider       = this.ItemAmountSlider;
                this.AmountSliderNum    = this.ItemAmountSliderNum;
                this.IncrementButton    = this.ItemIncrementButton;
                this.DecrementButton    = this.ItemDecrementButton;
            }
            this.mEnabledSlider = false;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderHolder, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSlider, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderNum, (UnityEngine.Object)null))
            {
                if (!this.mShopitem.IsNotLimited && this.mShopitem.remaining_num > 1)
                {
                    this.mEnabledSlider = true;
                    GameParameter component = (GameParameter)((Component)this.LimitedItemPriceText).GetComponent <GameParameter>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.AmountSliderHolder.SetActive(true);
                    int remainingCurrency = ShopData.GetRemainingCurrency((ShopItem)this.mShopitem);
                    int buyPrice          = ShopData.GetBuyPrice((ShopItem)this.mShopitem);
                    int num1 = 1;
                    if (buyPrice > 0)
                    {
                        while (buyPrice * num1 <= remainingCurrency)
                        {
                            ++num1;
                        }
                    }
                    int num2 = Math.Max(Math.Min(num1 - 1, this.mShopitem.remaining_num), 1);
                    this.AmountSlider.set_minValue(1f);
                    this.AmountSlider.set_maxValue((float)num2);
                    this.SetSliderValue(1f);
                    // ISSUE: method pointer
                    ((UnityEvent <float>) this.AmountSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnSliderValueChanged)));
                }
                else
                {
                    this.mEnabledSlider = false;
                    this.AmountSliderHolder.SetActive(false);
                }
            }
            DataSource.Bind <EventShopItem>(((Component)this).get_gameObject(), this.mShopitem);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Beispiel #11
0
        private void OnClick(GenericSlot slot, bool interactable)
        {
            if (!interactable)
            {
                return;
            }
            GameObject gameObject1 = AssetManager.Load <GameObject>(ArtifactSlots.ArtiSelectPath);

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject1, (UnityEngine.Object)null))
            {
                return;
            }
            GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)gameObject1);

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject2, (UnityEngine.Object)null))
            {
                return;
            }
            ArtifactWindow component = (ArtifactWindow)gameObject2.GetComponent <ArtifactWindow>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)component, (UnityEngine.Object)null))
            {
                return;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)slot, (UnityEngine.Object)null))
            {
                if (UnityEngine.Object.op_Equality((UnityEngine.Object)slot, (UnityEngine.Object) this.ArtifactSlot))
                {
                    component.SelectArtifactSlot = ArtifactTypes.Arms;
                }
                else if (UnityEngine.Object.op_Equality((UnityEngine.Object)slot, (UnityEngine.Object) this.ArtifactSlot2))
                {
                    component.SelectArtifactSlot = ArtifactTypes.Armor;
                }
                else if (UnityEngine.Object.op_Equality((UnityEngine.Object)slot, (UnityEngine.Object) this.ArtifactSlot3))
                {
                    component.SelectArtifactSlot = ArtifactTypes.Accessory;
                }
            }
            component.OnEquip = new ArtifactWindow.EquipEvent(this.OnSelect);
            component.SetOwnerUnit(this.mCurrentUnit, this.mCurrentUnit.JobIndex);
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component.ArtifactList, (UnityEngine.Object)null))
            {
                return;
            }
            if (component.ArtifactList.TestOwner != this.mCurrentUnit)
            {
                component.ArtifactList.TestOwner = this.mCurrentUnit;
            }
            ArtifactData dataOfClass = DataSource.FindDataOfClass <ArtifactData>(((Component)slot).get_gameObject(), (ArtifactData)null);
            long         iid         = 0;

            if (this.mCurrentUnit.CurrentJob.Artifacts != null)
            {
                long num = (long)(dataOfClass == null ? (OLong)0L : dataOfClass.UniqueID);
                for (int index = 0; index < this.mCurrentUnit.CurrentJob.Artifacts.Length; ++index)
                {
                    if (this.mCurrentUnit.CurrentJob.Artifacts[index] != 0L & this.mCurrentUnit.CurrentJob.Artifacts[index] == num)
                    {
                        iid = this.mCurrentUnit.CurrentJob.Artifacts[index];
                        break;
                    }
                }
            }
            ArtifactData artifactData = (ArtifactData)null;

            if (iid != 0L)
            {
                artifactData = MonoSingleton <GameManager> .Instance.Player.FindArtifactByUniqueID(iid);
            }
            if (artifactData != null)
            {
                component.ArtifactList.SetSelection((object[])new ArtifactData[1]
                {
                    artifactData
                }, true, true);
            }
            else
            {
                component.ArtifactList.SetSelection((object[])new ArtifactData[0], true, true);
            }
            ArtifactTypes type = dataOfClass == null ? ArtifactTypes.None : dataOfClass.ArtifactParam.type;

            component.ArtifactList.FiltersPriority = this.SetEquipArtifactFilters(dataOfClass, type);
        }
Beispiel #12
0
        public void UpdateSelection()
        {
            if (this.mData == null || !this.ShowSelection)
            {
                return;
            }
            for (int index = this.mSelection.Count - 1; index >= 0; --index)
            {
                object obj = this.mSelection[index];
                if (Array.IndexOf <object>(this.mData, obj) < 0)
                {
                    this.mSelection.RemoveAt(index);
                    this.mInvokeSelChange = true;
                }
                else if (obj is ArtifactData && this.MaxSelection > 0 && (obj as ArtifactData).IsFavorite)
                {
                    this.mSelection.RemoveAt(index);
                    this.mInvokeSelChange = true;
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NumSelection, (UnityEngine.Object)null))
            {
                this.NumSelection.set_text(this.mSelection.Count.ToString());
            }
            List <CheckBadge> checkBadgeList = new List <CheckBadge>();

            for (int index1 = 0; index1 < this.mItems.Count; ++index1)
            {
                int index2 = this.mPage * this.mPageSize + index1 - this.ExtraItems.Length;
                if (0 <= index2 && index2 < this.mData.Length)
                {
                    int      num       = this.mSelection.IndexOf(this.mData[index2]);
                    Animator component = (Animator)this.mItems[index1].GetComponent <Animator>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && !string.IsNullOrEmpty(this.SelectionState))
                    {
                        if (num >= 0)
                        {
                            component.SetInteger(this.SelectionState, this.Item_Selected);
                        }
                        else
                        {
                            component.SetInteger(this.SelectionState, this.Item_Normal);
                        }
                    }
                    ((ArtifactIcon)this.mItems[index1].GetComponentInChildren <ArtifactIcon>(true)).ForceMask = this.mSelection.Count >= this.MaxSelection && num < 0;
                    GameParameter.UpdateAll(this.mItems[index1]);
                    this.mItems[index1].GetComponentsInChildren <CheckBadge>(true, (List <M0>)checkBadgeList);
                    for (int index3 = 0; index3 < checkBadgeList.Count; ++index3)
                    {
                        if (num >= 0)
                        {
                            ((Component)checkBadgeList[index3]).get_gameObject().SetActive(true);
                        }
                        else
                        {
                            ((Component)checkBadgeList[index3]).get_gameObject().SetActive(false);
                        }
                    }
                }
                else
                {
                    this.mItems[index1].SetActive(false);
                }
            }
            if (this.Source == ArtifactList.ListSource.Normal)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TotalDecomposeCost, (UnityEngine.Object)null))
                {
                    long num = 0;
                    for (int index = 0; index < this.mSelection.Count; ++index)
                    {
                        ArtifactData artifactData = this.mSelection[index] as ArtifactData;
                        if (artifactData != null)
                        {
                            num += (long)(int)artifactData.RarityParam.ArtifactChangeCost;
                        }
                    }
                    this.TotalDecomposeCost.set_text(num.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TotalSellCost, (UnityEngine.Object)null))
                {
                    long num = 0;
                    for (int index = 0; index < this.mSelection.Count; ++index)
                    {
                        if (this.mSelection[index] is ArtifactData)
                        {
                            num += (long)((ArtifactData)this.mSelection[index]).GetSellPrice();
                        }
                        else if (this.mSelection[index] is ArtifactParam)
                        {
                            num += (long)((ArtifactParam)this.mSelection[index]).sell;
                        }
                    }
                    this.TotalSellCost.set_text(num.ToString());
                }
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ApplyButton, (UnityEngine.Object)null))
            {
                return;
            }
            ((Selectable)this.ApplyButton).set_interactable(this.mSelection.Count > 0);
        }
Beispiel #13
0
        public static object[] FilterArtifacts(object[] artifacts, string[] filter)
        {
            if (filter == null)
            {
                return(artifacts);
            }
            int           num1       = 0;
            int           num2       = 0;
            bool          flag1      = false;
            List <string> stringList = new List <string>();
            string        s          = (string)null;

            for (int index = 0; index < filter.Length; ++index)
            {
                if (ArtifactList.GetValue(filter[index], "RARE:", ref s))
                {
                    int result;
                    if (int.TryParse(s, out result))
                    {
                        num1 |= 1 << result;
                    }
                }
                else if (ArtifactList.GetValue(filter[index], "TYPE:", ref s))
                {
                    try
                    {
                        ArtifactTypes artifactTypes = (ArtifactTypes)Enum.Parse(typeof(ArtifactTypes), s, true);
                        num2 |= 1 << (int)(artifactTypes & (ArtifactTypes)31 & (ArtifactTypes)31);
                    }
                    catch
                    {
                        if (GameUtility.IsDebugBuild)
                        {
                            Debug.LogError((object)("Unknown element type: " + s));
                        }
                    }
                }
                else if (ArtifactList.GetValue(filter[index], "FAV:", ref s))
                {
                    flag1 = true;
                }
                else if (ArtifactList.GetValue(filter[index], "SAME:", ref s))
                {
                    stringList.Add(s);
                }
            }
            List <ArtifactData> artifactDataList = new List <ArtifactData>();

            for (int index = 0; index < artifacts.Length; ++index)
            {
                artifactDataList.Add(artifacts[index] as ArtifactData);
            }
            for (int index1 = artifactDataList.Count - 1; index1 >= 0; --index1)
            {
                ArtifactData artifactData = artifactDataList[index1];
                if (flag1 && !artifactData.IsFavorite)
                {
                    artifactDataList.RemoveAt(index1);
                }
                else
                {
                    bool flag2 = false;
                    for (int index2 = 0; index2 < stringList.Count; ++index2)
                    {
                        if (artifactData.ArtifactParam.iname == stringList[index2])
                        {
                            flag2 = true;
                            break;
                        }
                    }
                    if (flag2 || (1 << (int)artifactData.Rarity & num1) == 0 || (1 << (int)(artifactData.ArtifactParam.type & (ArtifactTypes)31) & num2) == 0)
                    {
                        artifactDataList.RemoveAt(index1);
                    }
                }
            }
            return(artifactDataList.ConvertAll <object>((Converter <ArtifactData, object>)(o => (object)o)).ToArray());
        }
Beispiel #14
0
 public void Setup(ArtifactData _artifact)
 {
     this.mCurrentArtifact = _artifact;
 }
Beispiel #15
0
        private void UpdateItems()
        {
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || this.mMailListItems == null)
            {
                return;
            }
            List <MailData> currentMails = MonoSingleton <GameManager> .Instance.Player.CurrentMails;

            if (this.mMailListItems.Count < currentMails.Count)
            {
                Transform transform = ((Component)this).get_transform();
                int       num       = currentMails.Count - this.mMailListItems.Count;
                for (int index = 0; index < num; ++index)
                {
                    GameObject listItem = this.CreateListItem();
                    listItem.get_transform().SetParent(transform, false);
                    this.mMailListItems.Add(listItem);
                }
            }
            for (int index1 = 0; index1 < this.mMailListItems.Count; ++index1)
            {
                GameObject mMailListItem = this.mMailListItems[index1];
                if (index1 >= currentMails.Count)
                {
                    mMailListItem.SetActive(false);
                }
                else
                {
                    mMailListItem.SetActive(true);
                    MailData data1 = currentMails[index1];
                    DataSource.Bind <MailData>(mMailListItem, data1);
                    DataSource.Bind <MailData>(((MailListItem)mMailListItem.GetComponent <MailListItem>()).Button, data1);
                    int num = 0;
                    for (int index2 = 0; index2 < data1.gifts.Length; ++index2)
                    {
                        if (data1.gifts[index2].giftTypes != 0L)
                        {
                            ++num;
                        }
                        if (num >= 2)
                        {
                            break;
                        }
                    }
                    if (num >= 2)
                    {
                        MailIcon component = (MailIcon)mMailListItem.GetComponent <MailIcon>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                            {
                                component.CurrentIcon.SetActive(false);
                            }
                            component.CurrentIcon = component.SetIconTemplate;
                            component.CurrentIcon.SetActive(true);
                        }
                    }
                    else
                    {
                        MailIcon component1 = (MailIcon)mMailListItem.GetComponent <MailIcon>();
                        for (int index2 = 0; index2 < data1.gifts.Length; ++index2)
                        {
                            GiftData gift = data1.gifts[index2];
                            if (!gift.NotSet)
                            {
                                if (gift.CheckGiftTypeIncluded(GiftTypes.IgnoreReceiveAll | GiftTypes.Item))
                                {
                                    ItemData data2 = new ItemData();
                                    data2.Setup(0L, gift.iname, gift.num);
                                    DataSource.Bind <ItemData>(mMailListItem, data2);
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ItemIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Artifact))
                                {
                                    ArtifactData artifactData = gift.CreateArtifactData();
                                    if (artifactData != null)
                                    {
                                        DataSource.Bind <ArtifactData>(mMailListItem, artifactData);
                                    }
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ArtifactIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Award))
                                {
                                    AwardParam awardParam = MonoSingleton <GameManager> .Instance.GetAwardParam(gift.iname);

                                    ItemData data2 = new ItemData();
                                    data2.Setup(0L, awardParam.ToItemParam(), gift.num);
                                    DataSource.Bind <ItemData>(mMailListItem, data2);
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ItemIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Coin))
                                {
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.CoinIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Gold))
                                {
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.GoldIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.ArenaCoin))
                                {
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ArenaCoinIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                    }
                                }
                                else
                                {
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.MultiCoin))
                                    {
                                        if (Object.op_Inequality((Object)component1, (Object)null))
                                        {
                                            if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                            {
                                                component1.CurrentIcon.SetActive(false);
                                            }
                                            component1.CurrentIcon = component1.MultiCoinIconTemplate;
                                            component1.CurrentIcon.SetActive(true);
                                            break;
                                        }
                                        break;
                                    }
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.KakeraCoin))
                                    {
                                        if (Object.op_Inequality((Object)component1, (Object)null))
                                        {
                                            if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                            {
                                                component1.CurrentIcon.SetActive(false);
                                            }
                                            component1.CurrentIcon = component1.KakeraCoinIconTemplate;
                                            component1.CurrentIcon.SetActive(true);
                                            break;
                                        }
                                        break;
                                    }
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.ConceptCard))
                                    {
                                        if (Object.op_Inequality((Object)component1, (Object)null))
                                        {
                                            if (MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(gift.ConceptCardIname) == null)
                                            {
                                                DebugUtility.LogError(string.Format("MasterParam.ConceptCardParamに「{0}」が存在しない", (object)gift.ConceptCardIname));
                                                break;
                                            }
                                            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(gift.ConceptCardIname);
                                            if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                            {
                                                component1.CurrentIcon.SetActive(false);
                                            }
                                            component1.CurrentIcon = component1.ConceptCardIconTemplate;
                                            component1.CurrentIcon.SetActive(true);
                                            ConceptCardIcon component2 = (ConceptCardIcon)component1.CurrentIcon.GetComponent <ConceptCardIcon>();
                                            if (Object.op_Inequality((Object)component2, (Object)null))
                                            {
                                                component2.Setup(cardDataForDisplay);
                                                break;
                                            }
                                            break;
                                        }
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    MailListItem component3 = (MailListItem)mMailListItem.GetComponent <MailListItem>();
                    if (Object.op_Inequality((Object)component3, (Object)null))
                    {
                        component3.Set(data1.IsPeriod, data1.IsReadMail(), data1.post_at, data1.read);
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }