示例#1
0
        private void RefreshTrophyRecord()
        {
            if (!this.Trophy_Window.TrophyRecordDatas.ContainsKey(this.TrophyCategory))
            {
                return;
            }
            List <TrophyCategoryData> trophyRecordData = this.Trophy_Window.TrophyRecordDatas[this.TrophyCategory];

            if (trophyRecordData == null || trophyRecordData.Count <= 0)
            {
                return;
            }
            int num = 50;
            Dictionary <int, TrophyRecordPullView> dictionary = new Dictionary <int, TrophyRecordPullView>();

            this.child_pull_viewes.Clear();
            for (int index = 0; index < trophyRecordData.Count && num != 0; ++index)
            {
                if (!dictionary.ContainsKey(trophyRecordData[index].Param.hash_code))
                {
                    if (!trophyRecordData[index].Param.IsNotPull)
                    {
                        TrophyRecordPullView trophyRecordPullView = this.MakeTrophyCategory(trophyRecordData[index].Param.iname);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)trophyRecordPullView, (UnityEngine.Object)null))
                        {
                            --num;
                            trophyRecordPullView.Setup(dictionary.Count, this);
                            dictionary.Add(trophyRecordData[index].Param.hash_code, trophyRecordPullView);
                            this.child_pull_viewes.Add(trophyRecordPullView);
                            this.AddItem((ListItemEvents)((Component)trophyRecordPullView).GetComponent <ListItemEvents>());
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                dictionary[trophyRecordData[index].Param.hash_code].SetCategoryData(trophyRecordData[index]);
                if (dictionary.Count >= 50)
                {
                    break;
                }
            }
            this.child_plates.Clear();
            for (int index1 = 0; index1 < trophyRecordData.Count && num != 0; ++index1)
            {
                if (trophyRecordData[index1].Param.IsNotPull)
                {
                    for (int index2 = 0; index2 < trophyRecordData[index1].Trophies.Count; ++index2)
                    {
                        ListItemEvents listItemEvents = this.MakeTrophyPlate(trophyRecordData[index1].Trophies[index2], trophyRecordData[index1].Trophies[index2].IsCompleted);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)listItemEvents, (UnityEngine.Object)null))
                        {
                            this.child_plates.Add(DataSource.FindDataOfClass <TrophyParam>(((Component)listItemEvents).get_gameObject(), (TrophyParam)null));
                            this.AddItem(listItemEvents);
                            --num;
                        }
                    }
                }
            }
            using (Dictionary <int, TrophyRecordPullView> .KeyCollection.Enumerator enumerator = dictionary.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.Current;
                    dictionary[current].RefreshDisplayParam();
                }
            }
            ((Component)this.view_port_handle).get_transform().SetAsLastSibling();
        }
示例#2
0
        private void RefreshTrophyRecord()
        {
            if (!this.Trophy_Window.TrophyRecordDatas.ContainsKey(this.TrophyCategory))
            {
                return;
            }
            List <TrophyCategoryData> trophyRecordData = this.Trophy_Window.TrophyRecordDatas[this.TrophyCategory];

            if (trophyRecordData == null || trophyRecordData.Count <= 0)
            {
                return;
            }
            int num = 50;
            Dictionary <int, TrophyRecordPullView> dictionary = new Dictionary <int, TrophyRecordPullView>();

            this.child_pull_viewes.Clear();
            for (int index = 0; index < trophyRecordData.Count && num != 0; ++index)
            {
                if (!dictionary.ContainsKey(trophyRecordData[index].Param.hash_code))
                {
                    if (!trophyRecordData[index].Param.IsNotPull)
                    {
                        TrophyRecordPullView trophyRecordPullView = this.MakeTrophyCategory(trophyRecordData[index].Param.name);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)trophyRecordPullView, (UnityEngine.Object)null))
                        {
                            --num;
                            trophyRecordPullView.Setup(dictionary.Count, this);
                            dictionary.Add(trophyRecordData[index].Param.hash_code, trophyRecordPullView);
                            this.child_pull_viewes.Add(trophyRecordPullView);
                            this.AddItem((ListItemEvents)((Component)trophyRecordPullView).GetComponent <ListItemEvents>());
                            if (MonoSingleton <GameManager> .Instance.IsTutorial() && MonoSingleton <GameManager> .Instance.GetNextTutorialStep() == "ShowMissionFilter")
                            {
                                if (trophyRecordData[index].Param.iname == "BEGINNER_MISSIONS")
                                {
                                    SGHighlightObject.Instance().highlightedObject = ((Component)trophyRecordPullView).get_gameObject();
                                    SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_1.003b", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.BottomLeft, true, false, false);
                                }
                                else if (trophyRecordData[index].Param.iname == "PLAYER_LEVEL")
                                {
                                    SGHighlightObject.Instance().highlightedObject = ((Component)this.trophy_window.TrophyTab[5]).get_gameObject();
                                    SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_1.003c", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.BottomLeft, true, false, false);
                                }
                            }
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                dictionary[trophyRecordData[index].Param.hash_code].SetCategoryData(trophyRecordData[index]);
                if (dictionary.Count >= 50)
                {
                    break;
                }
            }
            this.child_plates.Clear();
            for (int index1 = 0; index1 < trophyRecordData.Count && num != 0; ++index1)
            {
                if (trophyRecordData[index1].Param.IsNotPull)
                {
                    for (int index2 = 0; index2 < trophyRecordData[index1].Trophies.Count; ++index2)
                    {
                        ListItemEvents listItemEvents = this.MakeTrophyPlate(trophyRecordData[index1].Trophies[index2], trophyRecordData[index1].Trophies[index2].IsCompleted);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)listItemEvents, (UnityEngine.Object)null))
                        {
                            this.child_plates.Add(DataSource.FindDataOfClass <TrophyParam>(((Component)listItemEvents).get_gameObject(), (TrophyParam)null));
                            this.AddItem(listItemEvents);
                            --num;
                        }
                    }
                }
            }
            using (Dictionary <int, TrophyRecordPullView> .KeyCollection.Enumerator enumerator = dictionary.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.Current;
                    dictionary[current].RefreshDisplayParam();
                }
            }
            ((Component)this.view_port_handle).get_transform().SetAsLastSibling();
        }