private void questTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if (questTree.SelectedNode == null) { return; } var fInput = new InputForm(questTree.SelectedNode.Text); fInput.ShowDialog(); if (!fInput.cancel) { questTree.SelectedNode.Text = fInput.text; } }
private void AddNpcDialog(bool paste) { var t = ""; if (Clipboard.ContainsText()) { t = Exporter.FixString(Clipboard.GetText()); } var fInput = new InputForm(t); if (!paste) { fInput.ShowDialog(); if (fInput.cancel) { return; } } var n = new TreeNode { Name = "npc", Text = paste ? t : fInput.text, ContextMenu = contextMenu, BackColor = Color.FromArgb(0xA4C2F4) }; if (questTree.SelectedNode == null && questTree.Nodes.Count == 0) { questTree.Nodes.Add(n); } else if (questTree.SelectedNode != null && questTree.SelectedNode.Name == "player" && questTree.SelectedNode.Nodes.Count < 3) { questTree.SelectedNode.Nodes.Add(n); questTree.SelectedNode.Expand(); } }
private void AddPlayerDialog(bool paste) { if (questTree.SelectedNode == null || questTree.SelectedNode.Name != "npc" || questTree.SelectedNode.Nodes.Count >= 3) { return; } var t = ""; if (Clipboard.ContainsText()) { t = Exporter.FixString(Clipboard.GetText()); } var fInput = new InputForm(t); if (!paste) { fInput.ShowDialog(); if (fInput.cancel) { return; } } var n = new TreeNode { Name = "player", Text = paste ? t : fInput.text, ContextMenu = contextMenu, BackColor = Color.Yellow }; questTree.SelectedNode.Nodes.Add(n); questTree.SelectedNode.Expand(); }