From a32cc82ce9a19e8848ed5c14bf819652ba05a67e Mon Sep 17 00:00:00 2001 From: PNWParksFan Date: Sat, 27 Nov 2021 22:55:55 -0800 Subject: [PATCH] Fixed drag-to-copy for path nodes; update node vertex box position when dragging; block drag-to-copy multi-selected path nodes (which does not work, it only copies the first one) --- CodeWalker/World/MapSelection.cs | 4 ++-- CodeWalker/WorldForm.cs | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CodeWalker/World/MapSelection.cs b/CodeWalker/World/MapSelection.cs index 4493d0f..2223492 100644 --- a/CodeWalker/World/MapSelection.cs +++ b/CodeWalker/World/MapSelection.cs @@ -1365,7 +1365,7 @@ namespace CodeWalker } foreach (var kvp in pathYnds) { - wf.UpdatePathYndGraphics(kvp.Key, true); + wf.UpdatePathYndGraphics(kvp.Key, false); } foreach (var kvp in navYnvs) { @@ -1399,7 +1399,7 @@ namespace CodeWalker { if (PathNode != null) { - wf.UpdatePathYndGraphics(PathNode.Ynd, true); + wf.UpdatePathYndGraphics(PathNode.Ynd, false); } if (NavPoly != null) { diff --git a/CodeWalker/WorldForm.cs b/CodeWalker/WorldForm.cs index 010716c..9e6e02e 100644 --- a/CodeWalker/WorldForm.cs +++ b/CodeWalker/WorldForm.cs @@ -1860,6 +1860,7 @@ namespace CodeWalker } else { + ynd.UpdateAllNodePositions(); space.BuildYndVerts(ynd); } //lock (Renderer.RenderSyncRoot) @@ -5871,7 +5872,16 @@ namespace CodeWalker GrabbedWidget.IsDragging = true; if (Input.ShiftPressed) { - CloneItem(); + var ms = CurrentMapSelection.MultipleSelectionItems; + if (ms?.Length > 0 && ms[0].PathNode != null) + { + MessageBox.Show("You cannot clone multiple path nodes at once", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + GrabbedWidget.IsDragging = false; + GrabbedWidget = null; + } else + { + CloneItem(); + } } MarkUndoStart(GrabbedWidget); }