public override string CanAddTo(DialogNode node) { if (node.Nodes.Count > 0) return "A link node cannot be a sibling"; else return base.CanAddTo(node); }
public DialogTreeNode(DialogNode dn, string text) : base(dn.ToString()) { ImageIndex = SelectedImageIndex = dn.ImageIndex; DialogNode = dn; dn.Removed += new EventHandler(dn_Removed); dn.Change += new EventHandler(dn_Change); }
public virtual void AddNode(DialogNode node) { nodes.Add(node); node.id = dialog.GetNextID(); node.parent = this; node.dialog = this.dialog; dialog.OnAddNode(node); dialog.OnNodesChange(); }
public override string CanAddTo(DialogNode node) { foreach (DialogNode n in node.Nodes) { if (n.NodeType != DialogNodeType.Response) return "A response node cannot be a sibling to a different type"; } return base.CanAddTo(node); }
private void processNode(DialogTreeNode treeNode, DialogNode dialogNode) { foreach (DialogNode n in dialogNode.Nodes) { DialogTreeNode tn = new DialogTreeNode(n, n.ToString()); treeNode.Nodes.Add(tn); processNode(tn, n); treeNode.Expand(); } }
public virtual string CanAddTo(DialogNode node) { return null; }
public void RemoveNode(DialogNode node) { nodes.Remove(node); node.OnRemove(); dialog.OnRemoveNode(node); dialog.OnNodesChange(); }
public override string CanAddTo(DialogNode node) { return null; }
private void prepareToolKit(DialogNode dialogNode) { tabControl1.TabPages.Clear(); foreach (TabPage tp in tabPages) { foreach (string s in ((string)tp.Tag).Split(',')) { if ((int)dialogNode.NodeType == Int32.Parse(s)) { tabControl1.TabPages.Add(tp); break; } } } if (dialogNode.NodeType == DialogNodeType.Action) { var node = dialogTreeViewer1.SelectedNode as ActionNode; conditionalScriptBox.Text = node.Conditions; actionScriptBox.Text = node.Script; tabControl1.SelectedIndex = 1; } else if (dialogNode.NodeType == DialogNodeType.Response) { var node = dialogTreeViewer1.SelectedNode as ResponseNode; conditionalScriptBox.Text = node.Conditions; txtResponse.Text = node.Text; tabControl1.SelectedIndex = 1; } else if (dialogNode.NodeType == DialogNodeType.Link) { var node = dialogNode as LinkNode; chkLinkToEnd.Checked = node.LinkToEnd; } }
internal void OnRemoveNode(DialogNode node) { nodesByID.Remove(node.Id); foreach (DialogNode dn in node.Nodes) { OnRemoveNode(dn); } }
internal void OnAddNode(DialogNode node) { nodesByID[node.Id] = node; node.Change += new EventHandler(node_Change); }
private void restoreParentage(DialogNode node) { nodesByID[node.Id] = node; node.Dialog = this; foreach (DialogNode dn in node.Nodes) { dn.Dialog = this; dn.Parent = node; nodesByID[dn.Id] = dn; nextId = Math.Max(nextId, dn.Id); restoreParentage(dn); } }