private void UpdateRuntimeConversationsTab()
 {
     if (DialogueManager.HasInstance) {
         var newConversationState = DialogueManager.CurrentConversationState;
         if (newConversationState != currentConversationState) {
             currentConversationState = newConversationState;
             currentRuntimeEntry = (currentConversationState != null && currentConversationState.subtitle != null)
                 ? currentConversationState.subtitle.dialogueEntry
                     : null;
             Repaint();
         }
     }
 }
 private void PopulateCache(Transform speaker, Transform listener)
 {
     if (string.IsNullOrEmpty(conversation) && DialogueDebug.LogWarnings) Debug.Log(string.Format("{0}: Bark (speaker={1}, listener={2}): conversation title is blank", new System.Object[] { DialogueDebug.Prefix, speaker, listener }), speaker);
     ConversationModel conversationModel = new ConversationModel(DialogueManager.MasterDatabase, conversation, speaker, listener, DialogueManager.AllowLuaExceptions, DialogueManager.IsDialogueEntryValid);
     cachedState = conversationModel.FirstState;
     if ((cachedState == null) && DialogueDebug.LogWarnings) Debug.Log(string.Format("{0}: Bark (speaker={1}, listener={2}): '{3}' has no START entry", new System.Object[] { DialogueDebug.Prefix, speaker, listener, conversation }), speaker);
     if (!cachedState.HasAnyResponses && DialogueDebug.LogWarnings) Debug.Log(string.Format("{0}: Bark (speaker={1}, listener={2}): '{3}' has no valid bark lines", new System.Object[] { DialogueDebug.Prefix, speaker, listener, conversation }), speaker);
 }
 private void DrawConversationSectionNodeStyle()
 {
     if (Application.isPlaying && DialogueManager.HasInstance) {
         currentConversationState = DialogueManager.CurrentConversationState;
         currentRuntimeEntry = (currentConversationState != null && currentConversationState.subtitle != null)
             ? currentConversationState.subtitle.dialogueEntry
                 : null;
     } else {
         currentRuntimeEntry = null;
     }
     CheckDialogueTreeGUIStyles();
     if (nodeEditorDeleteCurrentConversation) DeleteCurrentConversationInNodeEditor();
     if (inspectorSelection == null) inspectorSelection = currentConversation;
     DrawCanvas();
     DrawNodeEditorTopControls();
     HandleEmptyCanvasEvents();
     HandleKeyEvents();
 }
 /// <summary>
 /// Updates the responses in the specified state.
 /// </summary>
 /// <param name="state">State to check.</param>
 public void UpdateResponses(ConversationState state)
 {
     List<Response> npcResponses = new List<Response>();
     List<Response> pcResponses = new List<Response>();
     EvaluateLinks(state.subtitle.dialogueEntry, npcResponses, pcResponses, new List<DialogueEntry>());
     state.npcResponses = npcResponses.ToArray();
     state.pcResponses = pcResponses.ToArray();
 }
 /// <summary>
 /// Determines whether this is the START entry.
 /// </summary>
 /// <returns><c>true</c> if is start entry; otherwise, <c>false</c>.</returns>
 /// <param name="state">State.</param>
 private bool IsStartEntryState(ConversationState state)
 {
     return (state != null) && (state.subtitle != null) && (state.subtitle.dialogueEntry != null) &&
         (state.subtitle.dialogueEntry.id == 0);
 }
 private void SetConversationOverride(ConversationState state)
 {
     m_view.displaySettings.conversationOverrideSettings = m_model.GetConversationOverrideSettings(state);
 }
Exemple #7
0
 /// <summary>
 /// Determines whether this is the START entry.
 /// </summary>
 /// <returns><c>true</c> if is start entry; otherwise, <c>false</c>.</returns>
 /// <param name="state">State.</param>
 private bool IsStartEntryState(ConversationState state)
 {
     return((state != null) && (state.subtitle != null) && (state.subtitle.dialogueEntry != null) &&
            (state.subtitle.dialogueEntry.id == 0));
 }
Exemple #8
0
        public ConversationOverrideDisplaySettings GetConversationOverrideSettings(ConversationState state)
        {
            var conversation = m_database.GetConversation(GetConversationID(state));

            return((conversation != null) ? conversation.overrideSettings : null);
        }
Exemple #9
0
 public int GetConversationID(ConversationState state)
 {
     return((state != null && state.subtitle != null && state.subtitle.dialogueEntry != null) ? state.subtitle.dialogueEntry.conversationID : -1);
 }
 /// <summary>
 /// Goes to a conversation state. If the state is <c>null</c>, the conversation ends.
 /// </summary>
 /// <param name='state'>
 /// State.
 /// </param>
 public void GotoState(ConversationState state)
 {
     this.state = state;
     if (state != null) {
         if (state.IsGroup) {
             view.ShowLastNPCSubtitle();
         } else {
             var isPCAutoResponseNext = state.HasPCAutoResponse;
             var isPCResponseMenuNext = !isPCAutoResponseNext && state.HasPCResponses && !state.HasNPCResponse;
             view.StartSubtitle(state.subtitle, isPCResponseMenuNext, isPCAutoResponseNext);
         }
     } else {
         Close();
     }
     DialogueManager.Instance.CurrentConversationState = state;
 }