Beispiel #1
0
 static public string GetPrettyNodeVoicingID(Dialogue dialogue, DialogueNode node)
 {
     return(String.Format("VX_{0}_{1}", dialogue.GetName(), node.ID.ToString()));
 }
Beispiel #2
0
 public static void AddSearchResult(string message, Dialogue dialogue, DialogueNode node)
 {
     SearchResults.WriteLine(message, dialogue.GetName(), node.ID);
 }
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNode inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode;

            treeAttributes.ImageList = EditorCore.DefaultImageList;

            //Roots
            treeNodeRootConditions = treeAttributes.Nodes.Add("Root", "Conditions");
            treeNodeRootConditions.ContextMenuStrip = menuAttributes;
            EditorHelper.SetNodeIcon(treeNodeRootConditions, ENodeIcon.ListRootConditions);

            treeNodeRootActions = treeAttributes.Nodes.Add("Root", "Actions");
            treeNodeRootActions.ContextMenuStrip = menuAttributes;
            EditorHelper.SetNodeIcon(treeNodeRootActions, ENodeIcon.ListRootActions);

            treeNodeRootFlags = treeAttributes.Nodes.Add("Root", "Flags");
            treeNodeRootFlags.ContextMenuStrip = menuAttributes;
            EditorHelper.SetNodeIcon(treeNodeRootFlags, ENodeIcon.ListRootFlags);

            //Sync Conditions
            foreach (NodeCondition condition in dialogueNode.Conditions)
            {
                AddTreeNodeCondition(condition, treeNodeRootConditions);
            }

            //Sync Actions
            foreach (NodeAction action in dialogueNode.Actions)
            {
                AddTreeNodeAction(action);
            }

            //Sync Flags
            foreach (NodeFlag flag in dialogueNode.Flags)
            {
                AddTreeNodeFlag(flag);
            }

            //Fill Menu Conditions
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = "AND";
                menuItem.Click += delegate
                {
                    AddNodeCondition(Activator.CreateInstance(typeof(NodeConditionAnd)) as NodeCondition);
                };
                menuItemAddCondition.DropDownItems.Add(menuItem);
            }

            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = "OR";
                menuItem.Click += delegate
                {
                    AddNodeCondition(Activator.CreateInstance(typeof(NodeConditionOr)) as NodeCondition);
                };
                menuItemAddCondition.DropDownItems.Add(menuItem);
            }

            menuItemAddCondition.DropDownItems.Add(new ToolStripSeparator());

            foreach (ConditionSlot slot in EditorCore.ConditionSlots)
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = slot.Text;
                menuItem.Click += delegate
                {
                    AddNodeCondition(Activator.CreateInstance(slot.ConditionType) as NodeCondition);
                };
                menuItemAddCondition.DropDownItems.Add(menuItem);
            }

            //Fill Menu Actions
            foreach (ActionSlot slot in EditorCore.ActionSlots)
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = slot.Text;
                menuItem.Click += delegate
                {
                    AddNodeAction(Activator.CreateInstance(slot.ActionType) as NodeAction);
                };
                menuItemAddAction.DropDownItems.Add(menuItem);
            }

            //Fill Menu Flags
            foreach (FlagSlot slot in EditorCore.FlagSlots)
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = slot.Text;
                menuItem.Click += delegate
                {
                    AddNodeFlag(Activator.CreateInstance(slot.FlagType) as NodeFlag);
                };
                menuItemAddFlag.DropDownItems.Add(menuItem);
            }

            ready = true;
        }
Beispiel #4
0
 static public void LogError(string message, Dialogue dialogue, DialogueNode node)
 {
     LogError(message, dialogue.GetName(), node.ID);
 }