private void RefreshQuestTypeText(EventQuestList.EventQuestTypes type) { if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestTypeText, (UnityEngine.Object)null)) { return; } switch (type) { case EventQuestList.EventQuestTypes.Normal: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_EVENT")); break; case EventQuestList.EventQuestTypes.Key: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_KEY")); break; case EventQuestList.EventQuestTypes.Gps: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_AREA")); break; case EventQuestList.EventQuestTypes.Tower: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_TOWER")); break; case EventQuestList.EventQuestTypes.Ranking: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_RANKING")); break; case EventQuestList.EventQuestTypes.Beginner: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_BEGINNER")); break; } }
private void RefreshSwitchButton(EventQuestList.EventQuestTypes type) { ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters; bool flag1 = false; bool flag2 = false; bool flag3 = false; if (chapters != null) { long serverTime = Network.GetServerTime(); for (int index = 0; index < chapters.Length; ++index) { if (chapters[index].IsKeyQuest()) { flag1 = true; if (chapters[index].IsDateUnlock(serverTime)) { flag3 = true; } if (chapters[index].IsKeyUnlock(serverTime)) { flag2 = true; } } } } switch (type) { case EventQuestList.EventQuestTypes.Normal: if (Object.op_Inequality((Object)this.EventQuestButton, (Object)null)) { ((Component)this.EventQuestButton).get_gameObject().SetActive(false); } if (Object.op_Inequality((Object)this.KeyQuestButton, (Object)null)) { ((Component)this.KeyQuestButton).get_gameObject().SetActive(true); ((Selectable)this.KeyQuestButton).set_interactable(flag3); break; } break; case EventQuestList.EventQuestTypes.Key: if (Object.op_Inequality((Object)this.EventQuestButton, (Object)null)) { ((Component)this.EventQuestButton).get_gameObject().SetActive(true); } if (Object.op_Inequality((Object)this.KeyQuestButton, (Object)null)) { ((Component)this.KeyQuestButton).get_gameObject().SetActive(false); ((Selectable)this.KeyQuestButton).set_interactable(flag1); break; } break; } if (!Object.op_Inequality((Object)this.KeyQuestOpenEffect, (Object)null)) { return; } this.KeyQuestOpenEffect.SetActive(flag2); }
private void RestoreHierarchy() { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null) { this.mEventType = !area.IsKeyQuest() ? EventQuestList.EventQuestTypes.Normal : EventQuestList.EventQuestTypes.Key; if (area.parent != null) { GlobalVars.SelectedChapter.Set(area.parent.iname); } else { GlobalVars.SelectedChapter.Set((string)null); } } else { if (string.IsNullOrEmpty((string)GlobalVars.SelectedSection) || !this.IsSectionHidden((string)GlobalVars.SelectedSection)) { return; } GlobalVars.SelectedChapter.Set((string)null); } }
public void Activated(int pinID) { switch (pinID) { case 0: this.Refresh(this.mEventType); break; case 1: this.Refresh(this.mEventType); break; case 2: this.RestoreHierarchy(); this.Refresh(this.mEventType); break; case 3: this.RestoreHierarchyRoot(); this.mEventType = EventQuestList.EventQuestTypes.Normal; this.Refresh(this.mEventType); break; case 4: this.RestoreHierarchyRoot(); this.mEventType = EventQuestList.EventQuestTypes.Key; this.Refresh(this.mEventType); break; } }
private void RestoreHierarchy() { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null) { this.mTabIndex = (int)area.GetSubQuestType(); if (area.IsGpsQuest()) { if (area.parent != null) { if (area.parent.HasGpsQuest()) { this.mEventType = EventQuestList.EventQuestTypes.Gps; } else { this.mEventType = EventQuestList.EventQuestTypes.Normal; GlobalVars.SelectedChapter.Set((string)null); return; } } else { this.mEventType = EventQuestList.EventQuestTypes.Normal; } } else { this.mEventType = !area.IsKeyQuest() ? (!area.IsBeginnerQuest() ? EventQuestList.EventQuestTypes.Normal : EventQuestList.EventQuestTypes.Beginner) : EventQuestList.EventQuestTypes.Key; } if (area.parent != null) { GlobalVars.SelectedChapter.Set(area.parent.iname); } else { GlobalVars.SelectedChapter.Set((string)null); } } else { if (string.IsNullOrEmpty((string)GlobalVars.SelectedSection) || !this.IsSectionHidden((string)GlobalVars.SelectedSection)) { return; } GlobalVars.SelectedChapter.Set((string)null); } }
private void RefreshQuestTypeText(EventQuestList.EventQuestTypes type) { if (!Object.op_Inequality((Object)this.QuestTypeText, (Object)null)) { return; } switch (type) { case EventQuestList.EventQuestTypes.Normal: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_EVENT")); break; case EventQuestList.EventQuestTypes.Key: this.QuestTypeText.set_text(LocalizedText.Get("sys.QUESTTYPE_KEY")); break; } }
private void Start() { if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter)) { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null) { this.mEventType = !area.IsKeyQuest() ? EventQuestList.EventQuestTypes.Normal : EventQuestList.EventQuestTypes.Key; } } else if (GlobalVars.ReqEventPageListType == GlobalVars.EventQuestListType.KeyQuest) { GlobalVars.ReqEventPageListType = GlobalVars.EventQuestListType.EventQuest; ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters; if (chapters != null) { for (int index = 0; index < chapters.Length; ++index) { if (chapters[index].IsKeyQuest()) { this.mEventType = EventQuestList.EventQuestTypes.Key; break; } } } } if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null)) { this.ItemTemplate.SetActive(false); } if (Object.op_Inequality((Object)this.Caution, (Object)null)) { this.Caution.SetActive(false); } if (this.RefreshOnStart) { this.Refresh(this.mEventType); } this.RefreshQuestTypeText(this.mEventType); }
private void Awake() { if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null)) { this.ItemTemplate.SetActive(false); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Caution, (UnityEngine.Object)null)) { this.Caution.SetActive(false); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestTypeTextFrame, (UnityEngine.Object)null)) { this.QuestTypeTextFrame.SetActive(false); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TabTriple, (UnityEngine.Object)null)) { this.TabTriple.SetActive(false); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TabDouble, (UnityEngine.Object)null)) { this.TabDouble.SetActive(false); } if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter)) { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null) { this.mEventType = !area.IsGpsQuest() ? (!area.IsKeyQuest() ? (!area.IsBeginnerQuest() ? EventQuestList.EventQuestTypes.Normal : EventQuestList.EventQuestTypes.Beginner) : EventQuestList.EventQuestTypes.Key) : EventQuestList.EventQuestTypes.Gps; } } else { if (GlobalVars.ReqEventPageListType == GlobalVars.EventQuestListType.KeyQuest) { ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters; if (chapters != null) { for (int index = 0; index < chapters.Length; ++index) { if (chapters[index].IsKeyQuest()) { this.mEventType = EventQuestList.EventQuestTypes.Key; break; } } } } if (GlobalVars.ReqEventPageListType == GlobalVars.EventQuestListType.BeginnerQuest) { ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters; if (chapters != null) { for (int index = 0; index < chapters.Length; ++index) { if (chapters[index].IsBeginnerQuest()) { this.mEventType = EventQuestList.EventQuestTypes.Beginner; break; } } } } if (GlobalVars.ReqEventPageListType == GlobalVars.EventQuestListType.Tower && this.IsOpendTower()) { this.mEventType = EventQuestList.EventQuestTypes.Tower; } if (GlobalVars.ReqEventPageListType == GlobalVars.EventQuestListType.RankingQuest && MonoSingleton <GameManager> .Instance.AvailableRankingQuesstParams.Count > 0) { GlobalVars.RankingQuestSelected = true; this.mEventType = EventQuestList.EventQuestTypes.Ranking; this.RefreshQuestTypeText(this.mEventType); FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); return; } } SubQuestTypes highestPrioritySubType = this.GetHighestPrioritySubType(); this.InitializeTab(highestPrioritySubType); this.mTabIndex = (int)highestPrioritySubType; if (this.mEventType == EventQuestList.EventQuestTypes.Beginner && this.DisabledInBeginnerQuest != null && this.DisabledInBeginnerQuest.Length > 0) { foreach (GameObject gameObject in this.DisabledInBeginnerQuest) { gameObject.SetActive(false); } } if (this.RefreshOnStart) { this.Refresh(this.mEventType); } this.RefreshQuestTypeText(this.mEventType); }
private void Refresh(EventQuestList.EventQuestTypes type) { GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems); this.mItems.Clear(); GameManager instance = MonoSingleton <GameManager> .Instance; ChapterParam[] chapters = instance.Chapters; QuestParam[] availableQuests = instance.Player.AvailableQuests; long serverTime = Network.GetServerTime(); ChapterParam currentChapter = (ChapterParam)null; List <ChapterParam> availableChapters = this.GetAvailableChapters(type, chapters, availableQuests, (string)GlobalVars.SelectedSection, (string)GlobalVars.SelectedChapter, serverTime, out currentChapter); if (type == EventQuestList.EventQuestTypes.Normal) { SubQuestTypes mTabIndex = (SubQuestTypes)this.mTabIndex; for (int index = 0; index < availableChapters.Count; ++index) { if (availableChapters[index].GetSubQuestType() != mTabIndex) { availableChapters.RemoveAt(index--); } } } if (this.Descending) { availableChapters.Reverse(); } if (type == EventQuestList.EventQuestTypes.Tower && string.IsNullOrEmpty(GlobalVars.SelectedChapter.Get())) { List <TowerParam> towerParamList = new List <TowerParam>(); for (int index1 = 0; index1 < instance.Towers.Length; ++index1) { TowerParam tower = instance.Towers[index1]; for (int index2 = 0; index2 < availableQuests.Length; ++index2) { if (availableQuests[index2].type == QuestTypes.Tower && !(availableQuests[index2].iname != tower.iname) && availableQuests[index2].IsDateUnlock(serverTime)) { towerParamList.Add(tower); break; } } } for (int index = 0; index < towerParamList.Count; ++index) { TowerParam data = towerParamList[index]; ListItemEvents listItemEvents1 = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null) ? (ListItemEvents)null : (ListItemEvents)this.ItemTemplate.GetComponent <ListItemEvents>(); if (!string.IsNullOrEmpty(data.prefabPath)) { StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("QuestChapters/"); stringBuilder.Append(data.prefabPath); listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString()); } if (!UnityEngine.Object.op_Equality((UnityEngine.Object)listItemEvents1, (UnityEngine.Object)null)) { QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(data.iname); ListItemEvents listItemEvents2 = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)listItemEvents1); DataSource.Bind <TowerParam>(((Component)listItemEvents2).get_gameObject(), data); DataSource.Bind <QuestParam>(((Component)listItemEvents2).get_gameObject(), quest); ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false); ((Component)listItemEvents2).get_gameObject().SetActive(true); listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnTowerSelect); this.mItems.Add(listItemEvents2); } } for (int index = 0; index < availableQuests.Length; ++index) { if (availableQuests[index].IsMultiTower && availableQuests[index].IsDateUnlock(serverTime)) { ListItemEvents listItemEvents1 = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null) ? (ListItemEvents)null : (ListItemEvents)this.ItemTemplate.GetComponent <ListItemEvents>(); ChapterParam chapter = availableQuests[index].Chapter; if (chapter != null) { if (!string.IsNullOrEmpty(chapter.prefabPath)) { StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("QuestChapters/"); stringBuilder.Append(chapter.prefabPath); listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString()); } if (!UnityEngine.Object.op_Equality((UnityEngine.Object)listItemEvents1, (UnityEngine.Object)null)) { ListItemEvents listItemEvents2 = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)listItemEvents1); DataSource.Bind <QuestParam>(((Component)listItemEvents2).get_gameObject(), availableQuests[index]); ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false); ((Component)listItemEvents2).get_gameObject().SetActive(true); listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnMultiTowerSelect); this.mItems.Add(listItemEvents2); } } } } } for (int index = 0; index < availableChapters.Count; ++index) { ChapterParam data = availableChapters[index]; ListItemEvents listItemEvents1 = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null) ? (ListItemEvents)null : (ListItemEvents)this.ItemTemplate.GetComponent <ListItemEvents>(); if (!string.IsNullOrEmpty(data.prefabPath)) { StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("QuestChapters/"); stringBuilder.Append(data.prefabPath); listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString()); } if (!UnityEngine.Object.op_Equality((UnityEngine.Object)listItemEvents1, (UnityEngine.Object)null)) { ListItemEvents listItemEvents2 = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)listItemEvents1); DataSource.Bind <ChapterParam>(((Component)listItemEvents2).get_gameObject(), data); DataSource.Bind <KeyItem>(((Component)listItemEvents2).get_gameObject(), data == null || data.keys.Count <= 0 ? (KeyItem)null : data.keys[0]); KeyQuestBanner component = (KeyQuestBanner)((Component)listItemEvents2).get_gameObject().GetComponent <KeyQuestBanner>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { component.UpdateValue(); } ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false); ((Component)listItemEvents2).get_gameObject().SetActive(true); listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnNodeSelect); this.mItems.Add(listItemEvents2); } } this.StableSort <ListItemEvents>(this.mItems, (Comparison <ListItemEvents>)((p1, p2) => { ChapterParam chapterParam1 = !UnityEngine.Object.op_Inequality((UnityEngine.Object)p1, (UnityEngine.Object)null) ? (ChapterParam)null : p1.Chapter; ChapterParam chapterParam2 = !UnityEngine.Object.op_Inequality((UnityEngine.Object)p2, (UnityEngine.Object)null) ? (ChapterParam)null : p2.Chapter; return((chapterParam1 == null ? 1 : (!chapterParam1.IsGpsQuest() ? 1 : 0)).CompareTo(chapterParam2 == null ? 1 : (!chapterParam2.IsGpsQuest() ? 1 : 0))); })); for (int index = 0; index < this.mItems.Count; ++index) { if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mItems[index], (UnityEngine.Object)null)) { ((Component)this.mItems[index]).get_gameObject().get_transform().SetSiblingIndex(index); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BackButton, (UnityEngine.Object)null)) { if (currentChapter != null) { this.BackButton.SetActive(true); } else if (!string.IsNullOrEmpty((string)GlobalVars.SelectedSection)) { this.BackButton.SetActive(!this.IsSectionHidden((string)GlobalVars.SelectedSection)); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Caution, (UnityEngine.Object)null)) { this.Caution.SetActive(availableChapters.Count == 0 && type != EventQuestList.EventQuestTypes.Tower); } this.RefreshSwitchButton(type); if (type == EventQuestList.EventQuestTypes.Normal) { this.EnableTab(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestTypeTextFrame, (UnityEngine.Object)null)) { this.QuestTypeTextFrame.SetActive(false); } this.SetToggleIsOn(); } else { this.DisableTab(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestTypeTextFrame, (UnityEngine.Object)null)) { this.QuestTypeTextFrame.SetActive(true); } this.RefreshQuestTypeText(type); } this.ResetScroll(); FlowNode_GameObject.ActivateOutputLinks((Component)this, 50); }
private List <ChapterParam> GetAvailableChapters(EventQuestList.EventQuestTypes type, ChapterParam[] allChapters, QuestParam[] questsAvailable, string selectedSection, string selectedChapter, long currentTime, out ChapterParam currentChapter) { GameManager instance = MonoSingleton <GameManager> .Instance; List <ChapterParam> chapterParamList = new List <ChapterParam>((IEnumerable <ChapterParam>)allChapters); currentChapter = (ChapterParam)null; for (int index = chapterParamList.Count - 1; index >= 0; --index) { if (selectedSection != chapterParamList[index].section) { chapterParamList.RemoveAt(index); } } if (!string.IsNullOrEmpty(selectedChapter)) { currentChapter = instance.FindArea(selectedChapter); for (int index = chapterParamList.Count - 1; index >= 0; --index) { if (chapterParamList[index].parent == null || chapterParamList[index].parent.iname != selectedChapter) { chapterParamList.RemoveAt(index); } } } else { for (int index = chapterParamList.Count - 1; index >= 0; --index) { if (chapterParamList[index].parent != null) { chapterParamList.RemoveAt(index); } } } switch (type) { case EventQuestList.EventQuestTypes.Normal: for (int index = 0; index < chapterParamList.Count; ++index) { if (chapterParamList[index].IsKeyQuest() || chapterParamList[index].IsTowerQuest() || chapterParamList[index].IsBeginnerQuest()) { chapterParamList.RemoveAt(index--); } } break; case EventQuestList.EventQuestTypes.Key: for (int index = 0; index < chapterParamList.Count; ++index) { if (!chapterParamList[index].IsKeyQuest()) { chapterParamList.RemoveAt(index--); } } break; case EventQuestList.EventQuestTypes.Gps: for (int index = 0; index < chapterParamList.Count; ++index) { if (chapterParamList[index].IsGpsQuest()) { if (!chapterParamList[index].HasGpsQuest()) { chapterParamList.RemoveAt(index--); } } else { chapterParamList.RemoveAt(index--); } } break; case EventQuestList.EventQuestTypes.Tower: chapterParamList.Clear(); break; case EventQuestList.EventQuestTypes.Beginner: for (int index = 0; index < chapterParamList.Count; ++index) { if (!chapterParamList[index].IsBeginnerQuest()) { chapterParamList.RemoveAt(index--); } } break; } for (int index = chapterParamList.Count - 1; index >= 0; --index) { if (!this.ChapterContainsPlayableQuest(chapterParamList[index], allChapters, questsAvailable, currentTime)) { chapterParamList.RemoveAt(index); } } return(chapterParamList); }
public void Activated(int pinID) { GlobalVars.RankingQuestSelected = false; switch (pinID) { case 0: this.Refresh(this.mEventType); break; case 1: this.Refresh(this.mEventType); break; case 2: this.RestoreHierarchy(); this.Refresh(this.mEventType); break; case 3: this.RestoreHierarchyRoot(); this.mEventType = EventQuestList.EventQuestTypes.Normal; GlobalVars.ReqEventPageListType = GlobalVars.EventQuestListType.EventQuest; this.Refresh(this.mEventType); break; case 4: this.RestoreHierarchyRoot(); this.mEventType = EventQuestList.EventQuestTypes.Key; GlobalVars.ReqEventPageListType = GlobalVars.EventQuestListType.KeyQuest; this.Refresh(this.mEventType); break; case 5: this.mEventType = EventQuestList.EventQuestTypes.Gps; this.Refresh(this.mEventType); break; case 6: this.RestoreHierarchyRoot(); this.mEventType = EventQuestList.EventQuestTypes.Tower; GlobalVars.ReqEventPageListType = GlobalVars.EventQuestListType.Tower; this.Refresh(this.mEventType); break; case 7: this.RestoreHierarchyRoot(); switch (GlobalVars.ReqEventPageListType) { case GlobalVars.EventQuestListType.EventQuest: this.mEventType = EventQuestList.EventQuestTypes.Normal; break; case GlobalVars.EventQuestListType.KeyQuest: this.mEventType = EventQuestList.EventQuestTypes.Key; break; case GlobalVars.EventQuestListType.Tower: this.mEventType = EventQuestList.EventQuestTypes.Tower; break; case GlobalVars.EventQuestListType.RankingQuest: this.mEventType = EventQuestList.EventQuestTypes.Ranking; break; } this.Refresh(this.mEventType); break; case 8: GlobalVars.RankingQuestSelected = true; this.mEventType = EventQuestList.EventQuestTypes.Ranking; this.RefreshQuestTypeText(this.mEventType); FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); break; } }
private void Refresh(EventQuestList.EventQuestTypes type) { GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems); GameManager instance = MonoSingleton <GameManager> .Instance; ChapterParam[] chapters = instance.Chapters; List <ChapterParam> chapterParamList = new List <ChapterParam>((IEnumerable <ChapterParam>)chapters); QuestParam[] availableQuests = instance.Player.AvailableQuests; long serverTime = Network.GetServerTime(); ChapterParam chapterParam = (ChapterParam)null; for (int index = chapterParamList.Count - 1; index >= 0; --index) { if ((string)GlobalVars.SelectedSection != chapterParamList[index].section) { chapterParamList.RemoveAt(index); } } if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter)) { chapterParam = instance.FindArea((string)GlobalVars.SelectedChapter); for (int index = chapterParamList.Count - 1; index >= 0; --index) { if (chapterParamList[index].parent == null || chapterParamList[index].parent.iname != (string)GlobalVars.SelectedChapter) { chapterParamList.RemoveAt(index); } } } else { for (int index = chapterParamList.Count - 1; index >= 0; --index) { if (chapterParamList[index].parent != null) { chapterParamList.RemoveAt(index); } } } switch (type) { case EventQuestList.EventQuestTypes.Normal: for (int index = 0; index < chapterParamList.Count; ++index) { if (chapterParamList[index].IsKeyQuest()) { chapterParamList.RemoveAt(index--); } } break; case EventQuestList.EventQuestTypes.Key: for (int index = 0; index < chapterParamList.Count; ++index) { if (!chapterParamList[index].IsKeyQuest()) { chapterParamList.RemoveAt(index--); } } break; } for (int index = chapterParamList.Count - 1; index >= 0; --index) { if (!this.ChapterContainsPlayableQuest(chapterParamList[index], chapters, availableQuests, serverTime)) { chapterParamList.RemoveAt(index); } } if (this.Descending) { chapterParamList.Reverse(); } if (type == EventQuestList.EventQuestTypes.Normal && string.IsNullOrEmpty(GlobalVars.SelectedChapter.Get())) { List <TowerParam> towerParamList = new List <TowerParam>(); for (int index1 = 0; index1 < instance.Towers.Length; ++index1) { TowerParam tower = instance.Towers[index1]; for (int index2 = 0; index2 < availableQuests.Length; ++index2) { if (availableQuests[index2].type == QuestTypes.Tower && !(availableQuests[index2].iname != tower.iname) && availableQuests[index2].IsDateUnlock(serverTime)) { towerParamList.Add(tower); break; } } } for (int index = 0; index < towerParamList.Count; ++index) { TowerParam data = towerParamList[index]; ListItemEvents listItemEvents1 = !Object.op_Inequality((Object)this.ItemTemplate, (Object)null) ? (ListItemEvents)null : (ListItemEvents)this.ItemTemplate.GetComponent <ListItemEvents>(); if (!string.IsNullOrEmpty(data.prefabPath)) { StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("QuestChapters/"); stringBuilder.Append(data.prefabPath); listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString()); } if (!Object.op_Equality((Object)listItemEvents1, (Object)null)) { QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(data.iname); ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1); DataSource.Bind <TowerParam>(((Component)listItemEvents2).get_gameObject(), data); DataSource.Bind <QuestParam>(((Component)listItemEvents2).get_gameObject(), quest); ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false); ((Component)listItemEvents2).get_gameObject().SetActive(true); listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnTowerSelect); this.mItems.Add(listItemEvents2); } } } for (int index = 0; index < chapterParamList.Count; ++index) { ChapterParam data = chapterParamList[index]; ListItemEvents listItemEvents1 = !Object.op_Inequality((Object)this.ItemTemplate, (Object)null) ? (ListItemEvents)null : (ListItemEvents)this.ItemTemplate.GetComponent <ListItemEvents>(); if (!string.IsNullOrEmpty(data.prefabPath)) { StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("QuestChapters/"); stringBuilder.Append(data.prefabPath); listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString()); } if (!Object.op_Equality((Object)listItemEvents1, (Object)null)) { ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1); DataSource.Bind <ChapterParam>(((Component)listItemEvents2).get_gameObject(), data); DataSource.Bind <KeyItem>(((Component)listItemEvents2).get_gameObject(), data == null || data.keys.Count <= 0 ? (KeyItem)null : data.keys[0]); KeyQuestBanner component = (KeyQuestBanner)((Component)listItemEvents2).get_gameObject().GetComponent <KeyQuestBanner>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.UpdateValue(); } ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false); ((Component)listItemEvents2).get_gameObject().SetActive(true); listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnNodeSelect); this.mItems.Add(listItemEvents2); } } if (Object.op_Inequality((Object)this.BackButton, (Object)null)) { if (chapterParam != null) { this.BackButton.SetActive(true); } else if (!string.IsNullOrEmpty((string)GlobalVars.SelectedSection)) { this.BackButton.SetActive(!this.IsSectionHidden((string)GlobalVars.SelectedSection)); } } if (Object.op_Inequality((Object)this.Caution, (Object)null)) { this.Caution.SetActive(chapterParamList.Count == 0); } this.RefreshSwitchButton(type); this.RefreshQuestTypeText(type); this.ResetScroll(); FlowNode_GameObject.ActivateOutputLinks((Component)this, 50); }