private void OnQuestLogChanged(Object p_sender, EventArgs p_args) { QuestChangedEventArgs questChangedEventArgs = (QuestChangedEventArgs)p_args; if (questChangedEventArgs == null) { return; } switch (questChangedEventArgs.ChangeType) { case QuestChangedEventArgs.Type.NEW_QUEST: AudioController.Play("QuestRecieved", 1f, Mathf.Max(0f, 0.9f * (m_questCompletedSoundEndTime - Time.realtimeSinceStartup)), 0f); AddEntry(questChangedEventArgs.QuestStep); break; case QuestChangedEventArgs.Type.COMPLETED_QUEST: { AudioObject audioObject = AudioController.Play("QuestCompleted"); if (audioObject != null) { m_questCompletedSoundEndTime = Time.realtimeSinceStartup + audioObject.clipLength; } else if (!AudioController.IsValidAudioID("QuestCompleted")) { Debug.LogError("Could not play quest completed sound. AudioID=QuestCompleted"); } foreach (NewHUDQuestLogEntry newHUDQuestLogEntry in m_entries) { if (questChangedEventArgs.QuestStep.StaticData.StaticID == newHUDQuestLogEntry.QuestStep.StaticData.StaticID) { newHUDQuestLogEntry.UpdateStep(); m_currentlyVisibleEntry = newHUDQuestLogEntry; } } break; } case QuestChangedEventArgs.Type.COMPLETED_OBJECTIVE: if (m_questCompletedSoundEndTime - 0.25f < Time.realtimeSinceStartup) { AudioController.Play("QuestObjectiveCompleted"); } foreach (NewHUDQuestLogEntry newHUDQuestLogEntry2 in m_entries) { if (questChangedEventArgs.QuestStep.StaticData.StaticID == newHUDQuestLogEntry2.QuestStep.StaticData.StaticID) { newHUDQuestLogEntry2.UpdateObjectives(); m_currentlyVisibleEntry = newHUDQuestLogEntry2; } } RepositionEntries(); break; } }
internal void OnQuestChanged(Object p_sender, EventArgs p_e) { QuestChangedEventArgs questChangedEventArgs = (QuestChangedEventArgs)p_e; if (questChangedEventArgs.QuestStep != null) { foreach (WorldMapPoint worldMapPoint in m_worldMapPoints.Values) { if (worldMapPoint.StaticData.QuestChangedType == questChangedEventArgs.ChangeType && worldMapPoint.StaticData.QuestID == questChangedEventArgs.QuestStep.StaticData.StaticID) { SetVisible(worldMapPoint); } } } }
private void OnQuestlogChanged(Object sender, EventArgs args) { QuestChangedEventArgs questChangedEventArgs = (QuestChangedEventArgs)args; if (questChangedEventArgs.QuestStep != null && (questChangedEventArgs.ChangeType == QuestChangedEventArgs.Type.NEW_QUEST || questChangedEventArgs.ChangeType == QuestChangedEventArgs.Type.COMPLETED_QUEST || questChangedEventArgs.ChangeType == QuestChangedEventArgs.Type.COMPLETED_OBJECTIVE)) { foreach (QueuedQuest queuedQuest in m_questQueue) { if (queuedQuest.Quest.StaticData.StaticID == questChangedEventArgs.QuestStep.StaticData.StaticID) { if (queuedQuest.ChangeType == QuestChangedEventArgs.Type.COMPLETED_QUEST || questChangedEventArgs.ChangeType == QuestChangedEventArgs.Type.COMPLETED_QUEST) { queuedQuest.ChangeType = QuestChangedEventArgs.Type.COMPLETED_QUEST; } return; } } m_questQueue.Enqueue(new QueuedQuest(questChangedEventArgs.QuestStep, questChangedEventArgs.ChangeType)); } }