示例#1
0
 private void CleanupPageableList()
 {
     foreach (BookEntry bookEntry in m_pageableList.EntryList)
     {
         if (bookEntry != null)
         {
             bookEntry.Init(0, String.Empty);
             bookEntry.SetSelected(false);
             QuestEntry questEntry = bookEntry;
             if (questEntry != null)
             {
                 QuestEntry questEntry2 = questEntry;
                 questEntry2.OnQuestClicked = (EventHandler)Delegate.Remove(questEntry2.OnQuestClicked, new EventHandler(QuestClick));
             }
         }
     }
 }
示例#2
0
        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);
        }