private void ParseLink(ReplyChoiceNode link) { string a = "E"; int tgtUID = link.Index; if (!IsReply) { a = "R"; tgtUID += 1000; } link.NodeIDLink = $"{a}{link.Index}"; link.ReplyLine = GlobalFindStrRefbyID(link.ReplyStrRef, ParentWindow.Pcc); var tgtObj = ParentWindow.CurrentObjects.First(t => t.NodeUID == tgtUID); var tgtNode = (DiagNode)tgtObj; link.TgtFireCnd = "Conditional"; if (!tgtNode.Node.FiresConditional) { link.TgtFireCnd = "Bool"; } link.TgtCondition = tgtNode.Node.ConditionalOrBool; link.TgtLine = tgtNode.Node.Line; link.Ordinal = DialogueEditorWPF.AddOrdinal(link.Order + 1); link.TgtSpeaker = tgtNode.Node.SpeakerTag.SpeakerName; }
private void ReOrderTable() { linkTable.Sort(l => l.Order); int n = 0; foreach (var link in linkTable) { link.Order = n; link.Ordinal = DialogueEditorWPF.AddOrdinal(link.Order + 1); n++; } }
public LinkEditor(DialogueEditorWPF owner, DiagNode node) { ParentWindow = owner; if (ParentWindow.SelectedDialogueNode == null) { Close(); throw new Exception("ListEd couldn't find node."); } LoadCommands(); InitializeComponent(); Dnode = node; IsReply = Dnode.Node.IsReply; if (IsReply) { this.Width = 700; } string s = "E"; int id = Dnode.NodeID; if (IsReply) { //outType_TB.Text = "E"; s = "R"; id -= 1000; } Title = $"Link Editor - {s}{id} : {Dnode.Node.LineStrRef}"; LineString_TextBlock.Text = Dnode.Node.Line; int n = 0; foreach (var link in Dnode.Links) { link.Order = n; ParseLink(link); linkTable.Add(link); n++; } GenerateTable(); }
private static Action HandleCommandLineJumplistCall(string[] args, out int exitCode) { exitCode = 0; if (args.Length < 2) { return(() => { }); //do nothing delgate. Will do nothing when main UI loads } string arg = args[1]; if (arg == "JUMPLIST_PACKAGE_EDITOR") { return(() => { PackageEditorWPF editor = new PackageEditorWPF(); editor.Show(); editor.Activate(); }); } if (arg == "JUMPLIST_SEQUENCE_EDITOR") { return(() => { var editor = new SequenceEditorWPF(); editor.Show(); editor.Activate(); }); } if (arg == "JUMPLIST_PATHFINDING_EDITOR") { return(() => { PathfindingEditorWPF editor = new PathfindingEditorWPF(); editor.Show(); editor.Activate(); }); } if (arg == "JUMPLIST_SOUNDPLORER") { return(() => { SoundplorerWPF soundplorerWpf = new SoundplorerWPF(); soundplorerWpf.Show(); soundplorerWpf.Activate(); }); } //Do not remove - used by Mass Effect Mod Manager to boot the tool if (arg == "JUMPLIST_ASIMANAGER") { return(() => { ASIManager asiManager = new ASIManager(); asiManager.Show(); asiManager.Activate(); }); } //Do not remove - used by Mass Effect Mod Manager to boot the tool if (arg == "JUMPLIST_MOUNTEDITOR") { return(() => { MountEditorWPF mountEditorWpf = new MountEditorWPF(); mountEditorWpf.Show(); mountEditorWpf.Activate(); }); } //Do not remove - used by Mass Effect Mod Manager to boot the tool if (arg == "JUMPLIST_PACKAGEDUMPER") { return(() => { PackageDumper.PackageDumper packageDumper = new PackageDumper.PackageDumper(); packageDumper.Show(); packageDumper.Activate(); }); } //Do not remove - used by Mass Effect Mod Manager to boot the tool if (arg == "JUMPLIST_DLCUNPACKER") { return(() => { DLCUnpacker.DLCUnpackerUI dlcUnpacker = new DLCUnpacker.DLCUnpackerUI(); dlcUnpacker.Show(); dlcUnpacker.Activate(); }); } if (arg == "JUMPLIST_DIALOGUEEDITOR") { return(() => { DialogueEditorWPF editor = new DialogueEditorWPF(); editor.Show(); editor.Activate(); }); } if (arg == "JUMPLIST_MESHPLORER") { return(() => { MeshplorerWPF meshplorerWpf = new MeshplorerWPF(); meshplorerWpf.Show(); meshplorerWpf.Activate(); }); } string ending = Path.GetExtension(args[1]).ToLower(); switch (ending) { case ".pcc": case ".sfm": case ".upk": case ".u": case ".udk": return(() => { PackageEditorWPF editor = new PackageEditorWPF(); editor.Show(); editor.LoadFile(args[1]); editor.RestoreAndBringToFront(); }); //return 2; //Do not signal bring main forward } exitCode = 0; //is this even used? return(null); }
public DStart(DialogueEditorWPF editor, int orderKey, int StartNbr, float x, float y, ConvGraphEditor ConvGraphEditor) : base(ConvGraphEditor) { NodeUID = 2000 + StartNbr; Editor = editor; Order = orderKey; string ordinal = DialogueEditorWPF.AddOrdinal(orderKey + 1); StartNumber = StartNbr; outlinePen = new Pen(EventColor); listname = $"{ordinal} Start Node: {StartNbr}";; float starty = 0; float w = 15; float midW = 50; GetTitleBox(listname, 20); w += titleBox.Width; OutputLink l = new OutputLink { Links = new List <int>(StartNbr), InputIndices = new int(), Edges = new List <DiagEdEdge>(), Desc = $"Out {StartNbr}", RCat = EReplyCategory.REPLY_CATEGORY_DEFAULT }; int linkedOp = StartNbr; l.Links.Add(linkedOp); l.InputIndices = 0; l.node = CreateActionLinkBox(); l.node.Brush = outputBrush; l.node.Pickable = false; PPath dragger = CreateActionLinkBox(); dragger.Brush = mostlyTransparentBrush; dragger.X = l.node.X; dragger.Y = l.node.Y; dragger.AddInputEventListener(outputDragHandler); l.node.AddChild(dragger); Outlinks.Add(l); outLinkBox = new PPath(); DText t2 = new DText($"{StartNbr} :"); if (t2.Width + 10 > midW) { midW = t2.Width + 10; } t2.X = 0 - t2.Width; t2.Y = starty - 10; t2.Pickable = false; t2.AddChild(l.node); outLinkBox.AddChild(t2); outLinkBox.AddPolygon(new[] { new PointF(0, 0), new PointF(0, starty), new PointF(-0.5f * midW, starty + 30), new PointF(0 - midW, starty), new PointF(0 - midW, 0), new PointF(midW / -2, -30) }); outLinkBox.Pickable = false; outLinkBox.Pen = outlinePen; outLinkBox.Brush = nodeBrush; float h = titleBox.Height + 1; outLinkBox.TranslateBy(titleBox.Width / 2 + midW / 2, h + 30); h += outLinkBox.Height + 1; bounds = new RectangleF(0, 0, w, h); AddChild(titleBox); AddChild(outLinkBox); Pickable = true; SetOffset(x, y); MouseEnter += OnMouseEnter; MouseLeave += OnMouseLeave; }