public void UpdateEntries(EQuestType p_type) { m_pageableList.CurrentIndex = 0; Int32 bookCount = UpdateQuestList(p_type); m_pageableList.Finish(bookCount); }
public List <QuestStep> GetActiveStepsByCategory(EQuestType p_type) { List <QuestStep> list = new List <QuestStep>(); foreach (QuestStep questStep in m_quests) { if (questStep.StaticData.Type == p_type && questStep.QuestState == EQuestState.ACTIVE) { list.Add(questStep); } } return(list); }
private void OnQuestTabIndexChanged(Object sender, EventArgs e) { Tab tab = m_questTabController.Tabs[m_questTabController.CurrentTabIndex]; QuestTabInfo component = tab.GetComponent <QuestTabInfo>(); if (component == null) { m_headerLabel.text = LocaManager.GetText("TT_QUEST_TOKENS"); m_tokenPanel.Show(); NGUITools.SetActive(m_showFinished.gameObject, false); NGUITools.SetActive(m_detailsPanel.gameObject, false); NGUITools.SetActive(m_pageableList.gameObject, false); return; } m_tokenPanel.Hide(); NGUITools.SetActive(m_showFinished.gameObject, true); NGUITools.SetActive(m_detailsPanel.gameObject, true); NGUITools.SetActive(m_pageableList.gameObject, true); EQuestType questType = component.QuestType; switch (questType) { case EQuestType.QUEST_TYPE_MAIN: m_headerLabel.text = LocaManager.GetText("TT_QUEST_MAIN"); break; default: if (questType != EQuestType.ALL) { m_headerLabel.text = String.Empty; } else { m_headerLabel.text = LocaManager.GetText("TT_QUEST_ALL"); } break; case EQuestType.QUEST_TYPE_SIDE: m_headerLabel.text = LocaManager.GetText("TT_QUEST_SIDE"); break; case EQuestType.QUEST_TYPE_ONGOING: m_headerLabel.text = LocaManager.GetText("TT_QUEST_ONGOING"); break; } UpdateEntries(component.QuestType); }
private Int32 UpdateQuestList(EQuestType p_type) { CleanupPageableList(); m_questType = p_type; Boolean flag = false; List <QuestStep> stepsByState; if (m_showFinished.isChecked) { stepsByState = LegacyLogic.Instance.WorldManager.QuestHandler.GetStepsByState(EQuestState.ACTIVE); stepsByState.AddRange(LegacyLogic.Instance.WorldManager.QuestHandler.GetStepsByState(EQuestState.SOLVED)); } else { stepsByState = LegacyLogic.Instance.WorldManager.QuestHandler.GetStepsByState(EQuestState.ACTIVE); } List <QuestStep> list = new List <QuestStep>(); foreach (QuestStep questStep in stepsByState) { Boolean flag2 = false; if (p_type == EQuestType.ALL) { flag2 = true; } else if (p_type == EQuestType.QUEST_TYPE_MAIN && questStep.StaticData.Type == p_type) { flag2 = true; } else if (p_type == EQuestType.QUEST_TYPE_ONGOING && questStep.StaticData.Type == p_type) { flag2 = true; } else if (p_type == EQuestType.QUEST_TYPE_SIDE && (questStep.StaticData.Type == EQuestType.QUEST_TYPE_GRANDMASTER || questStep.StaticData.Type == EQuestType.QUEST_TYPE_PROMOTION || questStep.StaticData.Type == EQuestType.QUEST_TYPE_REPEATABLE || questStep.StaticData.Type == EQuestType.QUEST_TYPE_SIDE)) { flag2 = true; } if (flag2) { if (m_selectedQuestStep != null && m_selectedQuestStep == questStep) { flag = true; } list.Add(questStep); } } for (Int32 i = m_pageableList.CurrentIndex; i < m_pageableList.EndIndex; i++) { if (i < list.Count) { QuestStep questStep2 = list[i]; BookEntry entry = m_pageableList.GetEntry(); entry.Init(questStep2.StaticData.StaticID, questStep2.StaticData.Name); QuestEntry questEntry = entry; QuestEntry questEntry2 = questEntry; questEntry2.OnQuestClicked = (EventHandler)Delegate.Combine(questEntry2.OnQuestClicked, new EventHandler(QuestClick)); questEntry.RestorePositions(); questEntry.SetQuestStep(questStep2); } else { BookEntry entry2 = m_pageableList.GetEntry(); entry2.Init(0, String.Empty); } } if (list.Count > 0) { if (flag) { QuestClick(m_selectedQuestStep, EventArgs.Empty); } else { m_selectedQuestStep = null; QuestClick(m_pageableList.EntryList[0].GetQuestStep(), EventArgs.Empty); } } else { ClearDetails(); } return(list.Count); }