/// <summary> /// Adds the conversation dialogue entry. Starting in Chat Mapper 1.6, XML entries don't /// include the conversation ID, so we set it manually here. /// </summary> /// <param name='chatMapperEntry'> /// Chat Mapper entry. /// </param> private void AddConversationDialogueEntry(ChatMapper.DialogEntry chatMapperEntry) { var entry = new DialogueEntry(chatMapperEntry); entry.conversationID = id; dialogueEntries.Add(entry); }
/// <summary> /// Initializes a new DialogueEntry copied from a Chat Mapper DialogEntry. /// </summary> /// <param name='chatMapperDialogEntry'> /// The Chat Mapper dialog entry to copy. /// </param> public DialogueEntry(ChatMapper.DialogEntry chatMapperDialogEntry) { if (chatMapperDialogEntry != null) { id = chatMapperDialogEntry.ID; fields = Field.CreateListFromChatMapperFields(chatMapperDialogEntry.Fields); //--- Removed in Chat Mapper 1.7: conversationID = chatMapperDialogEntry.ConversationID; isRoot = chatMapperDialogEntry.IsRoot; isGroup = chatMapperDialogEntry.IsGroup; if (isGroup) { Sequence = "None()"; } nodeColor = chatMapperDialogEntry.NodeColor; delaySimStatus = chatMapperDialogEntry.DelaySimStatus; falseConditionAction = chatMapperDialogEntry.FalseCondtionAction; conditionPriority = ConditionPriorityTools.StringToConditionPriority(chatMapperDialogEntry.ConditionPriority); foreach (var chatMapperLink in chatMapperDialogEntry.OutgoingLinks) { outgoingLinks.Add(new Link(chatMapperLink)); } conditionsString = chatMapperDialogEntry.ConditionsString; userScript = chatMapperDialogEntry.UserScript; } }
private static void AddCanvasRectField(DialogueSystem.DialogueEntry entry, ChatMapper.DialogEntry cmpEntry) { var canvasRectField = cmpEntry.Fields.Find(f => string.Equals(f.Title, "canvasRect")); if (canvasRectField == null) { canvasRectField = new ChatMapper.Field(); canvasRectField.Title = "canvasRect"; cmpEntry.Fields.Add(canvasRectField); } canvasRectField.Value = string.Format("{0};{1}", entry.canvasRect.x, entry.canvasRect.y); }
private static ChatMapper.DialogEntry DialogEntryToCmp(DialogueSystem.DialogueEntry entry) { ChatMapper.DialogEntry cmpEntry = new DialogEntry(); cmpEntry.ID = entry.id; cmpEntry.IsRoot = entry.isRoot || ((entry.id == 0) && string.Equals(entry.Title, "START")); cmpEntry.IsGroup = entry.isGroup; cmpEntry.NodeColor = string.IsNullOrEmpty(entry.nodeColor) ? "White" : entry.nodeColor; cmpEntry.DelaySimStatus = entry.delaySimStatus; cmpEntry.FalseCondtionAction = GetValidFalseConditionAction(entry.falseConditionAction); cmpEntry.ConditionPriority = entry.conditionPriority.ToString(); cmpEntry.Fields = FieldsToCmp(entry.fields); AddRequiredDialogEntryFields(cmpEntry.Fields); cmpEntry.Fields.ForEach(cmpField => { if (cmpField.Title.StartsWith("Dialogue Text")) cmpField.Type = "Localization"; }); cmpEntry.OutgoingLinks = LinksToCmp(entry.outgoingLinks); foreach (var link in cmpEntry.OutgoingLinks) { link.OriginConvoID = entry.conversationID; link.OriginDialogID = entry.id; } cmpEntry.ConditionsString = entry.conditionsString; cmpEntry.UserScript = entry.userScript; return cmpEntry; }