protected override void Update() { base.Update(); if (IsFreeSlot) { if (m_tokenQueue.Count > 0) { GameObject gameObject = Helper.Instantiate <GameObject>(m_TokenEntryPrefab); HUDSideInfoToken component = gameObject.GetComponent <HUDSideInfoToken>(); AddEntry(component); TokenStaticData tokenStaticData = m_tokenQueue.Dequeue(); component.Init(tokenStaticData, m_neededTokens.Contains(tokenStaticData.StaticID)); } else if (m_loreBookQueue.Count > 0) { GameObject gameObject2 = Helper.Instantiate <GameObject>(m_BookEntryPrefab); HUDSideInfoBook component2 = gameObject2.GetComponent <HUDSideInfoBook>(); AddEntry(component2); component2.Init(m_loreBookQueue.Dequeue()); } else if (m_questQueue.Count > 0 && IsFreeSlot) { GameObject gameObject3 = Helper.Instantiate <GameObject>(m_QuestEntryPrefab); HUDSideInfoQuest component3 = gameObject3.GetComponent <HUDSideInfoQuest>(); QueuedQuest queuedQuest = m_questQueue.Dequeue(); HUDSideInfoQuest.QuestState pState = HUDSideInfoQuest.QuestState.UPDATED; QuestChangedEventArgs.Type changeType = queuedQuest.ChangeType; if (changeType != QuestChangedEventArgs.Type.NEW_QUEST) { if (changeType == QuestChangedEventArgs.Type.COMPLETED_QUEST) { pState = HUDSideInfoQuest.QuestState.COMPLETED; } } else { pState = HUDSideInfoQuest.QuestState.ADDED; } if (queuedQuest.Quest.QuestState == EQuestState.SOLVED) { pState = HUDSideInfoQuest.QuestState.COMPLETED; } if (m_questQueue.Count > 0) { QueuedQuest queuedQuest2 = m_questQueue.Peek(); if (queuedQuest2.Quest.StaticData.FollowupStep == queuedQuest.Quest.StaticData.StaticID) { m_questQueue.Dequeue(); pState = HUDSideInfoQuest.QuestState.UPDATED; } else if (queuedQuest.Quest.StaticData.FollowupStep == queuedQuest2.Quest.StaticData.StaticID) { queuedQuest = m_questQueue.Dequeue(); pState = HUDSideInfoQuest.QuestState.UPDATED; } } AddEntry(component3); component3.Init(queuedQuest.Quest, pState); } } }
public QueuedQuest(QuestStep p_quest, QuestChangedEventArgs.Type p_changeType) { m_quest = p_quest; m_changeType = p_changeType; }