From b55458b113dac6eec514e77ca35ae65e537b7e4e Mon Sep 17 00:00:00 2001 From: dexy Date: Mon, 4 Sep 2023 20:48:50 +1000 Subject: [PATCH] Ynd research V2 by fish-cfx Some refactoring and adjustments by dexy --- .../GameFiles/FileTypes/YndFile.cs | 1110 ++++++++++++----- CodeWalker.Core/World/Space.cs | 151 ++- CodeWalker/Project/Panels/EditMultiPanel.cs | 1 + .../Panels/EditYndNodePanel.Designer.cs | 1027 ++++++++------- CodeWalker/Project/Panels/EditYndNodePanel.cs | 325 ++++- .../Project/Panels/EditYndPanel.Designer.cs | 92 +- CodeWalker/Project/Panels/EditYndPanel.cs | 17 +- CodeWalker/Project/ProjectForm.cs | 107 +- CodeWalker/Project/UndoStep.cs | 3 +- CodeWalker/World/MapSelection.cs | 12 +- CodeWalker/WorldForm.cs | 137 +- 11 files changed, 2098 insertions(+), 884 deletions(-) diff --git a/CodeWalker.Core/GameFiles/FileTypes/YndFile.cs b/CodeWalker.Core/GameFiles/FileTypes/YndFile.cs index 6741a48..d1196c1 100644 --- a/CodeWalker.Core/GameFiles/FileTypes/YndFile.cs +++ b/CodeWalker.Core/GameFiles/FileTypes/YndFile.cs @@ -1,11 +1,10 @@ -using SharpDX; +using CodeWalker.World; +using SharpDX; using System; using System.Collections.Generic; using System.ComponentModel; -using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Xml; namespace CodeWalker.GameFiles @@ -27,6 +26,9 @@ namespace CodeWalker.GameFiles public Vector3 BBMax { get; set; } public int CellX { get; set; } public int CellY { get; set; } + + public bool ShouldRecalculateIndices { get; set; } + public int AreaID { get @@ -115,6 +117,7 @@ namespace CodeWalker.GameFiles { if (BuildStructsOnSave) { + RecalculateNodeIndices(); BuildStructs(); } @@ -163,7 +166,7 @@ namespace CodeWalker.GameFiles //LinkCount = node.LinkCountFlags.Value >> 3; //LinkCountUnk = node.LinkCountFlags.Value & 7; - byte lcflags = (byte)((node.LinkCount << 3) + (node.LinkCountUnk & 7)); + byte lcflags = (byte)((node.LinkCount << 3) | (node.LinkCountUnk & 7)); node._RawData.LinkCountFlags = lcflags; nodes[i] = node.RawData; @@ -259,7 +262,7 @@ namespace CodeWalker.GameFiles YndNode yn = new YndNode(); Node n = new Node(); n.AreaID = (ushort)AreaID; - n.NodeID = (ushort)cnt; + n.NodeID = (ushort)(Nodes?.Length ?? 0); yn.Init(this, n); int ncnt = cnt + 1; @@ -272,93 +275,141 @@ namespace CodeWalker.GameFiles Nodes = nnodes; NodeDictionary.NodesCount = (uint)ncnt; + ShouldRecalculateIndices = true; + return yn; } - public bool RemoveNode(YndNode node) + public void MigrateNode(YndNode node) { - List newnodes = new List(); int cnt = Nodes?.Length ?? 0; - bool r = false; - int ri = -1; + node.Ynd = this; + node.AreaID = (ushort)AreaID; + node.NodeID = (ushort)(Nodes?.Length ?? 0); + + int ncnt = cnt + 1; + YndNode[] nnodes = new YndNode[ncnt]; for (int i = 0; i < cnt; i++) { - var tn = Nodes[i]; - if (tn != node) - { - newnodes.Add(tn); - } - else - { - r = true; - ri = i; - } + nnodes[i] = Nodes[i]; } - Nodes = newnodes.ToArray(); - NodeDictionary.NodesCount = (uint)newnodes.Count; - NodeDictionary.NodesCountVehicle = Math.Min(NodeDictionary.NodesCountVehicle, NodeDictionary.NodesCount); - NodeDictionary.NodesCountPed = Math.Min(NodeDictionary.NodesCountPed, NodeDictionary.NodesCount); + nnodes[cnt] = node; + Nodes = nnodes; + NodeDictionary.NodesCount = (uint)ncnt; - //remap node ID's... - List remlinks = new List(); - if (ri >= 0) + var links = new List(); + if (Links != null) { - for (int i = 0; i < Nodes.Length; i++) - { - var n = Nodes[i]; - if (n.NodeID != i) - { - n.NodeID = (ushort)i; - - - //update nodeid's in links... - for (int j = 0; j < Nodes.Length; j++) - { - var tn = Nodes[j]; - if ((tn != null) && (tn.Links != null)) - { - for (int bl = 0; bl < tn.Links.Length; bl++) - { - var backlink = tn.Links[bl]; - if (backlink.Node2 == n) - { - backlink._RawData.NodeID = (ushort)i; - } - } - } - } - } - - //remove any links referencing the node. - remlinks.Clear(); - if (n.Links != null) - { - for (int l = 0; l < n.Links.Length; l++) - { - var nlink = n.Links[l]; - if (nlink.Node2 == node) - { - remlinks.Add(nlink); - } - } - for (int l = 0; l < remlinks.Count; l++) - { - n.RemoveLink(remlinks[l]); - } - } - - } - + links.AddRange(Links); } - UpdateAllNodePositions(); + if (node.Links != null) + { + foreach (var nodeLink in node.Links) + { + links.Add(nodeLink); + } + } - return r; + Links = links.ToArray(); + + ShouldRecalculateIndices = true; } + public bool RemoveNode(YndNode node, bool removeLinks) + { + var nodes = Nodes.Where(n => n.AreaID != node.AreaID || n.NodeID != node.NodeID).ToArray(); + Nodes = nodes; + NodeDictionary.NodesCount = (uint)nodes.Count(); + if (removeLinks) + { + RemoveLinksForNode(node); + } + ShouldRecalculateIndices = true; + + return true; + } + + public void RecalculateNodeIndices() + { + if (!ShouldRecalculateIndices) + { + return; + } + + if (Nodes == null) + { + return; + } + // Sort nodes so ped nodes are at the end + var nodes = new List(Nodes.Length); + var affectedNodesList = new List(); + var vehicleNodes = Nodes.Where(n => !n.IsPedNode).OrderBy(n => n.NodeID).ToArray(); + var pedNodes = Nodes.Where(n => n.IsPedNode).OrderBy(n => n.NodeID).ToArray(); + + nodes.AddRange(vehicleNodes); + nodes.AddRange(pedNodes); + + for (var i = 0; i < nodes.Count(); i++) + { + var node = nodes[i]; + + if (node.NodeID != i) + { + node.NodeID = (ushort)i; + affectedNodesList.Add(node); + } + } + + NodeDictionary.NodesCountVehicle = (uint)vehicleNodes.Count(); + NodeDictionary.NodesCountPed = (uint)pedNodes.Count(); + NodeDictionary.NodesCount = NodeDictionary.NodesCountVehicle + NodeDictionary.NodesCountPed; + Nodes = nodes.ToArray(); + + UpdateAllNodePositions(); + ShouldRecalculateIndices = false; + } + + /// + /// Removes links for node. + /// + /// node to check against. + /// indicating whether this file has been affected + public bool RemoveLinksForNode(YndNode node) + { + // Delete links that target this node + var rmLinks = new List(); + + foreach (var n in Nodes) + { + var nodeRmLinks = n.Links.Where(l => + l.Node1 == node || l.Node2 == node); + + var toRemove = n.Links.Where(rl => nodeRmLinks.Contains(rl)).ToArray(); + foreach (var rl in toRemove) + { + n.RemoveLink(rl); + } + + rmLinks.AddRange(nodeRmLinks); + } + + if (rmLinks.Any()) + { + Links = Links.Where(l => !rmLinks.Contains(l)).ToArray(); + return true; + } + + return false; + } + + public bool HasAnyLinksForNode(YndNode node) + { + return Links.Any(l => l.Node1 == node || l.Node2 == node); + } public void UpdateBoundingBox() { @@ -385,20 +436,17 @@ namespace CodeWalker.GameFiles NodePositions = np; } - public void UpdateTriangleVertices() + public void UpdateTriangleVertices(YndNode[] selectedNodes) { //note: called from space.BuildYndVerts() UpdateLinkTriangleVertices(); - - //UpdateJunctionTriangleVertices(); + UpdateJunctionTriangleVertices(selectedNodes); } private void UpdateLinkTriangleVertices() { //build triangles for the path links display - - int vc = 0; if (Links != null) { @@ -414,24 +462,28 @@ namespace CodeWalker.GameFiles { foreach (var node in Nodes) { + if (node.Links is null) + { + continue; + } + foreach (var link in node.Links) { var p0 = link.Node1?.Position ?? Vector3.Zero; var p1 = link.Node2?.Position ?? Vector3.Zero; - var diff = p1 - p0; - var dir = Vector3.Normalize(diff); + var dir = link.GetDirection(); var ax = Vector3.Cross(dir, Vector3.UnitZ); - float lanestot = link.LaneCountForward + link.LaneCountBackward; //float backfrac = Math.Min(Math.Max(link.LaneCountBackward / lanestot, 0.1f), 0.9f); //float lanewidth = 7.0f; //float inner = totwidth*(backfrac-0.5f); //float outer = totwidth*0.5f; - float lanewidth = node.IsPedNode ? 0.5f : 5.5f; + float lanewidth = link.GetLaneWidth(); + float inner = link.LaneOffset * lanewidth;// 0.0f; - float outer = inner + Math.Max(lanewidth * link.LaneCountForward, 0.5f); + float outer = inner + lanewidth * link.LaneCountForward; float totwidth = lanestot * lanewidth; float halfwidth = totwidth * 0.5f; @@ -477,93 +529,90 @@ namespace CodeWalker.GameFiles } } - private void UpdateJunctionTriangleVertices() + private void UpdateJunctionTriangleVertices(YndNode[] selectedNodes) { - //build triangles for the junctions bytes display.... - - int vc = 0; - if (Junctions != null) + if (selectedNodes == null) { - foreach (var j in Junctions) - { - var d = j.Heightmap; - if (d == null) continue; - vc += d.CountX * d.CountY * 6; - } + return; } - List verts = new List(vc); + //build triangles for the junctions bytes display.... + List verts = new List(); EditorVertex v0 = new EditorVertex(); EditorVertex v1 = new EditorVertex(); EditorVertex v2 = new EditorVertex(); EditorVertex v3 = new EditorVertex(); - if (Nodes != null) + + foreach (var node in selectedNodes) { - foreach (var node in Nodes) + if (node.Ynd != this) continue; + if (node.Junction == null) continue; + var j = node.Junction; + var d = j.Heightmap; + if (d == null) continue; + + float maxz = j.MaxZ / 32.0f; + float minz = j.MinZ / 32.0f; + float rngz = maxz - minz; + float posx = j.PositionX / 4.0f; + float posy = j.PositionY / 4.0f; + + Vector3 pos = new Vector3(posx, posy, 0.0f); + Vector3 siz = new Vector3(d.CountX, d.CountY, 0.0f) * 2.0f; + //Vector3 siz = new Vector3(jx, jy, 0.0f); + Vector3 cnr = pos;// - siz * 0.5f; + //Vector3 inc = new Vector3(1.0f/jx) + + cnr.Z = minz;// + 2.0f; + + for (int y = 1; y < d.CountY; y++) //rows progress up the Y axis. { - if (node.Junction == null) continue; - var j = node.Junction; - var d = j.Heightmap; - if (d == null) continue; + var row0 = d.Rows[y - 1]; + var row1 = d.Rows[y]; + float offy = y * 2.0f; - float maxz = j.MaxZ / 32.0f; - float minz = j.MinZ / 32.0f; - float rngz = maxz - minz; - float posx = j.PositionX / 4.0f; - float posy = j.PositionY / 4.0f; - - Vector3 pos = new Vector3(posx, posy, 0.0f); - Vector3 siz = new Vector3(d.CountX, d.CountY, 0.0f) * 2.0f; - //Vector3 siz = new Vector3(jx, jy, 0.0f); - Vector3 cnr = pos;// - siz * 0.5f; - //Vector3 inc = new Vector3(1.0f/jx) - - cnr.Z = minz;// + 2.0f; - - for (int y = 1; y < d.CountY; y++) //rows progress up the Y axis. + for (int x = 1; x < d.CountX; x++) //values progress along the X axis. { - var row0 = d.Rows[y - 1]; - var row1 = d.Rows[y]; - float offy = y * 2.0f; - - for (int x = 1; x < d.CountX; x++) //values progress along the X axis. - { - var val0 = row0.Values[x - 1] / 255.0f; - var val1 = row0.Values[x] / 255.0f; - var val2 = row1.Values[x - 1] / 255.0f; - var val3 = row1.Values[x] / 255.0f; - float offx = x * 2.0f; - v0.Position = cnr + new Vector3(offx - 2.0f, offy - 2.0f, val0 * rngz); - v1.Position = cnr + new Vector3(offx + 0.0f, offy - 2.0f, val1 * rngz); - v2.Position = cnr + new Vector3(offx - 2.0f, offy + 0.0f, val2 * rngz); - v3.Position = cnr + new Vector3(offx + 0.0f, offy + 0.0f, val3 * rngz); - v0.Colour = (uint)new Color4(val0, 1.0f - val0, 0.0f, 1.0f).ToRgba(); - v1.Colour = (uint)new Color4(val1, 1.0f - val1, 0.0f, 1.0f).ToRgba(); - v2.Colour = (uint)new Color4(val2, 1.0f - val2, 0.0f, 1.0f).ToRgba(); - v3.Colour = (uint)new Color4(val3, 1.0f - val3, 0.0f, 1.0f).ToRgba(); - verts.Add(v0); - verts.Add(v1); - verts.Add(v2); - verts.Add(v2); - verts.Add(v1); - verts.Add(v3); - } + var val0 = row0.Values[x - 1] / 255.0f; + var val1 = row0.Values[x] / 255.0f; + var val2 = row1.Values[x - 1] / 255.0f; + var val3 = row1.Values[x] / 255.0f; + float offx = x * 2.0f; + v0.Position = cnr + new Vector3(offx - 2.0f, offy - 2.0f, val0 * rngz); + v1.Position = cnr + new Vector3(offx + 0.0f, offy - 2.0f, val1 * rngz); + v2.Position = cnr + new Vector3(offx - 2.0f, offy + 0.0f, val2 * rngz); + v3.Position = cnr + new Vector3(offx + 0.0f, offy + 0.0f, val3 * rngz); + v0.Colour = (uint)new Color4(val0, 1.0f - val0, 0.0f, 0.3f).ToRgba(); + v1.Colour = (uint)new Color4(val1, 1.0f - val1, 0.0f, 0.3f).ToRgba(); + v2.Colour = (uint)new Color4(val2, 1.0f - val2, 0.0f, 0.3f).ToRgba(); + v3.Colour = (uint)new Color4(val3, 1.0f - val3, 0.0f, 0.3f).ToRgba(); + verts.Add(v0); + verts.Add(v1); + verts.Add(v2); + verts.Add(v2); + verts.Add(v1); + verts.Add(v3); } - - } } - + if (verts.Count > 0) { - TriangleVerts = verts.ToArray(); + var vertsarr = verts.ToArray(); + if (TriangleVerts != null) + { + var nvc = vertsarr.Length; + var tvc = TriangleVerts.Length; + var newTriangles = new EditorVertex[tvc + nvc]; + Array.Copy(TriangleVerts, newTriangles, tvc); + Array.Copy(vertsarr, 0, newTriangles, tvc, nvc); + TriangleVerts = newTriangles; + } + else + { + TriangleVerts = vertsarr; + } } - else - { - TriangleVerts = null; - } - - } @@ -615,12 +664,68 @@ namespace CodeWalker.GameFiles + + public YndNode AddYndNode(Space space, out YndFile[] affectedFiles) + { + + var n = AddNode(); + + affectedFiles = space.GetYndFilesThatDependOnYndFile(this); + return n; + } + + public bool RemoveYndNode(Space space, YndNode node, bool removeLinks, out YndFile[] affectedFiles) + { + var totalAffectedFiles = new List(); + if (RemoveNode(node, removeLinks)) + { + if (removeLinks) + { + node.RemoveYndLinksForNode(space, out var affectedFilesFromLinkChanges); + totalAffectedFiles.AddRange(affectedFilesFromLinkChanges); + + } + + totalAffectedFiles.AddRange(space.GetYndFilesThatDependOnYndFile(this)); + affectedFiles = totalAffectedFiles.Distinct().ToArray(); + return true; + } + + affectedFiles = Array.Empty(); + return false; + } + + + + + public override string ToString() { return RpfFileEntry?.ToString() ?? string.Empty; } } + public enum YndNodeSpeed + { + Slow = 0, + Normal = 1, + Fast = 2, + Faster = 3 + } + + public enum YndNodeSpecialType + { + None = 0, + ParkingSpace = 2, + PedNodeRoadCrossing = 10, + PedNodeAssistedMovement = 14, + TrafficLightJunctionStop = 15, + StopSign = 16, + Caution = 17, + PedRoadCrossingNoWait = 18, + EmergencyVehiclesOnly = 19, + OffRoadJunction = 20 + } [TypeConverter(typeof(ExpandableObjectConverter))] public class YndNode : BasePathNode { @@ -649,15 +754,142 @@ namespace CodeWalker.GameFiles public bool HasJunction; - public bool IsPedNode + public YndNodeSpeed Speed { get { - return false;// ((Flags4.Value >> 4) & 7) == 7; + return (YndNodeSpeed)((LinkCountUnk >> 1) & 3); + } + set + { + LinkCountUnk = (LinkCountUnk &~ 6) | (((int)value & 3) << 1); } } + //// Flag0 Properties + public bool OffRoad + { + get => (Flags0 & 8) > 0; + set => Flags0 = (byte)(value ? Flags0 | 8 : Flags0 &~ 8); + } + public bool NoBigVehicles + { + get => (Flags0.Value & 32) > 0; + set => Flags0 = (byte)(value ? Flags0 | 32 : Flags0 &~ 32); + } + public bool CannotGoLeft + { + get => (Flags0.Value & 128) > 0; + set => Flags0 = (byte)(value ? Flags0 | 128 : Flags0 &~ 32); + } + // Flag1 Properties + public bool SlipRoad + { + get => (Flags1 & 1) > 0; + set => Flags1 = (byte)(value ? Flags1 | 1 : Flags1 &~ 1); + } + public bool IndicateKeepLeft + { + get => (Flags1 & 2) > 0; + set => Flags1 = (byte)(value ? Flags1 | 2 : Flags1 &~ 2); + } + public bool IndicateKeepRight + { + get => (Flags1 & 4) > 0; + set => Flags1 = (byte)(value ? Flags1 | 4 : Flags1 &~ 4); + } + public YndNodeSpecialType Special + { + /// + /// Special type is the last 5 bits in Flags1. I cannot see a flag pattern here. + /// I suspect this to be an enum. Especially since this attribute appears as an int + /// in the XML file + /// + /// Known Special Types: + /// Normal = 0, Most nodes + /// ParkingSpace? = 2, Only 4 on the map as far as I can see. Probably useless. + /// PedCrossRoad = 10, Any pedestrian crossing where vehicles have priority. Traffic light crossings etc. + /// PedNode = 14, + /// TrafficLightStopNode = 15, + /// StopJunctionNode = 16, + /// Caution (Slow Down)? = 17, Appears before barriers, and merges + /// PedCrossRoadWithPriority? = 18, Appears in off-road crossings + /// EmergencyVehiclesOnly? = 19, Appears in the airport entrance, the airbase, and the road where the house falls down. Probably to stop all nav. + /// OffRoadJunctionNode? = 20 Appears on a junction node with more than one edge where there is an off-road connection. + /// + get => (YndNodeSpecialType)(Flags1.Value >> 3); + set => Flags1 = (byte)((Flags1 &~0xF8) | ((byte)value << 3)); + } + + // Flag2 Properties + public bool NoGps + { + get => (Flags2.Value & 1) > 0; + set => Flags2 = (byte)(value ? Flags2 | 1 : Flags2 &~ 1); + } + public bool IsJunction + { + get => (Flags2.Value & 4) > 0; + set => Flags2 = (byte)(value ? Flags2 | 4 : Flags2 &~ 4); + } + public bool Highway + { + get => (Flags2.Value & 64) > 0; + set => Flags2 = (byte)(value ? Flags2 | 64 : Flags2 &~ 64); + } + public bool IsDisabledUnk0 // This seems to be heuristic based. A node being "disabled" does not mean that a vehicle will not travel through it. + { + get => (Flags2.Value & 128) > 0; + set => Flags2 = (byte)(value ? Flags2 | 128 : Flags2 &~ 128); + } + public bool IsDisabledUnk1 + { + get { return (Flags2.Value & 16) > 0; } + set => Flags2 = (byte)(value ? Flags2 | 16 : Flags2 &~ 16); + } + + // Flag3 Properties + public bool Tunnel + { + get { return (Flags3 & 1) > 0; } + set => Flags3 = (byte)(value ? Flags3 | 1 : Flags3 &~ 1); + } + public int HeuristicValue + { + /// + /// The heuristic value takes up the rest of Flags3. + /// It is a 7 bit integer, ranging from 0 to 127 + /// For each node edge, it seems to add the FLOOR(DISTANCE(vTargetPos, vSourcePos)). + /// This is not 100% accurate with road merges etc (as is the nature of heuristics). + /// You'll see perfect accuracy in single lane roads, like alleys. + /// + get => Flags3.Value >> 1; + set => Flags3 = (byte)((Flags3 &~0xFE) | (value << 1)); + } + + // Flag4 Properties + public int Density // The first 4 bits of Flag4 is the density of the node. This ranges from 0 to 15. + { + get => Flags4.Value & 15; + set => Flags4 = (byte)((Flags4 &~ 15) | (value & 15)); + } + public int DeadEndness + { + get => Flags4.Value & 112; + set => Flags4 = (byte)((Flags4 & ~ 112) | (value & 112)); + } + public bool LeftTurnsOnly + { + get => (Flags1 & 128) > 0; + set => Flags1 = (byte)(value ? Flags1 | 128 : Flags1 &~ 128); + } + + public static bool IsSpecialTypeAPedNode(YndNodeSpecialType specialType) + => specialType == YndNodeSpecialType.PedNodeRoadCrossing + || specialType == YndNodeSpecialType.PedNodeAssistedMovement + || specialType == YndNodeSpecialType.PedRoadCrossingNoWait; + public bool IsPedNode => IsSpecialTypeAPedNode(Special);// If Special is 10, 14 or 18 this is a ped node. public void Init(YndFile ynd, Node node) @@ -679,106 +911,22 @@ namespace CodeWalker.GameFiles public Color4 GetColour() { - Color4 c = new Color4(LinkCountUnk / 7.0f, Flags0.Value / 255.0f, Flags1.Value / 255.0f, 1.0f); - //Color4 c = new Color4(0.0f, 0.0f, 0.0f, 1.0f); + if (IsDisabledUnk0 || IsDisabledUnk1) + { + return new Color4(1.0f, 0.0f, 0.0f, 0.5f); + } - //c.Red = (LinkCountUnk >> 1) / 3.0f; - //c.Red = (Flags3.Value >> 1) / 127.0f; - //c.Red = ((Flags4.Value >> 1) & 7) / 7.0f; //density value? - //c.Green = 1.0f - c.Red; + if (IsPedNode) + { + return new Color4(1.0f, 0.0f, 1.0f, 0.5f); + } + if (Tunnel) + { + return new Color4(0.3f, 0.3f, 0.3f, 0.5f); + } - //if ((Flags0.Value & 1) > 0) c.Red += 1.0f; //script activated? N Yankton only + small piece in self storage - //if ((Flags0.Value & 2) > 0) c.Red += 1.0f; //car can use / gps? - //if ((Flags0.Value & 4) > 0) c.Red += 1.0f; //***not used - //if ((Flags0.Value & 8) > 0) c.Red += 1.0f; //gravel surface? country roads mostly - //if ((Flags0.Value & 16) > 0) c.Red += 1.0f; //***not used - //if ((Flags0.Value & 32) > 0) c.Red += 1.0f; //slow speed? hills roads, prison boundary, carparks, airport roads etc - //if ((Flags0.Value & 64) > 0) c.Red += 1.0f; //intersection entry 1 (has priority)? - //if ((Flags0.Value & 128) > 0) c.Green += 1.0f; //intersection entry 2 unk? - - //if ((Flags1.Value & 1) > 0) c.Red += 1.0f; //left turn lane? - //if ((Flags1.Value & 2) > 0) c.Red += 1.0f; //left turn node of no return - //if ((Flags1.Value & 4) > 0) c.Red += 1.0f; //right turn node of no return - //if ((Flags1.Value & 8) > 0) c.Red += 1.0f; //entry for traffic lights / boom gates etc - //if ((Flags1.Value & 16) > 0) c.Red += 1.0f; //entry for traffic lights / boom gates etc + peds crossing - //if ((Flags1.Value & 32) > 0) c.Red += 1.0f; //intersection entry 3 unk? - //if ((Flags1.Value & 64) > 0) c.Red += 1.0f; //entry for traffic lights / boom gates etc + peds crossing - //if ((Flags1.Value & 128) > 0) c.Red += 1.0f; //intersection minor/stop, T? - - ////[16 bits pos Z here] - - //if ((Flags2.Value & 1) > 0) c.Red += 1.0f; //slow traffic? peds? carparks? military? GPS disable routing?? - //if ((Flags2.Value & 2) > 0) c.Red += 1.0f; //***not used - //if ((Flags2.Value & 4) > 0) c.Red += 1.0f; //intersection decision? - //if ((Flags2.Value & 8) > 0) c.Red += 1.0f; //***not used - //if ((Flags2.Value & 16) > 0) c.Red += 1.0f; //slower traffic? - //if ((Flags2.Value & 32) > 0) c.Red += 1.0f; //water/boat - //if ((Flags2.Value & 64) > 0) c.Red += 1.0f; //freeways /peds? - //if ((Flags2.Value & 128) > 0) c.Red += 1.0f; //not a main road...? - - //if ((LinkCountUnk & 1) > 0) c.Red += 1.0f; //has junction heightmap - //if ((LinkCountUnk & 2) > 0) c.Red += 1.0f; //speed/density/type related? not runways, not freeways - //if ((LinkCountUnk & 4) > 0) c.Red += 1.0f; //higher speed? eg freeway - ////[5 bits LinkCount here] - - //if ((Flags3.Value & 1) > 0) c.Red += 1.0f; //is in an interior - //if ((Flags3.Value & 2) > 0) c.Red += 1.0f; //heuristic val? - //if ((Flags3.Value & 4) > 0) c.Red += 1.0f; //heuristic val? - //if ((Flags3.Value & 8) > 0) c.Red += 1.0f; //heuristic val? - //if ((Flags3.Value & 16) > 0) c.Red += 1.0f; //heuristic val? - //if ((Flags3.Value & 32) > 0) c.Red += 1.0f; //heuristic val? - //if ((Flags3.Value & 64) > 0) c.Red += 1.0f; //heuristic val? - //if ((Flags3.Value & 128) > 0) c.Red += 1.0f; //heuristic val? - - //if ((Flags4.Value & 1) > 0) c.Red += 1.0f; //slow traffic? - //if ((Flags4.Value & 2) > 0) c.Red += 1.0f; //density/popgroup value..? - //if ((Flags4.Value & 4) > 0) c.Green += 1.0f; //density/popgroup value..? - //if ((Flags4.Value & 8) > 0) c.Blue += 1.0f; //density/popgroup value..? - //if ((Flags4.Value & 16) > 0) c.Red += 1.0f; //special/peds path? - //if ((Flags4.Value & 32) > 0) c.Green += 1.0f; //special/peds path? - //if ((Flags4.Value & 64) > 0) c.Blue += 1.0f; //special/peds path? - //if ((Flags4.Value & 128) > 0) c.Blue += 1.0f; //intersection entry left turn? - - - - - - - ////regarding paths.xml: - ////rubidium - Today at 8:37 AM - //also, quick glimpse over the xml for attributes: - ////> grep - i "attribute name" paths.xml | awk - F'^"' ' { print $2 }' | sort - u - //Block If No Lanes - //Cannot Go Left - //Cannot Go Right - //Density - //Disabled - //Dont Use For Navigation - //GpsBothWays - //Highway - //Indicate Keep Left - //Indicate Keep Right - //Lanes In - //Lanes Out - //Left Turns Only - //Narrowroad - //No Big Vehicles - //NoGps - //Off Road - //Shortcut - //Slip Lane - //Special - //Speed - //Streetname - //Tunnel - //Water - //Width - - - - - return c; + return new Color4(LinkCountUnk / 7.0f, Flags0.Value / 255.0f, Flags1.Value / 255.0f, 0.5f); } @@ -795,6 +943,7 @@ namespace CodeWalker.GameFiles Position = newpos; UpdateLinkLengths(); + RecalculateHeuristic(); } @@ -820,9 +969,63 @@ namespace CodeWalker.GameFiles } } - - public YndLink AddLink(YndNode tonode = null) + public void RecalculateHeuristic() { + var link = Links?.FirstOrDefault(l => l.LaneCountBackward > 0); + if (link is null) + { + HeuristicValue = 0; + return; + } + + var partner = link.Node1 == this + ? link.Node2 + : link.Node1; + + var length = link.LinkLength; + + HeuristicValue = partner.HeuristicValue + length; + } + + public void CheckIfJunction() + { + if (Links == null) + { + IsJunction = false; + return; + } + + // If this is a 3 node junction (4 including itself) + IsJunction = Links + .Where(l => !l.Shortcut) + .SelectMany(l => new[] { l.Node1, l.Node2 }).Distinct().Count() > 3; + + if (!IsJunction && Special == YndNodeSpecialType.OffRoadJunction) + { + Special = YndNodeSpecialType.None; + } + + if (IsJunction && Special == YndNodeSpecialType.None || Special == YndNodeSpecialType.OffRoadJunction) + { + var hasOffroadLink = Links.Any(l => l.Node2.OffRoad); + Special = hasOffroadLink ? YndNodeSpecialType.OffRoadJunction : YndNodeSpecialType.None; + } + } + + + public YndLink AddLink(YndNode tonode = null, bool bidirectional = true) + { + if (Links == null) + { + Links = Array.Empty(); + } + + var existing = Links.FirstOrDefault(el => el.Node2 == tonode); + if (existing != null) + { + return existing; + } + YndLink l = new YndLink(); l._RawData.AreaID = AreaID; l.Node1 = this; @@ -854,9 +1057,32 @@ namespace CodeWalker.GameFiles Links = nlinks; LinkCount = ncnt; + if (bidirectional) + { + tonode?.AddLink(this, false); + } + + RecalculateHeuristic(); + CheckIfJunction(); + return l; } + public bool TryGetLinkForNode(YndNode node, out YndLink link) + { + for (int i = 0; i < Links.Length; i++) + { + if (Links[i].Node2 == node) + { + link = Links[i]; + return true; + } + } + + link = null; + return false; + } + public bool RemoveLink(YndLink l) { List newlinks = new List(); @@ -876,9 +1102,189 @@ namespace CodeWalker.GameFiles } Links = newlinks.ToArray(); LinkCount = newlinks.Count; + + RecalculateHeuristic(); + CheckIfJunction(); return r; } + public void FloodCopyFlags(out YndFile[] affectedFiles) + { + FloodCopyFlags(this, new List(), out affectedFiles); + } + + private void FloodCopyFlags(YndNode basis, List seenNodes, out YndFile[] affectedFiles) + { + var affectedFilesList = new List(); + if (Links == null || !Links.Any()) + { + affectedFiles = Array.Empty(); + return; + } + + if (seenNodes.Contains(this)) + { + affectedFiles = Array.Empty(); + return; + } + + seenNodes.Add(this); + if (basis != this && !IsJunction) + { + Flags0 = basis.Flags0; + Flags1 = basis.Flags1; + Flags2 = basis.Flags2; + Flags3 = basis.Flags3; + Flags4 = basis.Flags4; + LinkCountUnk = (LinkCountUnk &~ 7) | (basis.LinkCountUnk & 7); + + affectedFilesList.Add(Ynd); + RecalculateHeuristic(); + } + + CheckIfJunction(); + + if (!IsJunction) + { + foreach (var yndLink in Links) + { + if (yndLink.Shortcut) + { + continue; + } + + yndLink.Node1.FloodCopyFlags(basis, seenNodes, out var node1Files); + yndLink.Node2.FloodCopyFlags(basis, seenNodes, out var node2Files); + + affectedFilesList.AddRange(node1Files); + affectedFilesList.AddRange(node2Files); + } + } + + affectedFiles = affectedFilesList.Distinct().ToArray(); + } + + + + + + public void SetYndNodePosition(Space space, Vector3 newPosition, out YndFile[] affectedFiles) + { + var totalAffectedFiles = new List(); + + if (Links != null) + { + totalAffectedFiles.AddRange(Links.SelectMany(l => new[] { l.Node1.Ynd, l.Node2.Ynd }).Distinct()); + } + + var oldPosition = Position; + SetPosition(newPosition); + var expectedArea = space.NodeGrid.GetCellForPosition(newPosition); + + if (AreaID != expectedArea.ID) + { + var nodeYnd = space.NodeGrid.GetCell(AreaID).Ynd; + var newYnd = expectedArea.Ynd; + if (newYnd == null) + { + SetPosition(oldPosition); + affectedFiles = Array.Empty(); + return; + } + + if ((nodeYnd == null) || + nodeYnd.RemoveYndNode(space, this, false, out var affectedFilesFromDelete)) + { + totalAffectedFiles.Add(nodeYnd); + newYnd.MigrateNode(this); + totalAffectedFiles.AddRange(space.GetYndFilesThatDependOnYndFile(nodeYnd)); + totalAffectedFiles.AddRange(space.GetYndFilesThatDependOnYndFile(Ynd)); + } + } + + affectedFiles = totalAffectedFiles.Distinct().ToArray(); + } + + public void RemoveYndLinksForNode(Space space, out YndFile[] affectedFiles) + { + List files = new List(); + + foreach (var yndFile in space.GetYndFilesThatDependOnYndFile(Ynd)) + { + if (yndFile.RemoveLinksForNode(this)) + { + files.Add(yndFile); + } + } + + affectedFiles = files.ToArray(); + } + + public void GenerateYndNodeJunctionHeightMap(Space space) + { + if (Junction == null) + { + Junction = new YndJunction(); + } + + var junc = Junction; + var maxZ = junc.MaxZ / 32f; + var minZ = junc.MinZ / 32f; + var xStart = junc.PositionX / 4f; + var yStart = junc.PositionY / 4f; + var sizeX = junc._RawData.HeightmapDimX; + var sizeY = junc._RawData.HeightmapDimY; + + var start = new Vector3(xStart, yStart, maxZ); + var layers = new[] { true, false, false }; + + var maxDist = maxZ - minZ; + + var t = new StringBuilder(); + + var sb = new StringBuilder(); + + for (int y = 0; y < sizeY; y++) + { + var offy = y * 2.0f; + + for (int x = 0; x < sizeX; x++) + { + var offx = x * 2.0f; + var result = space.RayIntersect(new Ray(start + new Vector3(offx, offy, 0f), new Vector3(0f, 0f, -1f)), maxDist, layers); + + var p = start + new Vector3(offx, offy, 0f); + //t.AppendLine($"{p.X}, {p.Y}, {p.Z}"); + + if (!result.Hit) + { + sb.Append("000 "); + continue; + } + + t.AppendLine($"{result.Position.X}, {result.Position.Y}, {result.Position.Z}"); + + var height = Math.Min(Math.Max(result.Position.Z, minZ), maxZ); + var actualDist = (byte)((height - minZ) / maxDist * 255); + sb.Append(actualDist); + sb.Append(' '); + } + + // Remove trailing space + sb.Remove(sb.Length - 1, 1); + sb.AppendLine(); + } + + // Remove trailing new line + sb.Remove(sb.Length - 1, 1); + + var tt = t.ToString(); + + junc.SetHeightmap(sb.ToString()); + } + + + public override string ToString() { @@ -891,7 +1297,18 @@ namespace CodeWalker.GameFiles { public YndFile Ynd { get; set; } public YndNode Node1 { get; set; } - public YndNode Node2 { get; set; } + + private YndNode _node2; + public YndNode Node2 + { + get => _node2; + set + { + _node2 = value; + UpdateTargetIndex(); + } + } + public NodeLink _RawData; public NodeLink RawData { get { return _RawData; } set { _RawData = value; } } public FlagsByte Flags0 { get { return _RawData.Flags0; } set { _RawData.Flags0 = value; } } @@ -899,13 +1316,37 @@ namespace CodeWalker.GameFiles public FlagsByte Flags2 { get { return _RawData.Flags2; } set { _RawData.Flags2 = value; } } public FlagsByte LinkLength { get { return _RawData.LinkLength; } set { _RawData.LinkLength = value; } } - public int LaneCountForward { get { return (Flags2.Value >> 5) & 7; } } - public int LaneCountBackward { get { return (Flags2.Value >> 2) & 7; } } + public int LaneCountForward + { + get => (Flags2.Value >> 5) & 7; + set => Flags2 = (byte)((Flags2 &~0xE0) | ((value & 7) << 5)); + } + + public int LaneCountBackward + { + get => (Flags2.Value >> 2) & 7; + set => Flags2 = (byte)((Flags2 &~0x1C) | ((value & 7) << 2)); + } + + public int OffsetValue + { + get => (Flags1.Value >> 4) & 7; + set => Flags2 = (byte)((Flags2 & ~0x70) | ((value & 7) << 4)); + } - public int OffsetValue { get { return (Flags1.Value >> 4) & 7; } } public bool NegativeOffset { get { return (Flags1.Value >> 7) > 0; } } public float LaneOffset { get { return (OffsetValue / 7.0f) * (NegativeOffset ? -0.5f : 0.5f); } } + public bool GpsBothWays { get { return (Flags0 & 1) > 0; } } + public bool NarrowRoad { get { return (Flags1 & 2) > 0; } } + public bool DontUseForNavigation { get { return (Flags2 & 1) > 0; } } + + public bool Shortcut + { + get { return (Flags2 & 2) > 0; } + set => Flags2 = value ? (byte)(Flags2 | 2) : (byte)(Flags2 &~ 2); + } + public void Init(YndFile ynd, YndNode node1, YndNode node2, NodeLink link) { @@ -931,70 +1372,143 @@ namespace CodeWalker.GameFiles Flags0 = link.Flags0; Flags1 = link.Flags1; Flags2 = link.Flags2; + + CheckIfJunction(); } + public bool IsTwoWay() + { + return LaneCountForward > 0 && LaneCountBackward > 0; + } + public void SetForwardLanesBidirectionally(int value) + { + LaneCountForward = value; + + if (Node2.TryGetLinkForNode(Node1, out var node2Link)) + { + node2Link.LaneCountBackward = value; + } + + CheckIfJunction(); + } + + public void SetBackwardLanesBidirectionally(int value) + { + LaneCountBackward = value; + + if (Node2.TryGetLinkForNode(Node1, out var node2Link)) + { + node2Link.LaneCountForward = value; + } + + CheckIfJunction(); + } + + public void CheckIfJunction() + { + Node1?.CheckIfJunction(); + Node2?.CheckIfJunction(); + } public Color4 GetColour() { - - //float f0 = Flags0.Value / 255.0f; //float f1 = Flags1.Value / 255.0f; //float f2 = Flags2.Value / 255.0f; //var c = new Color4(f0, f1, f2, 1.0f); var c = new Color4(0.0f, 0.0f, 0.0f, 0.5f); - c.Green = LaneCountForward / 7.0f; - c.Red = LaneCountBackward / 7.0f; + if (Shortcut) + { + c.Blue = 0.2f; + c.Green = 0.2f; + return c; + } - //if ((Flags0.Value & 1) > 0) c.Red = 1.0f; //? some small pieces in city, roads at docks, and mall at beach - //if ((Flags0.Value & 2) > 0) c.Red = 1.0f; //3x segments joining east canal paths to roads, also josh's driveway - scripted? - //if ((Flags0.Value & 4) > 0) c.Red = 1.0f; //? looks fairly random, 0 for water, alternating - slope related? - //if ((Flags0.Value & 8) > 0) c.Red = 1.0f; //? like above - //if ((Flags0.Value & 16) > 0) c.Red = 1.0f; //? similar to above, but less - //if ((Flags0.Value & 32) > 0) c.Red = 1.0f; //? like above - //if ((Flags0.Value & 64) > 0) c.Red = 1.0f; //? slightly less random - //if ((Flags0.Value & 128) > 0) c.Red = 1.0f; //? still looks random... + if (Node1.IsDisabledUnk0 + || Node1.IsDisabledUnk1 + || Node2.IsDisabledUnk0 + || Node2.IsDisabledUnk1) + { + if (Node1.OffRoad || Node2.OffRoad) + { + c.Red = 0.0196f; + c.Green = 0.0156f; + c.Blue = 0.0043f; + } + c.Red = 0.02f; + return c; + } - //if ((Flags1.Value & 1) > 0) c.Red = 1.0f; //***not used? - //if ((Flags1.Value & 2) > 0) c.Red = 1.0f; //?possibly width/type bit - //if ((Flags1.Value & 4) > 0) c.Red = 1.0f; //avoid routing? no through road / no other exit? - //if ((Flags1.Value & 8) > 0) c.Red = 1.0f; //prefer routing? exit from dead end? - //if ((Flags1.Value & 16) > 0) c.Red = 1.0f; //offset value. mostly single lane, carpark access, golf course, alleyways, driveways, beach area etc - //if ((Flags1.Value & 32) > 0) c.Green = 1.0f; //offset value. similar to above - //if ((Flags1.Value & 64) > 0) c.Green = 1.0f; //offset value. similar to above - //if ((Flags1.Value & 128) > 0) c.Red = 1.0f; //offset value. (sign) similar to above (all paired with their back links!) + if (Node1.IsPedNode || Node2.IsPedNode) + { + c.Red = 0.2f; + c.Green = 0.15f; + return c; + } - //if ((Flags2.Value & 1) > 0) c.Red = 1.0f; //angled link - merge? enter/exit divided road section, most big junctions, always paired - //if ((Flags2.Value & 2) > 0) c.Red = 1.0f; //lane change/u-turn link? always paired - //if ((Flags2.Value & 4) > 0) c.Red = 1.0f; //lane count back dir - //if ((Flags2.Value & 8) > 0) c.Red = 1.0f; //lane count back dir - //if ((Flags2.Value & 16) > 0) c.Red = 1.0f; //lane count back dir - //if ((Flags2.Value & 32) > 0) c.Green = 1.0f; //lane count forward dir - //if ((Flags2.Value & 64) > 0) c.Green = 1.0f; //lane count forward dir - //if ((Flags2.Value & 128) > 0) c.Green = 1.0f; //lane count forward dir + if (Node1.OffRoad || Node2.OffRoad) + { + c.Red = 0.196f; + c.Green = 0.156f; + c.Blue = 0.043f; + return c; + } - ////var lanesfwd = (Flags2.Value >> 5) & 7; - ////var lanesbck = (Flags2.Value >> 2) & 7; - //////if ((lanesfwd > 0) && (lanesbck > 0) && (lanesfwd != lanesbck)) - //////{ } - - - - //var t = (Flags1.Value >> 4)&1; - //c.Red = t / 1.0f; - //c.Green = 1.0f - c.Red; - ////if (((Flags1.Value & 128) > 0))// && ((Flags1.Value & 64) == 0)) - ////{ c.Red += 1.0f; } + if (DontUseForNavigation) + { + c.Blue = 0.2f; + c.Red = 0.2f; + return c; + } + if (LaneCountForward == 0) + { + c.Red = 0.5f; + return c; + } + c.Green = 0.2f; + return c; } + public float GetLaneWidth() + { + if (Shortcut || Node1.IsPedNode || Node2.IsPedNode) + { + return 0.5f; + } + if (DontUseForNavigation) + { + return 2.5f; + } + + if (NarrowRoad) + { + return 4.0f; + } + + return 5.5f; + } + + public Vector3 GetDirection() + { + var p0 = Node1?.Position ?? Vector3.Zero; + var p1 = Node2?.Position ?? Vector3.Zero; + var diff = p1 - p0; + return Vector3.Normalize(diff); + } + + public void UpdateTargetIndex() + { + _RawData.AreaID = Node2.AreaID; + _RawData.NodeID = Node2.NodeID; + } public override string ToString() { diff --git a/CodeWalker.Core/World/Space.cs b/CodeWalker.Core/World/Space.cs index 3de5658..c57dee8 100644 --- a/CodeWalker.Core/World/Space.cs +++ b/CodeWalker.Core/World/Space.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace CodeWalker.World { @@ -493,7 +492,13 @@ namespace CodeWalker.World } //string str = sb.ToString(); + } + public void PatchYndFile(YndFile ynd) + { + //ideally we should be able to revert to the vanilla ynd's after closing the project window, + //but codewalker can always just be restarted, so who cares really + NodeGrid.UpdateYnd(ynd); } private void AddRpfYnds(RpfFile rpffile, Dictionary yndentries) @@ -565,8 +570,9 @@ namespace CodeWalker.World ynd.Links = tlinks.ToArray(); } - public void BuildYndVerts(YndFile ynd, List tverts = null) + public void BuildYndVerts(YndFile ynd, YndNode[] selectedNodes, List tverts = null) { + var laneColour = (uint) new Color4(0f, 0f, 1f, 1f).ToRgba(); var ynodes = ynd.Nodes; if (ynodes == null) return; @@ -589,7 +595,18 @@ namespace CodeWalker.World for (int l = 0; l < node.Links.Length; l++) { YndLink yl = node.Links[l]; + var laneDir = yl.GetDirection(); + var laneDirCross = Vector3.Cross(laneDir, Vector3.UnitZ); + var laneWidth = yl.GetLaneWidth(); + var laneHalfWidth = laneWidth / 2; + var offset = yl.IsTwoWay() + ? yl.LaneOffset * laneWidth - laneHalfWidth + : yl.LaneOffset - yl.LaneCountForward * laneWidth / 2f + laneHalfWidth; + + var iOffset = yl.IsTwoWay() ? 1 : 0; + var tnode = yl.Node2; + if (tnode == null) continue; //invalid links could hit here var tvert = new EditorVertex(); tvert.Position = tnode.Position; @@ -597,12 +614,42 @@ namespace CodeWalker.World tverts.Add(nvert); tverts.Add(tvert); + + // Add lane display + for (int j = iOffset; j < yl.LaneCountForward + iOffset; j++) + { + var vertOffset = laneDirCross * (offset + laneWidth * j); + + vertOffset.Z = 0.1f; + var lvert1 = new EditorVertex + { + Position = nvert.Position + vertOffset, + Colour = laneColour + }; + + var lvert2 = new EditorVertex + { + Position = tvert.Position + vertOffset, + Colour = laneColour + }; + + tverts.Add(lvert1); + tverts.Add(lvert2); + + // Arrow + var apos = lvert1.Position + laneDir * yl.LinkLength / 2; + const float asize = 0.5f; + const float negasize = asize * -1f; + tverts.Add(new EditorVertex(){ Position = apos, Colour = laneColour}); + tverts.Add(new EditorVertex() { Position = apos + laneDir * negasize + laneDirCross * asize, Colour = laneColour }); + tverts.Add(new EditorVertex() { Position = apos, Colour = laneColour }); + tverts.Add(new EditorVertex() { Position = apos + laneDir * negasize + laneDirCross * negasize, Colour = laneColour }); + } } } ynd.LinkedVerts = tverts.ToArray(); - - ynd.UpdateTriangleVertices(); + ynd.UpdateTriangleVertices(selectedNodes); } public void BuildYndJuncs(YndFile ynd) { @@ -646,10 +693,65 @@ namespace CodeWalker.World BuildYndJuncs(ynd); - BuildYndVerts(ynd, tverts); + BuildYndVerts(ynd, null, tverts); } + public YndFile[] GetYndFilesThatDependOnYndFile(YndFile file) + { + return AllYnds.Values.Where(y => y.Links.Any(l => l.Node2.AreaID == file.AreaID)).ToArray(); + } + + public void MoveYndArea(YndFile ynd, int desiredX, int desiredY) + { + var xDir = Math.Min(1, Math.Max(-1, desiredX - ynd.CellX)); + var yDir = Math.Min(1, Math.Max(-1, desiredY - ynd.CellY)); + + var x = desiredX; + var y = desiredY; + + if (xDir != 0) + { + while (x >= 0 && x <= 31) + { + if (NodeGrid.Cells[x, y].Ynd == null) + { + break; + } + + x += xDir; + } + } + + if (yDir != 0) + { + while (y >= 0 && y <= 31) + { + if (NodeGrid.Cells[x, y].Ynd == null) + { + break; + } + + y += yDir; + } + } + + ynd.CellX = x; + ynd.CellY = y; + var areaId = y * 32 + x; + ynd.AreaID = areaId; + ynd.Name = $"nodes{areaId}"; + NodeGrid.UpdateYnd(ynd); + } + + public void RecalculateAllYndIndices() + { + foreach (var yndFile in AllYnds.Values) + { + yndFile.RecalculateNodeIndices(); + } + } + private void InitNavGrid() { @@ -993,6 +1095,11 @@ namespace CodeWalker.World for (int i = 0; i < items.Count; i++) { var item = items[i]; + if (item == null) + { + continue; + } + var hash = item.Name; if (!ymaps.ContainsKey(hash)) { @@ -1120,6 +1227,10 @@ namespace CodeWalker.World for (int i = 0; i < mapdatalist.Count; i++) { var mapdata = mapdatalist[i]; + if (mapdata == null) + { + continue; + } if ((mapdata.ContentFlags & 1) == 0) { continue; } //only test HD ymaps @@ -2020,6 +2131,19 @@ namespace CodeWalker.World return null; } + public SpaceNodeGridCell GetCellForPosition(Vector3 position) + { + var x = (int)((position.X - CornerX) / CellSize); + var y = (int)((position.Y - CornerY) / CellSize); + + if ((x >= 0) && (x < CellCountX) && (y >= 0) && (y < CellCountY)) + { + return Cells[x, y]; + } + + return null; + } + public YndNode GetYndNode(ushort areaid, ushort nodeid) { @@ -2031,6 +2155,23 @@ namespace CodeWalker.World return cell.Ynd.Nodes[nodeid]; } + public void UpdateYnd(YndFile ynd) + { + for (int xx = 0; xx < Cells.GetLength(0); xx++) + { + for (int yy = 0; yy < Cells.GetLength(1); yy++) + { + if (Cells[xx, yy].Ynd == ynd) + { + Cells[xx, yy].Ynd = null; + } + } + } + + var x = ynd.CellX; + var y = ynd.CellY; + Cells[x, y].Ynd = ynd; + } } public class SpaceNodeGridCell { diff --git a/CodeWalker/Project/Panels/EditMultiPanel.cs b/CodeWalker/Project/Panels/EditMultiPanel.cs index 0e9c203..cfd05e3 100644 --- a/CodeWalker/Project/Panels/EditMultiPanel.cs +++ b/CodeWalker/Project/Panels/EditMultiPanel.cs @@ -42,6 +42,7 @@ namespace CodeWalker.Project.Panels private void LoadItems() { MultiItem = new MapSelection(); + MultiItem.WorldForm = ProjectForm.WorldForm; MultiItem.Clear(); MultiItem.SetMultipleSelectionItems(Items); diff --git a/CodeWalker/Project/Panels/EditYndNodePanel.Designer.cs b/CodeWalker/Project/Panels/EditYndNodePanel.Designer.cs index a29f106..fa0b465 100644 --- a/CodeWalker/Project/Panels/EditYndNodePanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditYndNodePanel.Designer.cs @@ -31,19 +31,22 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditYndNodePanel)); this.PathNodeTabControl = new System.Windows.Forms.TabControl(); this.PathNodePropertiesTabPage = new System.Windows.Forms.TabPage(); + this.PathNodeEnableDisableButton = new System.Windows.Forms.Button(); + this.PathNodeFloodCopyButton = new System.Windows.Forms.Button(); + this.YndNodeIsPedNodeCheckBox = new System.Windows.Forms.CheckBox(); + this.PathNodeSpecialTypeComboBox = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); this.PathNodeFlags5GroupBox = new System.Windows.Forms.GroupBox(); - this.PathNodeFlags52CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags53CheckBox = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); + this.PathNodesSpeedComboBox = new System.Windows.Forms.ComboBox(); this.PathNodeFlags51CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeFlags5UpDown = new System.Windows.Forms.NumericUpDown(); this.PathNodeFlags4GroupBox = new System.Windows.Forms.GroupBox(); - this.PathNodeFlags45CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags46CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags47CheckBox = new System.Windows.Forms.CheckBox(); + this.PathNodeFlags44UpDown = new System.Windows.Forms.NumericUpDown(); + this.label3 = new System.Windows.Forms.Label(); this.PathNodeFlags48CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeFlags42UpDown = new System.Windows.Forms.NumericUpDown(); this.label71 = new System.Windows.Forms.Label(); - this.PathNodeFlags41CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeFlags4UpDown = new System.Windows.Forms.NumericUpDown(); this.PathNodeFlags4Label = new System.Windows.Forms.Label(); this.PathNodeFlags3GroupBox = new System.Windows.Forms.GroupBox(); @@ -65,13 +68,8 @@ this.PathNodeFlags2Label = new System.Windows.Forms.Label(); this.PathNodeFlags1GroupBox = new System.Windows.Forms.GroupBox(); this.PathNodeFlags11CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags18CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeFlags12CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags17CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeFlags13CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags16CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags14CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeFlags15CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeFlags1UpDown = new System.Windows.Forms.NumericUpDown(); this.PathNodeFlags1Label = new System.Windows.Forms.Label(); this.PathNodeFlags0GroupBox = new System.Windows.Forms.GroupBox(); @@ -105,6 +103,7 @@ this.PathNodeLinksListBox = new System.Windows.Forms.ListBox(); this.PathNodeLinkCountLabel = new System.Windows.Forms.Label(); this.PathNodeLinkPanel = new System.Windows.Forms.Panel(); + this.PathNodeSelectPartnerButton = new System.Windows.Forms.Button(); this.PathLinkFlags2GroupBox = new System.Windows.Forms.GroupBox(); this.PathNodeLinkFlags21CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeLinkFlags22CheckBox = new System.Windows.Forms.CheckBox(); @@ -115,10 +114,10 @@ this.PathNodeLinkFlags2UpDown = new System.Windows.Forms.NumericUpDown(); this.PathNodeLinkFlags2Label = new System.Windows.Forms.Label(); this.PathLinkFlags1GroupBox = new System.Windows.Forms.GroupBox(); + this.PathNodeLinkFlags18CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeLinkOffsetSizeUpDown = new System.Windows.Forms.NumericUpDown(); this.label61 = new System.Windows.Forms.Label(); this.PathNodeLinkFlags11CheckBox = new System.Windows.Forms.CheckBox(); - this.PathNodeLinkFlags18CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeLinkFlags12CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeLinkFlags13CheckBox = new System.Windows.Forms.CheckBox(); this.PathNodeLinkFlags14CheckBox = new System.Windows.Forms.CheckBox(); @@ -143,6 +142,7 @@ this.PathNodeJunctionTabPage = new System.Windows.Forms.TabPage(); this.label78 = new System.Windows.Forms.Label(); this.PathNodeJunctionPanel = new System.Windows.Forms.Panel(); + this.YndNodeJunctionGenerateButton = new System.Windows.Forms.Button(); this.PathNodeJunctionPosYUpDown = new System.Windows.Forms.NumericUpDown(); this.label59 = new System.Windows.Forms.Label(); this.PathNodeJunctionPosXUpDown = new System.Windows.Forms.NumericUpDown(); @@ -162,6 +162,7 @@ this.PathNodeFlags5GroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags5UpDown)).BeginInit(); this.PathNodeFlags4GroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags44UpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags42UpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags4UpDown)).BeginInit(); this.PathNodeFlags3GroupBox.SuspendLayout(); @@ -213,14 +214,20 @@ this.PathNodeTabControl.Controls.Add(this.PathNodePropertiesTabPage); this.PathNodeTabControl.Controls.Add(this.PathNodeLinksTabPage); this.PathNodeTabControl.Controls.Add(this.PathNodeJunctionTabPage); - this.PathNodeTabControl.Location = new System.Drawing.Point(2, 3); + this.PathNodeTabControl.Location = new System.Drawing.Point(3, 5); + this.PathNodeTabControl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeTabControl.Name = "PathNodeTabControl"; this.PathNodeTabControl.SelectedIndex = 0; - this.PathNodeTabControl.Size = new System.Drawing.Size(519, 447); + this.PathNodeTabControl.Size = new System.Drawing.Size(909, 705); this.PathNodeTabControl.TabIndex = 29; // // PathNodePropertiesTabPage // + this.PathNodePropertiesTabPage.Controls.Add(this.PathNodeEnableDisableButton); + this.PathNodePropertiesTabPage.Controls.Add(this.PathNodeFloodCopyButton); + this.PathNodePropertiesTabPage.Controls.Add(this.YndNodeIsPedNodeCheckBox); + this.PathNodePropertiesTabPage.Controls.Add(this.PathNodeSpecialTypeComboBox); + this.PathNodePropertiesTabPage.Controls.Add(this.label2); this.PathNodePropertiesTabPage.Controls.Add(this.PathNodeFlags5GroupBox); this.PathNodePropertiesTabPage.Controls.Add(this.PathNodeFlags4GroupBox); this.PathNodePropertiesTabPage.Controls.Add(this.PathNodeFlags3GroupBox); @@ -240,54 +247,107 @@ this.PathNodePropertiesTabPage.Controls.Add(this.PathNodeStreetNameLabel); this.PathNodePropertiesTabPage.Controls.Add(this.PathNodePositionTextBox); this.PathNodePropertiesTabPage.Controls.Add(this.label55); - this.PathNodePropertiesTabPage.Location = new System.Drawing.Point(4, 22); + this.PathNodePropertiesTabPage.Location = new System.Drawing.Point(4, 29); + this.PathNodePropertiesTabPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodePropertiesTabPage.Name = "PathNodePropertiesTabPage"; - this.PathNodePropertiesTabPage.Size = new System.Drawing.Size(511, 421); + this.PathNodePropertiesTabPage.Size = new System.Drawing.Size(901, 672); this.PathNodePropertiesTabPage.TabIndex = 2; this.PathNodePropertiesTabPage.Text = "Node Properties"; this.PathNodePropertiesTabPage.UseVisualStyleBackColor = true; // + // PathNodeEnableDisableButton + // + this.PathNodeEnableDisableButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.PathNodeEnableDisableButton.Location = new System.Drawing.Point(614, 100); + this.PathNodeEnableDisableButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeEnableDisableButton.Name = "PathNodeEnableDisableButton"; + this.PathNodeEnableDisableButton.Size = new System.Drawing.Size(135, 35); + this.PathNodeEnableDisableButton.TabIndex = 53; + this.PathNodeEnableDisableButton.Text = "Enable Section"; + this.PathNodeEnableDisableButton.UseVisualStyleBackColor = true; + this.PathNodeEnableDisableButton.Click += new System.EventHandler(this.PathNodeEnableDisableButton_Click); + // + // PathNodeFloodCopyButton + // + this.PathNodeFloodCopyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.PathNodeFloodCopyButton.Location = new System.Drawing.Point(758, 100); + this.PathNodeFloodCopyButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFloodCopyButton.Name = "PathNodeFloodCopyButton"; + this.PathNodeFloodCopyButton.Size = new System.Drawing.Size(135, 35); + this.PathNodeFloodCopyButton.TabIndex = 52; + this.PathNodeFloodCopyButton.Text = "Flood Copy"; + this.PathNodeFloodCopyButton.UseVisualStyleBackColor = true; + this.PathNodeFloodCopyButton.Click += new System.EventHandler(this.PathNodeFloodCopyButton_Click); + // + // YndNodeIsPedNodeCheckBox + // + this.YndNodeIsPedNodeCheckBox.AutoSize = true; + this.YndNodeIsPedNodeCheckBox.Enabled = false; + this.YndNodeIsPedNodeCheckBox.Location = new System.Drawing.Point(457, 142); + this.YndNodeIsPedNodeCheckBox.Name = "YndNodeIsPedNodeCheckBox"; + this.YndNodeIsPedNodeCheckBox.Size = new System.Drawing.Size(216, 24); + this.YndNodeIsPedNodeCheckBox.TabIndex = 49; + this.YndNodeIsPedNodeCheckBox.Text = "Special Type Is Ped Node"; + this.YndNodeIsPedNodeCheckBox.UseVisualStyleBackColor = true; + // + // PathNodeSpecialTypeComboBox + // + this.PathNodeSpecialTypeComboBox.FormattingEnabled = true; + this.PathNodeSpecialTypeComboBox.Location = new System.Drawing.Point(117, 140); + this.PathNodeSpecialTypeComboBox.Name = "PathNodeSpecialTypeComboBox"; + this.PathNodeSpecialTypeComboBox.Size = new System.Drawing.Size(318, 28); + this.PathNodeSpecialTypeComboBox.TabIndex = 45; + this.PathNodeSpecialTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.PathNodeSpecialTypeComboBox_SelectedIndexChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(4, 143); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(103, 20); + this.label2.TabIndex = 46; + this.label2.Text = "Special Type:"; + // // PathNodeFlags5GroupBox // - this.PathNodeFlags5GroupBox.Controls.Add(this.PathNodeFlags52CheckBox); - this.PathNodeFlags5GroupBox.Controls.Add(this.PathNodeFlags53CheckBox); + this.PathNodeFlags5GroupBox.Controls.Add(this.label1); + this.PathNodeFlags5GroupBox.Controls.Add(this.PathNodesSpeedComboBox); this.PathNodeFlags5GroupBox.Controls.Add(this.PathNodeFlags51CheckBox); this.PathNodeFlags5GroupBox.Controls.Add(this.PathNodeFlags5UpDown); - this.PathNodeFlags5GroupBox.Location = new System.Drawing.Point(249, 318); + this.PathNodeFlags5GroupBox.Location = new System.Drawing.Point(374, 517); + this.PathNodeFlags5GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags5GroupBox.Name = "PathNodeFlags5GroupBox"; - this.PathNodeFlags5GroupBox.Size = new System.Drawing.Size(223, 84); + this.PathNodeFlags5GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFlags5GroupBox.Size = new System.Drawing.Size(334, 146); this.PathNodeFlags5GroupBox.TabIndex = 48; this.PathNodeFlags5GroupBox.TabStop = false; this.PathNodeFlags5GroupBox.Text = "Flags 5"; // - // PathNodeFlags52CheckBox + // label1 // - this.PathNodeFlags52CheckBox.AutoSize = true; - this.PathNodeFlags52CheckBox.Location = new System.Drawing.Point(80, 41); - this.PathNodeFlags52CheckBox.Name = "PathNodeFlags52CheckBox"; - this.PathNodeFlags52CheckBox.Size = new System.Drawing.Size(87, 17); - this.PathNodeFlags52CheckBox.TabIndex = 36; - this.PathNodeFlags52CheckBox.Text = "Speed unk 1"; - this.PathNodeFlags52CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags52CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags52CheckBox_CheckedChanged); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(42, 73); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(60, 20); + this.label1.TabIndex = 45; + this.label1.Text = "Speed:"; // - // PathNodeFlags53CheckBox + // PathNodesSpeedComboBox // - this.PathNodeFlags53CheckBox.AutoSize = true; - this.PathNodeFlags53CheckBox.Location = new System.Drawing.Point(80, 62); - this.PathNodeFlags53CheckBox.Name = "PathNodeFlags53CheckBox"; - this.PathNodeFlags53CheckBox.Size = new System.Drawing.Size(87, 17); - this.PathNodeFlags53CheckBox.TabIndex = 37; - this.PathNodeFlags53CheckBox.Text = "Speed unk 2"; - this.PathNodeFlags53CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags53CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags53CheckBox_CheckedChanged); + this.PathNodesSpeedComboBox.FormattingEnabled = true; + this.PathNodesSpeedComboBox.Location = new System.Drawing.Point(120, 68); + this.PathNodesSpeedComboBox.Name = "PathNodesSpeedComboBox"; + this.PathNodesSpeedComboBox.Size = new System.Drawing.Size(190, 28); + this.PathNodesSpeedComboBox.TabIndex = 44; + this.PathNodesSpeedComboBox.SelectedIndexChanged += new System.EventHandler(this.PathNodesSpeedComboBox_SelectedIndexChanged); // // PathNodeFlags51CheckBox // this.PathNodeFlags51CheckBox.AutoSize = true; - this.PathNodeFlags51CheckBox.Location = new System.Drawing.Point(80, 20); + this.PathNodeFlags51CheckBox.Location = new System.Drawing.Point(120, 31); + this.PathNodeFlags51CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags51CheckBox.Name = "PathNodeFlags51CheckBox"; - this.PathNodeFlags51CheckBox.Size = new System.Drawing.Size(137, 17); + this.PathNodeFlags51CheckBox.Size = new System.Drawing.Size(202, 24); this.PathNodeFlags51CheckBox.TabIndex = 35; this.PathNodeFlags51CheckBox.Text = "Has junction heightmap"; this.PathNodeFlags51CheckBox.UseVisualStyleBackColor = true; @@ -295,131 +355,118 @@ // // PathNodeFlags5UpDown // - this.PathNodeFlags5UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeFlags5UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeFlags5UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags5UpDown.Maximum = new decimal(new int[] { 7, 0, 0, 0}); this.PathNodeFlags5UpDown.Name = "PathNodeFlags5UpDown"; - this.PathNodeFlags5UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeFlags5UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeFlags5UpDown.TabIndex = 43; this.PathNodeFlags5UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags5UpDown_ValueChanged); // // PathNodeFlags4GroupBox // - this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags45CheckBox); - this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags46CheckBox); - this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags47CheckBox); + this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags44UpDown); + this.PathNodeFlags4GroupBox.Controls.Add(this.label3); this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags48CheckBox); this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags42UpDown); this.PathNodeFlags4GroupBox.Controls.Add(this.label71); - this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags41CheckBox); this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags4UpDown); this.PathNodeFlags4GroupBox.Controls.Add(this.PathNodeFlags4Label); - this.PathNodeFlags4GroupBox.Location = new System.Drawing.Point(370, 96); + this.PathNodeFlags4GroupBox.Location = new System.Drawing.Point(555, 176); + this.PathNodeFlags4GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags4GroupBox.Name = "PathNodeFlags4GroupBox"; - this.PathNodeFlags4GroupBox.Size = new System.Drawing.Size(115, 175); + this.PathNodeFlags4GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFlags4GroupBox.Size = new System.Drawing.Size(218, 190); this.PathNodeFlags4GroupBox.TabIndex = 47; this.PathNodeFlags4GroupBox.TabStop = false; this.PathNodeFlags4GroupBox.Text = "Flags 4"; // - // PathNodeFlags45CheckBox + // PathNodeFlags44UpDown // - this.PathNodeFlags45CheckBox.AutoSize = true; - this.PathNodeFlags45CheckBox.Location = new System.Drawing.Point(6, 66); - this.PathNodeFlags45CheckBox.Name = "PathNodeFlags45CheckBox"; - this.PathNodeFlags45CheckBox.Size = new System.Drawing.Size(70, 17); - this.PathNodeFlags45CheckBox.TabIndex = 36; - this.PathNodeFlags45CheckBox.Text = "Special 1"; - this.PathNodeFlags45CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags45CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags45CheckBox_CheckedChanged); + this.PathNodeFlags44UpDown.Location = new System.Drawing.Point(124, 100); + this.PathNodeFlags44UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFlags44UpDown.Maximum = new decimal(new int[] { + 7, + 0, + 0, + 0}); + this.PathNodeFlags44UpDown.Name = "PathNodeFlags44UpDown"; + this.PathNodeFlags44UpDown.Size = new System.Drawing.Size(86, 26); + this.PathNodeFlags44UpDown.TabIndex = 46; + this.PathNodeFlags44UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags44UpDown_ValueChanged); // - // PathNodeFlags46CheckBox + // label3 // - this.PathNodeFlags46CheckBox.AutoSize = true; - this.PathNodeFlags46CheckBox.Location = new System.Drawing.Point(6, 87); - this.PathNodeFlags46CheckBox.Name = "PathNodeFlags46CheckBox"; - this.PathNodeFlags46CheckBox.Size = new System.Drawing.Size(70, 17); - this.PathNodeFlags46CheckBox.TabIndex = 37; - this.PathNodeFlags46CheckBox.Text = "Special 2"; - this.PathNodeFlags46CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags46CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags46CheckBox_CheckedChanged); - // - // PathNodeFlags47CheckBox - // - this.PathNodeFlags47CheckBox.AutoSize = true; - this.PathNodeFlags47CheckBox.Location = new System.Drawing.Point(6, 108); - this.PathNodeFlags47CheckBox.Name = "PathNodeFlags47CheckBox"; - this.PathNodeFlags47CheckBox.Size = new System.Drawing.Size(70, 17); - this.PathNodeFlags47CheckBox.TabIndex = 38; - this.PathNodeFlags47CheckBox.Text = "Special 3"; - this.PathNodeFlags47CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags47CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags47CheckBox_CheckedChanged); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(5, 102); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(113, 20); + this.label3.TabIndex = 45; + this.label3.Text = "Deadendness:"; // // PathNodeFlags48CheckBox // this.PathNodeFlags48CheckBox.AutoSize = true; - this.PathNodeFlags48CheckBox.Location = new System.Drawing.Point(6, 129); + this.PathNodeFlags48CheckBox.Location = new System.Drawing.Point(9, 156); + this.PathNodeFlags48CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags48CheckBox.Name = "PathNodeFlags48CheckBox"; - this.PathNodeFlags48CheckBox.Size = new System.Drawing.Size(96, 17); + this.PathNodeFlags48CheckBox.Size = new System.Drawing.Size(126, 24); this.PathNodeFlags48CheckBox.TabIndex = 39; - this.PathNodeFlags48CheckBox.Text = "Junction unk 6"; + this.PathNodeFlags48CheckBox.Text = "LeftTurnOnly"; this.PathNodeFlags48CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags48CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags48CheckBox_CheckedChanged); // // PathNodeFlags42UpDown // - this.PathNodeFlags42UpDown.Location = new System.Drawing.Point(41, 150); + this.PathNodeFlags42UpDown.Location = new System.Drawing.Point(124, 64); + this.PathNodeFlags42UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags42UpDown.Maximum = new decimal(new int[] { - 7, + 15, 0, 0, 0}); this.PathNodeFlags42UpDown.Name = "PathNodeFlags42UpDown"; - this.PathNodeFlags42UpDown.Size = new System.Drawing.Size(57, 20); + this.PathNodeFlags42UpDown.Size = new System.Drawing.Size(86, 26); this.PathNodeFlags42UpDown.TabIndex = 41; this.PathNodeFlags42UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags42UpDown_ValueChanged); // // label71 // this.label71.AutoSize = true; - this.label71.Location = new System.Drawing.Point(4, 152); + this.label71.Location = new System.Drawing.Point(52, 66); + this.label71.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label71.Name = "label71"; - this.label71.Size = new System.Drawing.Size(30, 13); + this.label71.Size = new System.Drawing.Size(66, 20); this.label71.TabIndex = 40; - this.label71.Text = "Unk:"; - // - // PathNodeFlags41CheckBox - // - this.PathNodeFlags41CheckBox.AutoSize = true; - this.PathNodeFlags41CheckBox.Location = new System.Drawing.Point(6, 45); - this.PathNodeFlags41CheckBox.Name = "PathNodeFlags41CheckBox"; - this.PathNodeFlags41CheckBox.Size = new System.Drawing.Size(79, 17); - this.PathNodeFlags41CheckBox.TabIndex = 35; - this.PathNodeFlags41CheckBox.Text = "Slow unk 4"; - this.PathNodeFlags41CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags41CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags41CheckBox_CheckedChanged); + this.label71.Text = "Density:"; // // PathNodeFlags4UpDown // - this.PathNodeFlags4UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeFlags4UpDown.Enabled = false; + this.PathNodeFlags4UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeFlags4UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags4UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeFlags4UpDown.Name = "PathNodeFlags4UpDown"; - this.PathNodeFlags4UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeFlags4UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeFlags4UpDown.TabIndex = 43; this.PathNodeFlags4UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags4UpDown_ValueChanged); // // PathNodeFlags4Label // this.PathNodeFlags4Label.AutoSize = true; - this.PathNodeFlags4Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeFlags4Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeFlags4Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeFlags4Label.Name = "PathNodeFlags4Label"; - this.PathNodeFlags4Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeFlags4Label.Size = new System.Drawing.Size(43, 20); this.PathNodeFlags4Label.TabIndex = 44; this.PathNodeFlags4Label.Text = "0x00"; // @@ -430,65 +477,73 @@ this.PathNodeFlags3GroupBox.Controls.Add(this.PathNodeFlags31CheckBox); this.PathNodeFlags3GroupBox.Controls.Add(this.PathNodeFlags3UpDown); this.PathNodeFlags3GroupBox.Controls.Add(this.PathNodeFlags3Label); - this.PathNodeFlags3GroupBox.Location = new System.Drawing.Point(7, 318); + this.PathNodeFlags3GroupBox.Location = new System.Drawing.Point(10, 517); + this.PathNodeFlags3GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags3GroupBox.Name = "PathNodeFlags3GroupBox"; - this.PathNodeFlags3GroupBox.Size = new System.Drawing.Size(223, 84); + this.PathNodeFlags3GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFlags3GroupBox.Size = new System.Drawing.Size(334, 146); this.PathNodeFlags3GroupBox.TabIndex = 46; this.PathNodeFlags3GroupBox.TabStop = false; this.PathNodeFlags3GroupBox.Text = "Flags 3"; // // PathNodeFlags32UpDown // - this.PathNodeFlags32UpDown.Location = new System.Drawing.Point(147, 44); + this.PathNodeFlags32UpDown.Enabled = false; + this.PathNodeFlags32UpDown.Location = new System.Drawing.Point(177, 103); + this.PathNodeFlags32UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags32UpDown.Maximum = new decimal(new int[] { 127, 0, 0, 0}); this.PathNodeFlags32UpDown.Name = "PathNodeFlags32UpDown"; - this.PathNodeFlags32UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeFlags32UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeFlags32UpDown.TabIndex = 37; this.PathNodeFlags32UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags32UpDown_ValueChanged); // // label70 // this.label70.AutoSize = true; - this.label70.Location = new System.Drawing.Point(111, 46); + this.label70.Location = new System.Drawing.Point(8, 104); + this.label70.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label70.Name = "label70"; - this.label70.Size = new System.Drawing.Size(30, 13); + this.label70.Size = new System.Drawing.Size(161, 20); this.label70.TabIndex = 36; - this.label70.Text = "Unk:"; + this.label70.Text = "Heuristic (Automatic):"; // // PathNodeFlags31CheckBox // this.PathNodeFlags31CheckBox.AutoSize = true; - this.PathNodeFlags31CheckBox.Location = new System.Drawing.Point(6, 45); + this.PathNodeFlags31CheckBox.Location = new System.Drawing.Point(9, 69); + this.PathNodeFlags31CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags31CheckBox.Name = "PathNodeFlags31CheckBox"; - this.PathNodeFlags31CheckBox.Size = new System.Drawing.Size(85, 17); + this.PathNodeFlags31CheckBox.Size = new System.Drawing.Size(260, 24); this.PathNodeFlags31CheckBox.TabIndex = 35; - this.PathNodeFlags31CheckBox.Text = "Interior node"; + this.PathNodeFlags31CheckBox.Text = "Tunnel (Temporarily break GPS)"; this.PathNodeFlags31CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags31CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags31CheckBox_CheckedChanged); // // PathNodeFlags3UpDown // - this.PathNodeFlags3UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeFlags3UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeFlags3UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags3UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeFlags3UpDown.Name = "PathNodeFlags3UpDown"; - this.PathNodeFlags3UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeFlags3UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeFlags3UpDown.TabIndex = 43; this.PathNodeFlags3UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags3UpDown_ValueChanged); // // PathNodeFlags3Label // this.PathNodeFlags3Label.AutoSize = true; - this.PathNodeFlags3Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeFlags3Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeFlags3Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeFlags3Label.Name = "PathNodeFlags3Label"; - this.PathNodeFlags3Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeFlags3Label.Size = new System.Drawing.Size(43, 20); this.PathNodeFlags3Label.TabIndex = 44; this.PathNodeFlags3Label.Text = "0x00"; // @@ -504,9 +559,11 @@ this.PathNodeFlags2GroupBox.Controls.Add(this.PathNodeFlags25CheckBox); this.PathNodeFlags2GroupBox.Controls.Add(this.PathNodeFlags2UpDown); this.PathNodeFlags2GroupBox.Controls.Add(this.PathNodeFlags2Label); - this.PathNodeFlags2GroupBox.Location = new System.Drawing.Point(249, 96); + this.PathNodeFlags2GroupBox.Location = new System.Drawing.Point(374, 176); + this.PathNodeFlags2GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags2GroupBox.Name = "PathNodeFlags2GroupBox"; - this.PathNodeFlags2GroupBox.Size = new System.Drawing.Size(115, 216); + this.PathNodeFlags2GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFlags2GroupBox.Size = new System.Drawing.Size(172, 332); this.PathNodeFlags2GroupBox.TabIndex = 45; this.PathNodeFlags2GroupBox.TabStop = false; this.PathNodeFlags2GroupBox.Text = "Flags 2"; @@ -514,31 +571,34 @@ // PathNodeFlags21CheckBox // this.PathNodeFlags21CheckBox.AutoSize = true; - this.PathNodeFlags21CheckBox.Location = new System.Drawing.Point(6, 45); + this.PathNodeFlags21CheckBox.Location = new System.Drawing.Point(9, 69); + this.PathNodeFlags21CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags21CheckBox.Name = "PathNodeFlags21CheckBox"; - this.PathNodeFlags21CheckBox.Size = new System.Drawing.Size(79, 17); + this.PathNodeFlags21CheckBox.Size = new System.Drawing.Size(93, 24); this.PathNodeFlags21CheckBox.TabIndex = 35; - this.PathNodeFlags21CheckBox.Text = "Slow unk 2"; + this.PathNodeFlags21CheckBox.Text = "No GPS"; this.PathNodeFlags21CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags21CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags21CheckBox_CheckedChanged); // // PathNodeFlags28CheckBox // this.PathNodeFlags28CheckBox.AutoSize = true; - this.PathNodeFlags28CheckBox.Location = new System.Drawing.Point(6, 192); + this.PathNodeFlags28CheckBox.Location = new System.Drawing.Point(9, 295); + this.PathNodeFlags28CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags28CheckBox.Name = "PathNodeFlags28CheckBox"; - this.PathNodeFlags28CheckBox.Size = new System.Drawing.Size(81, 17); + this.PathNodeFlags28CheckBox.Size = new System.Drawing.Size(140, 24); this.PathNodeFlags28CheckBox.TabIndex = 42; - this.PathNodeFlags28CheckBox.Text = "Back road?"; + this.PathNodeFlags28CheckBox.Text = "Disabled unk 2"; this.PathNodeFlags28CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags28CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags28CheckBox_CheckedChanged); // // PathNodeFlags22CheckBox // this.PathNodeFlags22CheckBox.AutoSize = true; - this.PathNodeFlags22CheckBox.Location = new System.Drawing.Point(6, 66); + this.PathNodeFlags22CheckBox.Location = new System.Drawing.Point(9, 102); + this.PathNodeFlags22CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags22CheckBox.Name = "PathNodeFlags22CheckBox"; - this.PathNodeFlags22CheckBox.Size = new System.Drawing.Size(72, 17); + this.PathNodeFlags22CheckBox.Size = new System.Drawing.Size(104, 24); this.PathNodeFlags22CheckBox.TabIndex = 36; this.PathNodeFlags22CheckBox.Text = "Unused 2"; this.PathNodeFlags22CheckBox.UseVisualStyleBackColor = true; @@ -547,9 +607,10 @@ // PathNodeFlags27CheckBox // this.PathNodeFlags27CheckBox.AutoSize = true; - this.PathNodeFlags27CheckBox.Location = new System.Drawing.Point(6, 171); + this.PathNodeFlags27CheckBox.Location = new System.Drawing.Point(9, 263); + this.PathNodeFlags27CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags27CheckBox.Name = "PathNodeFlags27CheckBox"; - this.PathNodeFlags27CheckBox.Size = new System.Drawing.Size(66, 17); + this.PathNodeFlags27CheckBox.Size = new System.Drawing.Size(95, 24); this.PathNodeFlags27CheckBox.TabIndex = 41; this.PathNodeFlags27CheckBox.Text = "Freeway"; this.PathNodeFlags27CheckBox.UseVisualStyleBackColor = true; @@ -558,20 +619,22 @@ // PathNodeFlags23CheckBox // this.PathNodeFlags23CheckBox.AutoSize = true; - this.PathNodeFlags23CheckBox.Location = new System.Drawing.Point(6, 87); + this.PathNodeFlags23CheckBox.Location = new System.Drawing.Point(9, 134); + this.PathNodeFlags23CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags23CheckBox.Name = "PathNodeFlags23CheckBox"; - this.PathNodeFlags23CheckBox.Size = new System.Drawing.Size(96, 17); + this.PathNodeFlags23CheckBox.Size = new System.Drawing.Size(95, 24); this.PathNodeFlags23CheckBox.TabIndex = 37; - this.PathNodeFlags23CheckBox.Text = "Junction unk 5"; + this.PathNodeFlags23CheckBox.Text = "Junction"; this.PathNodeFlags23CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags23CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags23CheckBox_CheckedChanged); // // PathNodeFlags26CheckBox // this.PathNodeFlags26CheckBox.AutoSize = true; - this.PathNodeFlags26CheckBox.Location = new System.Drawing.Point(6, 150); + this.PathNodeFlags26CheckBox.Location = new System.Drawing.Point(9, 231); + this.PathNodeFlags26CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags26CheckBox.Name = "PathNodeFlags26CheckBox"; - this.PathNodeFlags26CheckBox.Size = new System.Drawing.Size(86, 17); + this.PathNodeFlags26CheckBox.Size = new System.Drawing.Size(122, 24); this.PathNodeFlags26CheckBox.TabIndex = 40; this.PathNodeFlags26CheckBox.Text = "Water/boats"; this.PathNodeFlags26CheckBox.UseVisualStyleBackColor = true; @@ -580,9 +643,10 @@ // PathNodeFlags24CheckBox // this.PathNodeFlags24CheckBox.AutoSize = true; - this.PathNodeFlags24CheckBox.Location = new System.Drawing.Point(6, 108); + this.PathNodeFlags24CheckBox.Location = new System.Drawing.Point(9, 166); + this.PathNodeFlags24CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags24CheckBox.Name = "PathNodeFlags24CheckBox"; - this.PathNodeFlags24CheckBox.Size = new System.Drawing.Size(72, 17); + this.PathNodeFlags24CheckBox.Size = new System.Drawing.Size(104, 24); this.PathNodeFlags24CheckBox.TabIndex = 38; this.PathNodeFlags24CheckBox.Text = "Unused 8"; this.PathNodeFlags24CheckBox.UseVisualStyleBackColor = true; @@ -591,51 +655,52 @@ // PathNodeFlags25CheckBox // this.PathNodeFlags25CheckBox.AutoSize = true; - this.PathNodeFlags25CheckBox.Location = new System.Drawing.Point(6, 129); + this.PathNodeFlags25CheckBox.Location = new System.Drawing.Point(9, 198); + this.PathNodeFlags25CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags25CheckBox.Name = "PathNodeFlags25CheckBox"; - this.PathNodeFlags25CheckBox.Size = new System.Drawing.Size(79, 17); + this.PathNodeFlags25CheckBox.Size = new System.Drawing.Size(140, 24); this.PathNodeFlags25CheckBox.TabIndex = 39; - this.PathNodeFlags25CheckBox.Text = "Slow unk 3"; + this.PathNodeFlags25CheckBox.Text = "Disabled unk 1"; this.PathNodeFlags25CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags25CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags25CheckBox_CheckedChanged); // // PathNodeFlags2UpDown // - this.PathNodeFlags2UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeFlags2UpDown.Enabled = false; + this.PathNodeFlags2UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeFlags2UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags2UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeFlags2UpDown.Name = "PathNodeFlags2UpDown"; - this.PathNodeFlags2UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeFlags2UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeFlags2UpDown.TabIndex = 43; this.PathNodeFlags2UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags2UpDown_ValueChanged); // // PathNodeFlags2Label // this.PathNodeFlags2Label.AutoSize = true; - this.PathNodeFlags2Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeFlags2Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeFlags2Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeFlags2Label.Name = "PathNodeFlags2Label"; - this.PathNodeFlags2Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeFlags2Label.Size = new System.Drawing.Size(43, 20); this.PathNodeFlags2Label.TabIndex = 44; this.PathNodeFlags2Label.Text = "0x00"; // // PathNodeFlags1GroupBox // this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags11CheckBox); - this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags18CheckBox); this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags12CheckBox); - this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags17CheckBox); this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags13CheckBox); - this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags16CheckBox); - this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags14CheckBox); - this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags15CheckBox); this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags1UpDown); this.PathNodeFlags1GroupBox.Controls.Add(this.PathNodeFlags1Label); - this.PathNodeFlags1GroupBox.Location = new System.Drawing.Point(128, 96); + this.PathNodeFlags1GroupBox.Location = new System.Drawing.Point(192, 176); + this.PathNodeFlags1GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags1GroupBox.Name = "PathNodeFlags1GroupBox"; - this.PathNodeFlags1GroupBox.Size = new System.Drawing.Size(115, 216); + this.PathNodeFlags1GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFlags1GroupBox.Size = new System.Drawing.Size(172, 332); this.PathNodeFlags1GroupBox.TabIndex = 44; this.PathNodeFlags1GroupBox.TabStop = false; this.PathNodeFlags1GroupBox.Text = "Flags 1"; @@ -643,110 +708,61 @@ // PathNodeFlags11CheckBox // this.PathNodeFlags11CheckBox.AutoSize = true; - this.PathNodeFlags11CheckBox.Location = new System.Drawing.Point(6, 45); + this.PathNodeFlags11CheckBox.Location = new System.Drawing.Point(9, 69); + this.PathNodeFlags11CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags11CheckBox.Name = "PathNodeFlags11CheckBox"; - this.PathNodeFlags11CheckBox.Size = new System.Drawing.Size(82, 17); + this.PathNodeFlags11CheckBox.Size = new System.Drawing.Size(101, 24); this.PathNodeFlags11CheckBox.TabIndex = 35; - this.PathNodeFlags11CheckBox.Text = "L turn lane?"; + this.PathNodeFlags11CheckBox.Text = "Slip Lane"; this.PathNodeFlags11CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags11CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags11CheckBox_CheckedChanged); // - // PathNodeFlags18CheckBox - // - this.PathNodeFlags18CheckBox.AutoSize = true; - this.PathNodeFlags18CheckBox.Location = new System.Drawing.Point(6, 192); - this.PathNodeFlags18CheckBox.Name = "PathNodeFlags18CheckBox"; - this.PathNodeFlags18CheckBox.Size = new System.Drawing.Size(96, 17); - this.PathNodeFlags18CheckBox.TabIndex = 42; - this.PathNodeFlags18CheckBox.Text = "Junction unk 4"; - this.PathNodeFlags18CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags18CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags18CheckBox_CheckedChanged); - // // PathNodeFlags12CheckBox // this.PathNodeFlags12CheckBox.AutoSize = true; - this.PathNodeFlags12CheckBox.Location = new System.Drawing.Point(6, 66); + this.PathNodeFlags12CheckBox.Location = new System.Drawing.Point(9, 102); + this.PathNodeFlags12CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags12CheckBox.Name = "PathNodeFlags12CheckBox"; - this.PathNodeFlags12CheckBox.Size = new System.Drawing.Size(98, 17); + this.PathNodeFlags12CheckBox.Size = new System.Drawing.Size(157, 24); this.PathNodeFlags12CheckBox.TabIndex = 36; - this.PathNodeFlags12CheckBox.Text = "L turn no return"; + this.PathNodeFlags12CheckBox.Text = "IndicateKeepLeft"; this.PathNodeFlags12CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags12CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags12CheckBox_CheckedChanged); // - // PathNodeFlags17CheckBox - // - this.PathNodeFlags17CheckBox.AutoSize = true; - this.PathNodeFlags17CheckBox.Location = new System.Drawing.Point(6, 171); - this.PathNodeFlags17CheckBox.Name = "PathNodeFlags17CheckBox"; - this.PathNodeFlags17CheckBox.Size = new System.Drawing.Size(108, 17); - this.PathNodeFlags17CheckBox.TabIndex = 41; - this.PathNodeFlags17CheckBox.Text = "Traffic light unk 3"; - this.PathNodeFlags17CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags17CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags17CheckBox_CheckedChanged); - // // PathNodeFlags13CheckBox // this.PathNodeFlags13CheckBox.AutoSize = true; - this.PathNodeFlags13CheckBox.Location = new System.Drawing.Point(6, 87); + this.PathNodeFlags13CheckBox.Location = new System.Drawing.Point(9, 134); + this.PathNodeFlags13CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags13CheckBox.Name = "PathNodeFlags13CheckBox"; - this.PathNodeFlags13CheckBox.Size = new System.Drawing.Size(100, 17); + this.PathNodeFlags13CheckBox.Size = new System.Drawing.Size(167, 24); this.PathNodeFlags13CheckBox.TabIndex = 37; - this.PathNodeFlags13CheckBox.Text = "R turn no return"; + this.PathNodeFlags13CheckBox.Text = "IndicateKeepRight"; this.PathNodeFlags13CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags13CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags13CheckBox_CheckedChanged); // - // PathNodeFlags16CheckBox - // - this.PathNodeFlags16CheckBox.AutoSize = true; - this.PathNodeFlags16CheckBox.Location = new System.Drawing.Point(6, 150); - this.PathNodeFlags16CheckBox.Name = "PathNodeFlags16CheckBox"; - this.PathNodeFlags16CheckBox.Size = new System.Drawing.Size(96, 17); - this.PathNodeFlags16CheckBox.TabIndex = 40; - this.PathNodeFlags16CheckBox.Text = "Junction unk 3"; - this.PathNodeFlags16CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags16CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags16CheckBox_CheckedChanged); - // - // PathNodeFlags14CheckBox - // - this.PathNodeFlags14CheckBox.AutoSize = true; - this.PathNodeFlags14CheckBox.Location = new System.Drawing.Point(6, 108); - this.PathNodeFlags14CheckBox.Name = "PathNodeFlags14CheckBox"; - this.PathNodeFlags14CheckBox.Size = new System.Drawing.Size(108, 17); - this.PathNodeFlags14CheckBox.TabIndex = 38; - this.PathNodeFlags14CheckBox.Text = "Traffic light unk 1"; - this.PathNodeFlags14CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags14CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags14CheckBox_CheckedChanged); - // - // PathNodeFlags15CheckBox - // - this.PathNodeFlags15CheckBox.AutoSize = true; - this.PathNodeFlags15CheckBox.Location = new System.Drawing.Point(6, 129); - this.PathNodeFlags15CheckBox.Name = "PathNodeFlags15CheckBox"; - this.PathNodeFlags15CheckBox.Size = new System.Drawing.Size(108, 17); - this.PathNodeFlags15CheckBox.TabIndex = 39; - this.PathNodeFlags15CheckBox.Text = "Traffic light unk 2"; - this.PathNodeFlags15CheckBox.UseVisualStyleBackColor = true; - this.PathNodeFlags15CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags15CheckBox_CheckedChanged); - // // PathNodeFlags1UpDown // - this.PathNodeFlags1UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeFlags1UpDown.Enabled = false; + this.PathNodeFlags1UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeFlags1UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags1UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeFlags1UpDown.Name = "PathNodeFlags1UpDown"; - this.PathNodeFlags1UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeFlags1UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeFlags1UpDown.TabIndex = 43; this.PathNodeFlags1UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags1UpDown_ValueChanged); // // PathNodeFlags1Label // this.PathNodeFlags1Label.AutoSize = true; - this.PathNodeFlags1Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeFlags1Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeFlags1Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeFlags1Label.Name = "PathNodeFlags1Label"; - this.PathNodeFlags1Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeFlags1Label.Size = new System.Drawing.Size(43, 20); this.PathNodeFlags1Label.TabIndex = 44; this.PathNodeFlags1Label.Text = "0x00"; // @@ -762,9 +778,11 @@ this.PathNodeFlags0GroupBox.Controls.Add(this.PathNodeFlags05CheckBox); this.PathNodeFlags0GroupBox.Controls.Add(this.PathNodeFlags0UpDown); this.PathNodeFlags0GroupBox.Controls.Add(this.PathNodeFlags0Label); - this.PathNodeFlags0GroupBox.Location = new System.Drawing.Point(7, 96); + this.PathNodeFlags0GroupBox.Location = new System.Drawing.Point(10, 176); + this.PathNodeFlags0GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags0GroupBox.Name = "PathNodeFlags0GroupBox"; - this.PathNodeFlags0GroupBox.Size = new System.Drawing.Size(115, 216); + this.PathNodeFlags0GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeFlags0GroupBox.Size = new System.Drawing.Size(172, 332); this.PathNodeFlags0GroupBox.TabIndex = 43; this.PathNodeFlags0GroupBox.TabStop = false; this.PathNodeFlags0GroupBox.Text = "Flags 0"; @@ -772,9 +790,10 @@ // PathNodeFlags01CheckBox // this.PathNodeFlags01CheckBox.AutoSize = true; - this.PathNodeFlags01CheckBox.Location = new System.Drawing.Point(6, 45); + this.PathNodeFlags01CheckBox.Location = new System.Drawing.Point(9, 69); + this.PathNodeFlags01CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags01CheckBox.Name = "PathNodeFlags01CheckBox"; - this.PathNodeFlags01CheckBox.Size = new System.Drawing.Size(65, 17); + this.PathNodeFlags01CheckBox.Size = new System.Drawing.Size(94, 24); this.PathNodeFlags01CheckBox.TabIndex = 35; this.PathNodeFlags01CheckBox.Text = "Scripted"; this.PathNodeFlags01CheckBox.UseVisualStyleBackColor = true; @@ -783,42 +802,46 @@ // PathNodeFlags08CheckBox // this.PathNodeFlags08CheckBox.AutoSize = true; - this.PathNodeFlags08CheckBox.Location = new System.Drawing.Point(6, 192); + this.PathNodeFlags08CheckBox.Location = new System.Drawing.Point(9, 295); + this.PathNodeFlags08CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags08CheckBox.Name = "PathNodeFlags08CheckBox"; - this.PathNodeFlags08CheckBox.Size = new System.Drawing.Size(96, 17); + this.PathNodeFlags08CheckBox.Size = new System.Drawing.Size(137, 24); this.PathNodeFlags08CheckBox.TabIndex = 42; - this.PathNodeFlags08CheckBox.Text = "Junction unk 2"; + this.PathNodeFlags08CheckBox.Text = "CannotGoLeft"; this.PathNodeFlags08CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags08CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags08CheckBox_CheckedChanged); // // PathNodeFlags02CheckBox // this.PathNodeFlags02CheckBox.AutoSize = true; - this.PathNodeFlags02CheckBox.Location = new System.Drawing.Point(6, 66); + this.PathNodeFlags02CheckBox.Location = new System.Drawing.Point(9, 102); + this.PathNodeFlags02CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags02CheckBox.Name = "PathNodeFlags02CheckBox"; - this.PathNodeFlags02CheckBox.Size = new System.Drawing.Size(89, 17); + this.PathNodeFlags02CheckBox.Size = new System.Drawing.Size(132, 24); this.PathNodeFlags02CheckBox.TabIndex = 36; - this.PathNodeFlags02CheckBox.Text = "GPS enable?"; + this.PathNodeFlags02CheckBox.Text = "GPS Enabled"; this.PathNodeFlags02CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags02CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags02CheckBox_CheckedChanged); // // PathNodeFlags07CheckBox // this.PathNodeFlags07CheckBox.AutoSize = true; - this.PathNodeFlags07CheckBox.Location = new System.Drawing.Point(6, 171); + this.PathNodeFlags07CheckBox.Location = new System.Drawing.Point(9, 263); + this.PathNodeFlags07CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags07CheckBox.Name = "PathNodeFlags07CheckBox"; - this.PathNodeFlags07CheckBox.Size = new System.Drawing.Size(96, 17); + this.PathNodeFlags07CheckBox.Size = new System.Drawing.Size(147, 24); this.PathNodeFlags07CheckBox.TabIndex = 41; - this.PathNodeFlags07CheckBox.Text = "Junction unk 1"; + this.PathNodeFlags07CheckBox.Text = "CannotGoRight"; this.PathNodeFlags07CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags07CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags07CheckBox_CheckedChanged); // // PathNodeFlags03CheckBox // this.PathNodeFlags03CheckBox.AutoSize = true; - this.PathNodeFlags03CheckBox.Location = new System.Drawing.Point(6, 87); + this.PathNodeFlags03CheckBox.Location = new System.Drawing.Point(9, 134); + this.PathNodeFlags03CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags03CheckBox.Name = "PathNodeFlags03CheckBox"; - this.PathNodeFlags03CheckBox.Size = new System.Drawing.Size(72, 17); + this.PathNodeFlags03CheckBox.Size = new System.Drawing.Size(104, 24); this.PathNodeFlags03CheckBox.TabIndex = 37; this.PathNodeFlags03CheckBox.Text = "Unused 4"; this.PathNodeFlags03CheckBox.UseVisualStyleBackColor = true; @@ -827,31 +850,34 @@ // PathNodeFlags06CheckBox // this.PathNodeFlags06CheckBox.AutoSize = true; - this.PathNodeFlags06CheckBox.Location = new System.Drawing.Point(6, 150); + this.PathNodeFlags06CheckBox.Location = new System.Drawing.Point(9, 231); + this.PathNodeFlags06CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags06CheckBox.Name = "PathNodeFlags06CheckBox"; - this.PathNodeFlags06CheckBox.Size = new System.Drawing.Size(79, 17); + this.PathNodeFlags06CheckBox.Size = new System.Drawing.Size(138, 24); this.PathNodeFlags06CheckBox.TabIndex = 40; - this.PathNodeFlags06CheckBox.Text = "Slow unk 1"; + this.PathNodeFlags06CheckBox.Text = "NoBigVehicles"; this.PathNodeFlags06CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags06CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags06CheckBox_CheckedChanged); // // PathNodeFlags04CheckBox // this.PathNodeFlags04CheckBox.AutoSize = true; - this.PathNodeFlags04CheckBox.Location = new System.Drawing.Point(6, 108); + this.PathNodeFlags04CheckBox.Location = new System.Drawing.Point(9, 166); + this.PathNodeFlags04CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags04CheckBox.Name = "PathNodeFlags04CheckBox"; - this.PathNodeFlags04CheckBox.Size = new System.Drawing.Size(87, 17); + this.PathNodeFlags04CheckBox.Size = new System.Drawing.Size(89, 24); this.PathNodeFlags04CheckBox.TabIndex = 38; - this.PathNodeFlags04CheckBox.Text = "Gravel road?"; + this.PathNodeFlags04CheckBox.Text = "Offroad"; this.PathNodeFlags04CheckBox.UseVisualStyleBackColor = true; this.PathNodeFlags04CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeFlags04CheckBox_CheckedChanged); // // PathNodeFlags05CheckBox // this.PathNodeFlags05CheckBox.AutoSize = true; - this.PathNodeFlags05CheckBox.Location = new System.Drawing.Point(6, 129); + this.PathNodeFlags05CheckBox.Location = new System.Drawing.Point(9, 198); + this.PathNodeFlags05CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags05CheckBox.Name = "PathNodeFlags05CheckBox"; - this.PathNodeFlags05CheckBox.Size = new System.Drawing.Size(78, 17); + this.PathNodeFlags05CheckBox.Size = new System.Drawing.Size(113, 24); this.PathNodeFlags05CheckBox.TabIndex = 39; this.PathNodeFlags05CheckBox.Text = "Unused 16"; this.PathNodeFlags05CheckBox.UseVisualStyleBackColor = true; @@ -859,33 +885,36 @@ // // PathNodeFlags0UpDown // - this.PathNodeFlags0UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeFlags0UpDown.Enabled = false; + this.PathNodeFlags0UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeFlags0UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeFlags0UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeFlags0UpDown.Name = "PathNodeFlags0UpDown"; - this.PathNodeFlags0UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeFlags0UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeFlags0UpDown.TabIndex = 43; this.PathNodeFlags0UpDown.ValueChanged += new System.EventHandler(this.PathNodeFlags0UpDown_ValueChanged); // // PathNodeFlags0Label // this.PathNodeFlags0Label.AutoSize = true; - this.PathNodeFlags0Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeFlags0Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeFlags0Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeFlags0Label.Name = "PathNodeFlags0Label"; - this.PathNodeFlags0Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeFlags0Label.Size = new System.Drawing.Size(43, 20); this.PathNodeFlags0Label.TabIndex = 44; this.PathNodeFlags0Label.Text = "0x00"; // // PathNodeDeleteButton // this.PathNodeDeleteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.PathNodeDeleteButton.Enabled = false; - this.PathNodeDeleteButton.Location = new System.Drawing.Point(418, 36); + this.PathNodeDeleteButton.Location = new System.Drawing.Point(758, 55); + this.PathNodeDeleteButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeDeleteButton.Name = "PathNodeDeleteButton"; - this.PathNodeDeleteButton.Size = new System.Drawing.Size(90, 23); + this.PathNodeDeleteButton.Size = new System.Drawing.Size(135, 35); this.PathNodeDeleteButton.TabIndex = 12; this.PathNodeDeleteButton.Text = "Delete Node"; this.PathNodeDeleteButton.UseVisualStyleBackColor = true; @@ -893,14 +922,16 @@ // // PathNodeAreaIDUpDown // - this.PathNodeAreaIDUpDown.Location = new System.Drawing.Point(78, 12); + this.PathNodeAreaIDUpDown.Enabled = false; + this.PathNodeAreaIDUpDown.Location = new System.Drawing.Point(117, 18); + this.PathNodeAreaIDUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeAreaIDUpDown.Maximum = new decimal(new int[] { 1023, 0, 0, 0}); this.PathNodeAreaIDUpDown.Name = "PathNodeAreaIDUpDown"; - this.PathNodeAreaIDUpDown.Size = new System.Drawing.Size(74, 20); + this.PathNodeAreaIDUpDown.Size = new System.Drawing.Size(111, 26); this.PathNodeAreaIDUpDown.TabIndex = 6; this.PathNodeAreaIDUpDown.ValueChanged += new System.EventHandler(this.PathNodeAreaIDUpDown_ValueChanged); // @@ -908,9 +939,10 @@ // this.PathNodeAddToProjectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.PathNodeAddToProjectButton.Enabled = false; - this.PathNodeAddToProjectButton.Location = new System.Drawing.Point(322, 36); + this.PathNodeAddToProjectButton.Location = new System.Drawing.Point(614, 55); + this.PathNodeAddToProjectButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeAddToProjectButton.Name = "PathNodeAddToProjectButton"; - this.PathNodeAddToProjectButton.Size = new System.Drawing.Size(90, 23); + this.PathNodeAddToProjectButton.Size = new System.Drawing.Size(135, 35); this.PathNodeAddToProjectButton.TabIndex = 11; this.PathNodeAddToProjectButton.Text = "Add to Project"; this.PathNodeAddToProjectButton.UseVisualStyleBackColor = true; @@ -919,65 +951,73 @@ // label49 // this.label49.AutoSize = true; - this.label49.Location = new System.Drawing.Point(26, 14); + this.label49.Location = new System.Drawing.Point(39, 22); + this.label49.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label49.Name = "label49"; - this.label49.Size = new System.Drawing.Size(46, 13); + this.label49.Size = new System.Drawing.Size(68, 20); this.label49.TabIndex = 5; this.label49.Text = "Area ID:"; // // label50 // this.label50.AutoSize = true; - this.label50.Location = new System.Drawing.Point(166, 14); + this.label50.Location = new System.Drawing.Point(249, 22); + this.label50.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label50.Name = "label50"; - this.label50.Size = new System.Drawing.Size(50, 13); + this.label50.Size = new System.Drawing.Size(72, 20); this.label50.TabIndex = 7; this.label50.Text = "Node ID:"; // // label68 // this.label68.AutoSize = true; - this.label68.Location = new System.Drawing.Point(302, 14); + this.label68.Location = new System.Drawing.Point(453, 22); + this.label68.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label68.Name = "label68"; - this.label68.Size = new System.Drawing.Size(156, 13); + this.label68.Size = new System.Drawing.Size(231, 20); this.label68.TabIndex = 32; this.label68.Text = "(These will be set automatically)"; // // PathNodeNodeIDUpDown // - this.PathNodeNodeIDUpDown.Location = new System.Drawing.Point(222, 12); + this.PathNodeNodeIDUpDown.Enabled = false; + this.PathNodeNodeIDUpDown.Location = new System.Drawing.Point(333, 18); + this.PathNodeNodeIDUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeNodeIDUpDown.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); this.PathNodeNodeIDUpDown.Name = "PathNodeNodeIDUpDown"; - this.PathNodeNodeIDUpDown.Size = new System.Drawing.Size(74, 20); + this.PathNodeNodeIDUpDown.Size = new System.Drawing.Size(111, 26); this.PathNodeNodeIDUpDown.TabIndex = 8; this.PathNodeNodeIDUpDown.ValueChanged += new System.EventHandler(this.PathNodeNodeIDUpDown_ValueChanged); // // label52 // this.label52.AutoSize = true; - this.label52.Location = new System.Drawing.Point(4, 67); + this.label52.Location = new System.Drawing.Point(6, 103); + this.label52.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label52.Name = "label52"; - this.label52.Size = new System.Drawing.Size(70, 13); + this.label52.Size = new System.Drawing.Size(106, 20); this.label52.TabIndex = 9; this.label52.Text = "Street (hash):"; // // PathNodeStreetHashTextBox // - this.PathNodeStreetHashTextBox.Location = new System.Drawing.Point(78, 64); + this.PathNodeStreetHashTextBox.Location = new System.Drawing.Point(117, 98); + this.PathNodeStreetHashTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeStreetHashTextBox.Name = "PathNodeStreetHashTextBox"; - this.PathNodeStreetHashTextBox.Size = new System.Drawing.Size(138, 20); + this.PathNodeStreetHashTextBox.Size = new System.Drawing.Size(205, 26); this.PathNodeStreetHashTextBox.TabIndex = 13; this.PathNodeStreetHashTextBox.TextChanged += new System.EventHandler(this.PathNodeStreetHashTextBox_TextChanged); // // PathNodeGoToButton // - this.PathNodeGoToButton.Location = new System.Drawing.Point(222, 36); + this.PathNodeGoToButton.Location = new System.Drawing.Point(333, 55); + this.PathNodeGoToButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeGoToButton.Name = "PathNodeGoToButton"; - this.PathNodeGoToButton.Size = new System.Drawing.Size(68, 23); + this.PathNodeGoToButton.Size = new System.Drawing.Size(102, 35); this.PathNodeGoToButton.TabIndex = 10; this.PathNodeGoToButton.Text = "Go to"; this.PathNodeGoToButton.UseVisualStyleBackColor = true; @@ -986,36 +1026,40 @@ // PathNodeStreetNameLabel // this.PathNodeStreetNameLabel.AutoSize = true; - this.PathNodeStreetNameLabel.Location = new System.Drawing.Point(223, 67); + this.PathNodeStreetNameLabel.Location = new System.Drawing.Point(334, 103); + this.PathNodeStreetNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeStreetNameLabel.Name = "PathNodeStreetNameLabel"; - this.PathNodeStreetNameLabel.Size = new System.Drawing.Size(73, 13); + this.PathNodeStreetNameLabel.Size = new System.Drawing.Size(105, 20); this.PathNodeStreetNameLabel.TabIndex = 11; this.PathNodeStreetNameLabel.Text = "Name: [None]"; // // PathNodePositionTextBox // - this.PathNodePositionTextBox.Location = new System.Drawing.Point(78, 38); + this.PathNodePositionTextBox.Location = new System.Drawing.Point(117, 58); + this.PathNodePositionTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodePositionTextBox.Name = "PathNodePositionTextBox"; - this.PathNodePositionTextBox.Size = new System.Drawing.Size(138, 20); + this.PathNodePositionTextBox.Size = new System.Drawing.Size(205, 26); this.PathNodePositionTextBox.TabIndex = 9; this.PathNodePositionTextBox.TextChanged += new System.EventHandler(this.PathNodePositionTextBox_TextChanged); // // label55 // this.label55.AutoSize = true; - this.label55.Location = new System.Drawing.Point(25, 41); + this.label55.Location = new System.Drawing.Point(38, 63); + this.label55.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label55.Name = "label55"; - this.label55.Size = new System.Drawing.Size(47, 13); + this.label55.Size = new System.Drawing.Size(69, 20); this.label55.TabIndex = 28; this.label55.Text = "Position:"; // // PathNodeLinksTabPage // this.PathNodeLinksTabPage.Controls.Add(this.splitContainer2); - this.PathNodeLinksTabPage.Location = new System.Drawing.Point(4, 22); + this.PathNodeLinksTabPage.Location = new System.Drawing.Point(4, 29); + this.PathNodeLinksTabPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinksTabPage.Name = "PathNodeLinksTabPage"; - this.PathNodeLinksTabPage.Padding = new System.Windows.Forms.Padding(3); - this.PathNodeLinksTabPage.Size = new System.Drawing.Size(511, 421); + this.PathNodeLinksTabPage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeLinksTabPage.Size = new System.Drawing.Size(901, 672); this.PathNodeLinksTabPage.TabIndex = 0; this.PathNodeLinksTabPage.Text = "Path Links"; this.PathNodeLinksTabPage.UseVisualStyleBackColor = true; @@ -1024,7 +1068,8 @@ // this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this.splitContainer2.Location = new System.Drawing.Point(3, 3); + this.splitContainer2.Location = new System.Drawing.Point(4, 5); + this.splitContainer2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.splitContainer2.Name = "splitContainer2"; // // splitContainer2.Panel1 @@ -1037,16 +1082,18 @@ // splitContainer2.Panel2 // this.splitContainer2.Panel2.Controls.Add(this.PathNodeLinkPanel); - this.splitContainer2.Size = new System.Drawing.Size(505, 415); + this.splitContainer2.Size = new System.Drawing.Size(893, 662); this.splitContainer2.SplitterDistance = 168; + this.splitContainer2.SplitterWidth = 6; this.splitContainer2.TabIndex = 0; // // PathNodeRemoveLinkButton // this.PathNodeRemoveLinkButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.PathNodeRemoveLinkButton.Location = new System.Drawing.Point(85, 389); + this.PathNodeRemoveLinkButton.Location = new System.Drawing.Point(128, 622); + this.PathNodeRemoveLinkButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeRemoveLinkButton.Name = "PathNodeRemoveLinkButton"; - this.PathNodeRemoveLinkButton.Size = new System.Drawing.Size(76, 23); + this.PathNodeRemoveLinkButton.Size = new System.Drawing.Size(114, 35); this.PathNodeRemoveLinkButton.TabIndex = 2; this.PathNodeRemoveLinkButton.Text = "Remove"; this.PathNodeRemoveLinkButton.UseVisualStyleBackColor = true; @@ -1055,9 +1102,10 @@ // PathNodeAddLinkButton // this.PathNodeAddLinkButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.PathNodeAddLinkButton.Location = new System.Drawing.Point(3, 389); + this.PathNodeAddLinkButton.Location = new System.Drawing.Point(4, 622); + this.PathNodeAddLinkButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeAddLinkButton.Name = "PathNodeAddLinkButton"; - this.PathNodeAddLinkButton.Size = new System.Drawing.Size(76, 23); + this.PathNodeAddLinkButton.Size = new System.Drawing.Size(114, 35); this.PathNodeAddLinkButton.TabIndex = 1; this.PathNodeAddLinkButton.Text = "Add"; this.PathNodeAddLinkButton.UseVisualStyleBackColor = true; @@ -1069,9 +1117,11 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.PathNodeLinksListBox.FormattingEnabled = true; + this.PathNodeLinksListBox.ItemHeight = 20; this.PathNodeLinksListBox.Location = new System.Drawing.Point(0, 0); + this.PathNodeLinksListBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinksListBox.Name = "PathNodeLinksListBox"; - this.PathNodeLinksListBox.Size = new System.Drawing.Size(165, 329); + this.PathNodeLinksListBox.Size = new System.Drawing.Size(162, 504); this.PathNodeLinksListBox.TabIndex = 0; this.PathNodeLinksListBox.SelectedIndexChanged += new System.EventHandler(this.PathNodeLinksListBox_SelectedIndexChanged); // @@ -1079,14 +1129,16 @@ // this.PathNodeLinkCountLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.PathNodeLinkCountLabel.AutoSize = true; - this.PathNodeLinkCountLabel.Location = new System.Drawing.Point(3, 373); + this.PathNodeLinkCountLabel.Location = new System.Drawing.Point(4, 598); + this.PathNodeLinkCountLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeLinkCountLabel.Name = "PathNodeLinkCountLabel"; - this.PathNodeLinkCountLabel.Size = new System.Drawing.Size(70, 13); + this.PathNodeLinkCountLabel.Size = new System.Drawing.Size(102, 20); this.PathNodeLinkCountLabel.TabIndex = 31; this.PathNodeLinkCountLabel.Text = "Link Count: 0"; // // PathNodeLinkPanel // + this.PathNodeLinkPanel.Controls.Add(this.PathNodeSelectPartnerButton); this.PathNodeLinkPanel.Controls.Add(this.PathLinkFlags2GroupBox); this.PathNodeLinkPanel.Controls.Add(this.PathLinkFlags1GroupBox); this.PathNodeLinkPanel.Controls.Add(this.PathLinkFlags0GroupBox); @@ -1100,10 +1152,21 @@ this.PathNodeLinkPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.PathNodeLinkPanel.Enabled = false; this.PathNodeLinkPanel.Location = new System.Drawing.Point(0, 0); + this.PathNodeLinkPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkPanel.Name = "PathNodeLinkPanel"; - this.PathNodeLinkPanel.Size = new System.Drawing.Size(333, 415); + this.PathNodeLinkPanel.Size = new System.Drawing.Size(719, 662); this.PathNodeLinkPanel.TabIndex = 0; // + // PathNodeSelectPartnerButton + // + this.PathNodeSelectPartnerButton.Location = new System.Drawing.Point(327, 553); + this.PathNodeSelectPartnerButton.Name = "PathNodeSelectPartnerButton"; + this.PathNodeSelectPartnerButton.Size = new System.Drawing.Size(125, 39); + this.PathNodeSelectPartnerButton.TabIndex = 19; + this.PathNodeSelectPartnerButton.Text = "Select Partner"; + this.PathNodeSelectPartnerButton.UseVisualStyleBackColor = true; + this.PathNodeSelectPartnerButton.Click += new System.EventHandler(this.PathNodeSelectPartnerButton_Click); + // // PathLinkFlags2GroupBox // this.PathLinkFlags2GroupBox.Controls.Add(this.PathNodeLinkFlags21CheckBox); @@ -1114,9 +1177,11 @@ this.PathLinkFlags2GroupBox.Controls.Add(this.PathNodeLinkBackLanesUpDown); this.PathLinkFlags2GroupBox.Controls.Add(this.PathNodeLinkFlags2UpDown); this.PathLinkFlags2GroupBox.Controls.Add(this.PathNodeLinkFlags2Label); - this.PathLinkFlags2GroupBox.Location = new System.Drawing.Point(13, 240); + this.PathLinkFlags2GroupBox.Location = new System.Drawing.Point(20, 369); + this.PathLinkFlags2GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathLinkFlags2GroupBox.Name = "PathLinkFlags2GroupBox"; - this.PathLinkFlags2GroupBox.Size = new System.Drawing.Size(141, 145); + this.PathLinkFlags2GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathLinkFlags2GroupBox.Size = new System.Drawing.Size(220, 223); this.PathLinkFlags2GroupBox.TabIndex = 18; this.PathLinkFlags2GroupBox.TabStop = false; this.PathLinkFlags2GroupBox.Text = "Flags 2"; @@ -1124,170 +1189,186 @@ // PathNodeLinkFlags21CheckBox // this.PathNodeLinkFlags21CheckBox.AutoSize = true; - this.PathNodeLinkFlags21CheckBox.Location = new System.Drawing.Point(6, 45); + this.PathNodeLinkFlags21CheckBox.Location = new System.Drawing.Point(9, 69); + this.PathNodeLinkFlags21CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags21CheckBox.Name = "PathNodeLinkFlags21CheckBox"; - this.PathNodeLinkFlags21CheckBox.Size = new System.Drawing.Size(123, 17); + this.PathNodeLinkFlags21CheckBox.Size = new System.Drawing.Size(212, 24); this.PathNodeLinkFlags21CheckBox.TabIndex = 33; - this.PathNodeLinkFlags21CheckBox.Text = "Angled/merged links"; + this.PathNodeLinkFlags21CheckBox.Text = "Don\'t Use For Navigation"; this.PathNodeLinkFlags21CheckBox.UseVisualStyleBackColor = true; this.PathNodeLinkFlags21CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags21CheckBox_CheckedChanged); // // PathNodeLinkFlags22CheckBox // this.PathNodeLinkFlags22CheckBox.AutoSize = true; - this.PathNodeLinkFlags22CheckBox.Location = new System.Drawing.Point(6, 66); + this.PathNodeLinkFlags22CheckBox.Location = new System.Drawing.Point(9, 102); + this.PathNodeLinkFlags22CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags22CheckBox.Name = "PathNodeLinkFlags22CheckBox"; - this.PathNodeLinkFlags22CheckBox.Size = new System.Drawing.Size(129, 17); + this.PathNodeLinkFlags22CheckBox.Size = new System.Drawing.Size(96, 24); this.PathNodeLinkFlags22CheckBox.TabIndex = 34; - this.PathNodeLinkFlags22CheckBox.Text = "Lane change / U-turn"; + this.PathNodeLinkFlags22CheckBox.Text = "Shortcut"; this.PathNodeLinkFlags22CheckBox.UseVisualStyleBackColor = true; this.PathNodeLinkFlags22CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags22CheckBox_CheckedChanged); // // label53 // this.label53.AutoSize = true; - this.label53.Location = new System.Drawing.Point(7, 118); + this.label53.Location = new System.Drawing.Point(10, 182); + this.label53.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label53.Name = "label53"; - this.label53.Size = new System.Drawing.Size(58, 13); + this.label53.Size = new System.Drawing.Size(85, 20); this.label53.TabIndex = 37; this.label53.Text = "Fwd lanes:"; // // PathNodeLinkFwdLanesUpDown // - this.PathNodeLinkFwdLanesUpDown.Location = new System.Drawing.Point(71, 116); + this.PathNodeLinkFwdLanesUpDown.Location = new System.Drawing.Point(106, 178); + this.PathNodeLinkFwdLanesUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFwdLanesUpDown.Maximum = new decimal(new int[] { 7, 0, 0, 0}); this.PathNodeLinkFwdLanesUpDown.Name = "PathNodeLinkFwdLanesUpDown"; - this.PathNodeLinkFwdLanesUpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeLinkFwdLanesUpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeLinkFwdLanesUpDown.TabIndex = 38; this.PathNodeLinkFwdLanesUpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkFwdLanesUpDown_ValueChanged); // // label56 // this.label56.AutoSize = true; - this.label56.Location = new System.Drawing.Point(3, 92); + this.label56.Location = new System.Drawing.Point(4, 142); + this.label56.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label56.Name = "label56"; - this.label56.Size = new System.Drawing.Size(63, 13); + this.label56.Size = new System.Drawing.Size(91, 20); this.label56.TabIndex = 35; this.label56.Text = "Back lanes:"; // // PathNodeLinkBackLanesUpDown // - this.PathNodeLinkBackLanesUpDown.Location = new System.Drawing.Point(72, 90); + this.PathNodeLinkBackLanesUpDown.Location = new System.Drawing.Point(108, 138); + this.PathNodeLinkBackLanesUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkBackLanesUpDown.Maximum = new decimal(new int[] { 7, 0, 0, 0}); this.PathNodeLinkBackLanesUpDown.Name = "PathNodeLinkBackLanesUpDown"; - this.PathNodeLinkBackLanesUpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeLinkBackLanesUpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeLinkBackLanesUpDown.TabIndex = 36; this.PathNodeLinkBackLanesUpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkBackLanesUpDown_ValueChanged); // // PathNodeLinkFlags2UpDown // - this.PathNodeLinkFlags2UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeLinkFlags2UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeLinkFlags2UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags2UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeLinkFlags2UpDown.Name = "PathNodeLinkFlags2UpDown"; - this.PathNodeLinkFlags2UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeLinkFlags2UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeLinkFlags2UpDown.TabIndex = 31; this.PathNodeLinkFlags2UpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkFlags2UpDown_ValueChanged); // // PathNodeLinkFlags2Label // this.PathNodeLinkFlags2Label.AutoSize = true; - this.PathNodeLinkFlags2Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeLinkFlags2Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeLinkFlags2Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeLinkFlags2Label.Name = "PathNodeLinkFlags2Label"; - this.PathNodeLinkFlags2Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeLinkFlags2Label.Size = new System.Drawing.Size(43, 20); this.PathNodeLinkFlags2Label.TabIndex = 32; this.PathNodeLinkFlags2Label.Text = "0x00"; // // PathLinkFlags1GroupBox // + this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags18CheckBox); this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkOffsetSizeUpDown); this.PathLinkFlags1GroupBox.Controls.Add(this.label61); this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags11CheckBox); - this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags18CheckBox); this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags12CheckBox); this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags13CheckBox); this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags14CheckBox); this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags1UpDown); this.PathLinkFlags1GroupBox.Controls.Add(this.PathNodeLinkFlags1Label); - this.PathLinkFlags1GroupBox.Location = new System.Drawing.Point(165, 93); + this.PathLinkFlags1GroupBox.Location = new System.Drawing.Point(252, 143); + this.PathLinkFlags1GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathLinkFlags1GroupBox.Name = "PathLinkFlags1GroupBox"; - this.PathLinkFlags1GroupBox.Size = new System.Drawing.Size(133, 181); + this.PathLinkFlags1GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathLinkFlags1GroupBox.Size = new System.Drawing.Size(187, 278); this.PathLinkFlags1GroupBox.TabIndex = 17; this.PathLinkFlags1GroupBox.TabStop = false; this.PathLinkFlags1GroupBox.Text = "Flags 1"; // + // PathNodeLinkFlags18CheckBox + // + this.PathNodeLinkFlags18CheckBox.AutoSize = true; + this.PathNodeLinkFlags18CheckBox.Location = new System.Drawing.Point(9, 200); + this.PathNodeLinkFlags18CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeLinkFlags18CheckBox.Name = "PathNodeLinkFlags18CheckBox"; + this.PathNodeLinkFlags18CheckBox.Size = new System.Drawing.Size(145, 24); + this.PathNodeLinkFlags18CheckBox.TabIndex = 40; + this.PathNodeLinkFlags18CheckBox.Text = "Negative Offset"; + this.PathNodeLinkFlags18CheckBox.UseVisualStyleBackColor = true; + this.PathNodeLinkFlags18CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags18CheckBox_CheckedChanged); + // // PathNodeLinkOffsetSizeUpDown // - this.PathNodeLinkOffsetSizeUpDown.Location = new System.Drawing.Point(70, 152); + this.PathNodeLinkOffsetSizeUpDown.Location = new System.Drawing.Point(68, 234); + this.PathNodeLinkOffsetSizeUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkOffsetSizeUpDown.Maximum = new decimal(new int[] { 7, 0, 0, 0}); this.PathNodeLinkOffsetSizeUpDown.Name = "PathNodeLinkOffsetSizeUpDown"; - this.PathNodeLinkOffsetSizeUpDown.Size = new System.Drawing.Size(57, 20); + this.PathNodeLinkOffsetSizeUpDown.Size = new System.Drawing.Size(86, 26); this.PathNodeLinkOffsetSizeUpDown.TabIndex = 39; this.PathNodeLinkOffsetSizeUpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkOffsetSizeUpDown_ValueChanged); // // label61 // this.label61.AutoSize = true; - this.label61.Location = new System.Drawing.Point(6, 154); + this.label61.Location = new System.Drawing.Point(9, 236); + this.label61.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label61.Name = "label61"; - this.label61.Size = new System.Drawing.Size(59, 13); + this.label61.Size = new System.Drawing.Size(57, 20); this.label61.TabIndex = 38; - this.label61.Text = "Offset size:"; + this.label61.Text = "Offset:"; // // PathNodeLinkFlags11CheckBox // this.PathNodeLinkFlags11CheckBox.AutoSize = true; - this.PathNodeLinkFlags11CheckBox.Location = new System.Drawing.Point(6, 45); + this.PathNodeLinkFlags11CheckBox.Location = new System.Drawing.Point(9, 69); + this.PathNodeLinkFlags11CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags11CheckBox.Name = "PathNodeLinkFlags11CheckBox"; - this.PathNodeLinkFlags11CheckBox.Size = new System.Drawing.Size(72, 17); + this.PathNodeLinkFlags11CheckBox.Size = new System.Drawing.Size(104, 24); this.PathNodeLinkFlags11CheckBox.TabIndex = 30; this.PathNodeLinkFlags11CheckBox.Text = "Unused 1"; this.PathNodeLinkFlags11CheckBox.UseVisualStyleBackColor = true; this.PathNodeLinkFlags11CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags11CheckBox_CheckedChanged); // - // PathNodeLinkFlags18CheckBox - // - this.PathNodeLinkFlags18CheckBox.AutoSize = true; - this.PathNodeLinkFlags18CheckBox.Location = new System.Drawing.Point(6, 129); - this.PathNodeLinkFlags18CheckBox.Name = "PathNodeLinkFlags18CheckBox"; - this.PathNodeLinkFlags18CheckBox.Size = new System.Drawing.Size(98, 17); - this.PathNodeLinkFlags18CheckBox.TabIndex = 37; - this.PathNodeLinkFlags18CheckBox.Text = "Negative offset"; - this.PathNodeLinkFlags18CheckBox.UseVisualStyleBackColor = true; - this.PathNodeLinkFlags18CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags18CheckBox_CheckedChanged); - // // PathNodeLinkFlags12CheckBox // this.PathNodeLinkFlags12CheckBox.AutoSize = true; - this.PathNodeLinkFlags12CheckBox.Location = new System.Drawing.Point(6, 66); + this.PathNodeLinkFlags12CheckBox.Location = new System.Drawing.Point(9, 102); + this.PathNodeLinkFlags12CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags12CheckBox.Name = "PathNodeLinkFlags12CheckBox"; - this.PathNodeLinkFlags12CheckBox.Size = new System.Drawing.Size(81, 17); + this.PathNodeLinkFlags12CheckBox.Size = new System.Drawing.Size(128, 24); this.PathNodeLinkFlags12CheckBox.TabIndex = 31; - this.PathNodeLinkFlags12CheckBox.Text = "Unknown 1"; + this.PathNodeLinkFlags12CheckBox.Text = "Narrow Road"; this.PathNodeLinkFlags12CheckBox.UseVisualStyleBackColor = true; this.PathNodeLinkFlags12CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags12CheckBox_CheckedChanged); // // PathNodeLinkFlags13CheckBox // this.PathNodeLinkFlags13CheckBox.AutoSize = true; - this.PathNodeLinkFlags13CheckBox.Location = new System.Drawing.Point(6, 87); + this.PathNodeLinkFlags13CheckBox.Location = new System.Drawing.Point(9, 134); + this.PathNodeLinkFlags13CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags13CheckBox.Name = "PathNodeLinkFlags13CheckBox"; - this.PathNodeLinkFlags13CheckBox.Size = new System.Drawing.Size(73, 17); + this.PathNodeLinkFlags13CheckBox.Size = new System.Drawing.Size(105, 24); this.PathNodeLinkFlags13CheckBox.TabIndex = 32; this.PathNodeLinkFlags13CheckBox.Text = "Dead end"; this.PathNodeLinkFlags13CheckBox.UseVisualStyleBackColor = true; @@ -1296,9 +1377,10 @@ // PathNodeLinkFlags14CheckBox // this.PathNodeLinkFlags14CheckBox.AutoSize = true; - this.PathNodeLinkFlags14CheckBox.Location = new System.Drawing.Point(6, 108); + this.PathNodeLinkFlags14CheckBox.Location = new System.Drawing.Point(9, 166); + this.PathNodeLinkFlags14CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags14CheckBox.Name = "PathNodeLinkFlags14CheckBox"; - this.PathNodeLinkFlags14CheckBox.Size = new System.Drawing.Size(92, 17); + this.PathNodeLinkFlags14CheckBox.Size = new System.Drawing.Size(133, 24); this.PathNodeLinkFlags14CheckBox.TabIndex = 33; this.PathNodeLinkFlags14CheckBox.Text = "Dead end exit"; this.PathNodeLinkFlags14CheckBox.UseVisualStyleBackColor = true; @@ -1306,23 +1388,25 @@ // // PathNodeLinkFlags1UpDown // - this.PathNodeLinkFlags1UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeLinkFlags1UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeLinkFlags1UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags1UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeLinkFlags1UpDown.Name = "PathNodeLinkFlags1UpDown"; - this.PathNodeLinkFlags1UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeLinkFlags1UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeLinkFlags1UpDown.TabIndex = 28; this.PathNodeLinkFlags1UpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkFlags1UpDown_ValueChanged); // // PathNodeLinkFlags1Label // this.PathNodeLinkFlags1Label.AutoSize = true; - this.PathNodeLinkFlags1Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeLinkFlags1Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeLinkFlags1Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeLinkFlags1Label.Name = "PathNodeLinkFlags1Label"; - this.PathNodeLinkFlags1Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeLinkFlags1Label.Size = new System.Drawing.Size(43, 20); this.PathNodeLinkFlags1Label.TabIndex = 29; this.PathNodeLinkFlags1Label.Text = "0x00"; // @@ -1336,172 +1420,189 @@ this.PathLinkFlags0GroupBox.Controls.Add(this.PathNodeLinkFlags02CheckBox); this.PathLinkFlags0GroupBox.Controls.Add(this.PathNodeLinkFlags0UpDown); this.PathLinkFlags0GroupBox.Controls.Add(this.PathNodeLinkFlags0Label); - this.PathLinkFlags0GroupBox.Location = new System.Drawing.Point(13, 93); + this.PathLinkFlags0GroupBox.Location = new System.Drawing.Point(20, 143); + this.PathLinkFlags0GroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathLinkFlags0GroupBox.Name = "PathLinkFlags0GroupBox"; - this.PathLinkFlags0GroupBox.Size = new System.Drawing.Size(141, 141); + this.PathLinkFlags0GroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathLinkFlags0GroupBox.Size = new System.Drawing.Size(221, 217); this.PathLinkFlags0GroupBox.TabIndex = 16; this.PathLinkFlags0GroupBox.TabStop = false; this.PathLinkFlags0GroupBox.Text = "Flags 0"; // // PathNodeLinkFlags04UpDown // - this.PathNodeLinkFlags04UpDown.Location = new System.Drawing.Point(71, 112); + this.PathNodeLinkFlags04UpDown.Location = new System.Drawing.Point(106, 172); + this.PathNodeLinkFlags04UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags04UpDown.Maximum = new decimal(new int[] { 7, 0, 0, 0}); this.PathNodeLinkFlags04UpDown.Name = "PathNodeLinkFlags04UpDown"; - this.PathNodeLinkFlags04UpDown.Size = new System.Drawing.Size(57, 20); + this.PathNodeLinkFlags04UpDown.Size = new System.Drawing.Size(86, 26); this.PathNodeLinkFlags04UpDown.TabIndex = 32; this.PathNodeLinkFlags04UpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkFlags04UpDown_ValueChanged); // // label60 // this.label60.AutoSize = true; - this.label60.Location = new System.Drawing.Point(26, 114); + this.label60.Location = new System.Drawing.Point(39, 175); + this.label60.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label60.Name = "label60"; - this.label60.Size = new System.Drawing.Size(39, 13); + this.label60.Size = new System.Drawing.Size(55, 20); this.label60.TabIndex = 31; this.label60.Text = "Unk 2:"; // // PathNodeLinkFlags03UpDown // - this.PathNodeLinkFlags03UpDown.Location = new System.Drawing.Point(71, 88); + this.PathNodeLinkFlags03UpDown.Location = new System.Drawing.Point(106, 135); + this.PathNodeLinkFlags03UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags03UpDown.Maximum = new decimal(new int[] { 7, 0, 0, 0}); this.PathNodeLinkFlags03UpDown.Name = "PathNodeLinkFlags03UpDown"; - this.PathNodeLinkFlags03UpDown.Size = new System.Drawing.Size(57, 20); + this.PathNodeLinkFlags03UpDown.Size = new System.Drawing.Size(86, 26); this.PathNodeLinkFlags03UpDown.TabIndex = 30; this.PathNodeLinkFlags03UpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkFlags03UpDown_ValueChanged); // // label58 // this.label58.AutoSize = true; - this.label58.Location = new System.Drawing.Point(26, 90); + this.label58.Location = new System.Drawing.Point(39, 138); + this.label58.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label58.Name = "label58"; - this.label58.Size = new System.Drawing.Size(39, 13); + this.label58.Size = new System.Drawing.Size(55, 20); this.label58.TabIndex = 29; this.label58.Text = "Unk 1:"; // // PathNodeLinkFlags01CheckBox // this.PathNodeLinkFlags01CheckBox.AutoSize = true; - this.PathNodeLinkFlags01CheckBox.Location = new System.Drawing.Point(6, 45); + this.PathNodeLinkFlags01CheckBox.Location = new System.Drawing.Point(9, 69); + this.PathNodeLinkFlags01CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags01CheckBox.Name = "PathNodeLinkFlags01CheckBox"; - this.PathNodeLinkFlags01CheckBox.Size = new System.Drawing.Size(70, 17); + this.PathNodeLinkFlags01CheckBox.Size = new System.Drawing.Size(150, 24); this.PathNodeLinkFlags01CheckBox.TabIndex = 27; - this.PathNodeLinkFlags01CheckBox.Text = "Special 1"; + this.PathNodeLinkFlags01CheckBox.Text = "GPS Both Ways"; this.PathNodeLinkFlags01CheckBox.UseVisualStyleBackColor = true; this.PathNodeLinkFlags01CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags01CheckBox_CheckedChanged); // // PathNodeLinkFlags02CheckBox // this.PathNodeLinkFlags02CheckBox.AutoSize = true; - this.PathNodeLinkFlags02CheckBox.Location = new System.Drawing.Point(6, 66); + this.PathNodeLinkFlags02CheckBox.Location = new System.Drawing.Point(9, 102); + this.PathNodeLinkFlags02CheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags02CheckBox.Name = "PathNodeLinkFlags02CheckBox"; - this.PathNodeLinkFlags02CheckBox.Size = new System.Drawing.Size(86, 17); + this.PathNodeLinkFlags02CheckBox.Size = new System.Drawing.Size(217, 24); this.PathNodeLinkFlags02CheckBox.TabIndex = 28; - this.PathNodeLinkFlags02CheckBox.Text = "Scripted unk"; + this.PathNodeLinkFlags02CheckBox.Text = "Block if no lanes (no func)"; this.PathNodeLinkFlags02CheckBox.UseVisualStyleBackColor = true; this.PathNodeLinkFlags02CheckBox.CheckedChanged += new System.EventHandler(this.PathNodeLinkFlags02CheckBox_CheckedChanged); // // PathNodeLinkFlags0UpDown // - this.PathNodeLinkFlags0UpDown.Location = new System.Drawing.Point(6, 19); + this.PathNodeLinkFlags0UpDown.Location = new System.Drawing.Point(9, 29); + this.PathNodeLinkFlags0UpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkFlags0UpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeLinkFlags0UpDown.Name = "PathNodeLinkFlags0UpDown"; - this.PathNodeLinkFlags0UpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeLinkFlags0UpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeLinkFlags0UpDown.TabIndex = 25; this.PathNodeLinkFlags0UpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkFlags0UpDown_ValueChanged); // // PathNodeLinkFlags0Label // this.PathNodeLinkFlags0Label.AutoSize = true; - this.PathNodeLinkFlags0Label.Location = new System.Drawing.Point(74, 21); + this.PathNodeLinkFlags0Label.Location = new System.Drawing.Point(111, 32); + this.PathNodeLinkFlags0Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeLinkFlags0Label.Name = "PathNodeLinkFlags0Label"; - this.PathNodeLinkFlags0Label.Size = new System.Drawing.Size(30, 13); + this.PathNodeLinkFlags0Label.Size = new System.Drawing.Size(43, 20); this.PathNodeLinkFlags0Label.TabIndex = 26; this.PathNodeLinkFlags0Label.Text = "0x00"; // // PathNodeLinkageStatusLabel // this.PathNodeLinkageStatusLabel.AutoSize = true; - this.PathNodeLinkageStatusLabel.Location = new System.Drawing.Point(74, 33); + this.PathNodeLinkageStatusLabel.Location = new System.Drawing.Point(111, 51); + this.PathNodeLinkageStatusLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathNodeLinkageStatusLabel.Name = "PathNodeLinkageStatusLabel"; - this.PathNodeLinkageStatusLabel.Size = new System.Drawing.Size(10, 13); + this.PathNodeLinkageStatusLabel.Size = new System.Drawing.Size(14, 20); this.PathNodeLinkageStatusLabel.TabIndex = 13; this.PathNodeLinkageStatusLabel.Text = "-"; // // PathNodeLinkLengthUpDown // - this.PathNodeLinkLengthUpDown.Location = new System.Drawing.Point(74, 57); + this.PathNodeLinkLengthUpDown.Location = new System.Drawing.Point(111, 88); + this.PathNodeLinkLengthUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkLengthUpDown.Maximum = new decimal(new int[] { 255, 0, 0, 0}); this.PathNodeLinkLengthUpDown.Name = "PathNodeLinkLengthUpDown"; - this.PathNodeLinkLengthUpDown.Size = new System.Drawing.Size(74, 20); + this.PathNodeLinkLengthUpDown.Size = new System.Drawing.Size(111, 26); this.PathNodeLinkLengthUpDown.TabIndex = 15; // // label57 // this.label57.AutoSize = true; - this.label57.Location = new System.Drawing.Point(6, 59); + this.label57.Location = new System.Drawing.Point(9, 91); + this.label57.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label57.Name = "label57"; - this.label57.Size = new System.Drawing.Size(62, 13); + this.label57.Size = new System.Drawing.Size(90, 20); this.label57.TabIndex = 14; this.label57.Text = "Link length:"; // // PathNodeLinkNodeIDUpDown // - this.PathNodeLinkNodeIDUpDown.Location = new System.Drawing.Point(219, 8); + this.PathNodeLinkNodeIDUpDown.Location = new System.Drawing.Point(328, 12); + this.PathNodeLinkNodeIDUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkNodeIDUpDown.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); this.PathNodeLinkNodeIDUpDown.Name = "PathNodeLinkNodeIDUpDown"; - this.PathNodeLinkNodeIDUpDown.Size = new System.Drawing.Size(74, 20); + this.PathNodeLinkNodeIDUpDown.Size = new System.Drawing.Size(111, 26); this.PathNodeLinkNodeIDUpDown.TabIndex = 12; this.PathNodeLinkNodeIDUpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkNodeIDUpDown_ValueChanged); // // label51 // this.label51.AutoSize = true; - this.label51.Location = new System.Drawing.Point(163, 10); + this.label51.Location = new System.Drawing.Point(244, 15); + this.label51.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label51.Name = "label51"; - this.label51.Size = new System.Drawing.Size(50, 13); + this.label51.Size = new System.Drawing.Size(72, 20); this.label51.TabIndex = 11; this.label51.Text = "Node ID:"; // // PathNodeLinkAreaIDUpDown // - this.PathNodeLinkAreaIDUpDown.Location = new System.Drawing.Point(74, 8); + this.PathNodeLinkAreaIDUpDown.Location = new System.Drawing.Point(111, 12); + this.PathNodeLinkAreaIDUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeLinkAreaIDUpDown.Maximum = new decimal(new int[] { 1023, 0, 0, 0}); this.PathNodeLinkAreaIDUpDown.Name = "PathNodeLinkAreaIDUpDown"; - this.PathNodeLinkAreaIDUpDown.Size = new System.Drawing.Size(74, 20); + this.PathNodeLinkAreaIDUpDown.Size = new System.Drawing.Size(111, 26); this.PathNodeLinkAreaIDUpDown.TabIndex = 10; this.PathNodeLinkAreaIDUpDown.ValueChanged += new System.EventHandler(this.PathNodeLinkAreaIDUpDown_ValueChanged); // // label54 // this.label54.AutoSize = true; - this.label54.Location = new System.Drawing.Point(22, 10); + this.label54.Location = new System.Drawing.Point(33, 15); + this.label54.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label54.Name = "label54"; - this.label54.Size = new System.Drawing.Size(46, 13); + this.label54.Size = new System.Drawing.Size(68, 20); this.label54.TabIndex = 9; this.label54.Text = "Area ID:"; // @@ -1510,10 +1611,11 @@ this.PathNodeJunctionTabPage.Controls.Add(this.label78); this.PathNodeJunctionTabPage.Controls.Add(this.PathNodeJunctionPanel); this.PathNodeJunctionTabPage.Controls.Add(this.PathNodeJunctionEnableCheckBox); - this.PathNodeJunctionTabPage.Location = new System.Drawing.Point(4, 22); + this.PathNodeJunctionTabPage.Location = new System.Drawing.Point(4, 29); + this.PathNodeJunctionTabPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionTabPage.Name = "PathNodeJunctionTabPage"; - this.PathNodeJunctionTabPage.Padding = new System.Windows.Forms.Padding(3); - this.PathNodeJunctionTabPage.Size = new System.Drawing.Size(511, 421); + this.PathNodeJunctionTabPage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.PathNodeJunctionTabPage.Size = new System.Drawing.Size(901, 672); this.PathNodeJunctionTabPage.TabIndex = 1; this.PathNodeJunctionTabPage.Text = "Junction"; this.PathNodeJunctionTabPage.UseVisualStyleBackColor = true; @@ -1521,9 +1623,10 @@ // label78 // this.label78.AutoSize = true; - this.label78.Location = new System.Drawing.Point(182, 7); + this.label78.Location = new System.Drawing.Point(273, 11); + this.label78.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label78.Name = "label78"; - this.label78.Size = new System.Drawing.Size(113, 13); + this.label78.Size = new System.Drawing.Size(168, 20); this.label78.TabIndex = 51; this.label78.Text = "Height map byte array:"; // @@ -1532,6 +1635,7 @@ this.PathNodeJunctionPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.PathNodeJunctionPanel.Controls.Add(this.YndNodeJunctionGenerateButton); this.PathNodeJunctionPanel.Controls.Add(this.PathNodeJunctionPosYUpDown); this.PathNodeJunctionPanel.Controls.Add(this.label59); this.PathNodeJunctionPanel.Controls.Add(this.PathNodeJunctionPosXUpDown); @@ -1546,62 +1650,89 @@ this.PathNodeJunctionPanel.Controls.Add(this.PathNodeJunctionMaxZUpDown); this.PathNodeJunctionPanel.Controls.Add(this.label65); this.PathNodeJunctionPanel.Enabled = false; - this.PathNodeJunctionPanel.Location = new System.Drawing.Point(6, 29); + this.PathNodeJunctionPanel.Location = new System.Drawing.Point(9, 45); + this.PathNodeJunctionPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionPanel.Name = "PathNodeJunctionPanel"; - this.PathNodeJunctionPanel.Size = new System.Drawing.Size(490, 379); + this.PathNodeJunctionPanel.Size = new System.Drawing.Size(735, 583); this.PathNodeJunctionPanel.TabIndex = 1; // + // YndNodeJunctionGenerateButton + // + this.YndNodeJunctionGenerateButton.Location = new System.Drawing.Point(86, 266); + this.YndNodeJunctionGenerateButton.Name = "YndNodeJunctionGenerateButton"; + this.YndNodeJunctionGenerateButton.Size = new System.Drawing.Size(129, 51); + this.YndNodeJunctionGenerateButton.TabIndex = 55; + this.YndNodeJunctionGenerateButton.Text = "Generate"; + this.YndNodeJunctionGenerateButton.UseVisualStyleBackColor = true; + this.YndNodeJunctionGenerateButton.Click += new System.EventHandler(this.YndNodeJunctionGenerateButton_Click); + // // PathNodeJunctionPosYUpDown // - this.PathNodeJunctionPosYUpDown.Location = new System.Drawing.Point(57, 81); + this.PathNodeJunctionPosYUpDown.DecimalPlaces = 5; + this.PathNodeJunctionPosYUpDown.Increment = new decimal(new int[] { + 3125, + 0, + 0, + 327680}); + this.PathNodeJunctionPosYUpDown.Location = new System.Drawing.Point(86, 125); + this.PathNodeJunctionPosYUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionPosYUpDown.Maximum = new decimal(new int[] { - 32767, + 102396875, 0, 0, - 0}); + 327680}); this.PathNodeJunctionPosYUpDown.Minimum = new decimal(new int[] { - 32768, + 102396875, 0, 0, - -2147483648}); + -2147155968}); this.PathNodeJunctionPosYUpDown.Name = "PathNodeJunctionPosYUpDown"; - this.PathNodeJunctionPosYUpDown.Size = new System.Drawing.Size(86, 20); + this.PathNodeJunctionPosYUpDown.Size = new System.Drawing.Size(129, 26); this.PathNodeJunctionPosYUpDown.TabIndex = 53; this.PathNodeJunctionPosYUpDown.ValueChanged += new System.EventHandler(this.PathNodeJunctionPosYUpDown_ValueChanged); // // label59 // this.label59.AutoSize = true; - this.label59.Location = new System.Drawing.Point(13, 83); + this.label59.Location = new System.Drawing.Point(20, 128); + this.label59.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label59.Name = "label59"; - this.label59.Size = new System.Drawing.Size(38, 13); + this.label59.Size = new System.Drawing.Size(55, 20); this.label59.TabIndex = 54; this.label59.Text = "Pos Y:"; // // PathNodeJunctionPosXUpDown // - this.PathNodeJunctionPosXUpDown.Location = new System.Drawing.Point(57, 55); + this.PathNodeJunctionPosXUpDown.DecimalPlaces = 5; + this.PathNodeJunctionPosXUpDown.Increment = new decimal(new int[] { + 3125, + 0, + 0, + 327680}); + this.PathNodeJunctionPosXUpDown.Location = new System.Drawing.Point(86, 85); + this.PathNodeJunctionPosXUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionPosXUpDown.Maximum = new decimal(new int[] { - 32767, + 102396875, 0, 0, - 0}); + 327680}); this.PathNodeJunctionPosXUpDown.Minimum = new decimal(new int[] { - 32768, + 102396875, 0, 0, - -2147483648}); + -2147155968}); this.PathNodeJunctionPosXUpDown.Name = "PathNodeJunctionPosXUpDown"; - this.PathNodeJunctionPosXUpDown.Size = new System.Drawing.Size(86, 20); + this.PathNodeJunctionPosXUpDown.Size = new System.Drawing.Size(129, 26); this.PathNodeJunctionPosXUpDown.TabIndex = 51; this.PathNodeJunctionPosXUpDown.ValueChanged += new System.EventHandler(this.PathNodeJunctionPosXUpDown_ValueChanged); // // label69 // this.label69.AutoSize = true; - this.label69.Location = new System.Drawing.Point(13, 57); + this.label69.Location = new System.Drawing.Point(20, 88); + this.label69.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label69.Name = "label69"; - this.label69.Size = new System.Drawing.Size(38, 13); + this.label69.Size = new System.Drawing.Size(55, 20); this.label69.TabIndex = 52; this.label69.Text = "Pos X:"; // @@ -1610,18 +1741,20 @@ this.PathNodeJunctionHeightmapBytesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.PathNodeJunctionHeightmapBytesTextBox.Location = new System.Drawing.Point(159, 3); + this.PathNodeJunctionHeightmapBytesTextBox.Location = new System.Drawing.Point(238, 5); + this.PathNodeJunctionHeightmapBytesTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionHeightmapBytesTextBox.Multiline = true; this.PathNodeJunctionHeightmapBytesTextBox.Name = "PathNodeJunctionHeightmapBytesTextBox"; this.PathNodeJunctionHeightmapBytesTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.PathNodeJunctionHeightmapBytesTextBox.Size = new System.Drawing.Size(328, 373); + this.PathNodeJunctionHeightmapBytesTextBox.Size = new System.Drawing.Size(490, 572); this.PathNodeJunctionHeightmapBytesTextBox.TabIndex = 50; this.PathNodeJunctionHeightmapBytesTextBox.WordWrap = false; this.PathNodeJunctionHeightmapBytesTextBox.TextChanged += new System.EventHandler(this.PathNodeJunctionHeightmapBytesTextBox_TextChanged); // // PathNodeJunctionHeightmapDimYUpDown // - this.PathNodeJunctionHeightmapDimYUpDown.Location = new System.Drawing.Point(57, 133); + this.PathNodeJunctionHeightmapDimYUpDown.Location = new System.Drawing.Point(86, 205); + this.PathNodeJunctionHeightmapDimYUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionHeightmapDimYUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -1633,7 +1766,7 @@ 0, 0}); this.PathNodeJunctionHeightmapDimYUpDown.Name = "PathNodeJunctionHeightmapDimYUpDown"; - this.PathNodeJunctionHeightmapDimYUpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeJunctionHeightmapDimYUpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeJunctionHeightmapDimYUpDown.TabIndex = 49; this.PathNodeJunctionHeightmapDimYUpDown.Value = new decimal(new int[] { 1, @@ -1645,15 +1778,17 @@ // label77 // this.label77.AutoSize = true; - this.label77.Location = new System.Drawing.Point(11, 135); + this.label77.Location = new System.Drawing.Point(16, 208); + this.label77.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label77.Name = "label77"; - this.label77.Size = new System.Drawing.Size(40, 13); + this.label77.Size = new System.Drawing.Size(59, 20); this.label77.TabIndex = 48; this.label77.Text = "Size Y:"; // // PathNodeJunctionHeightmapDimXUpDown // - this.PathNodeJunctionHeightmapDimXUpDown.Location = new System.Drawing.Point(57, 107); + this.PathNodeJunctionHeightmapDimXUpDown.Location = new System.Drawing.Point(86, 165); + this.PathNodeJunctionHeightmapDimXUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionHeightmapDimXUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -1665,7 +1800,7 @@ 0, 0}); this.PathNodeJunctionHeightmapDimXUpDown.Name = "PathNodeJunctionHeightmapDimXUpDown"; - this.PathNodeJunctionHeightmapDimXUpDown.Size = new System.Drawing.Size(62, 20); + this.PathNodeJunctionHeightmapDimXUpDown.Size = new System.Drawing.Size(93, 26); this.PathNodeJunctionHeightmapDimXUpDown.TabIndex = 47; this.PathNodeJunctionHeightmapDimXUpDown.Value = new decimal(new int[] { 1, @@ -1677,72 +1812,90 @@ // label76 // this.label76.AutoSize = true; - this.label76.Location = new System.Drawing.Point(11, 109); + this.label76.Location = new System.Drawing.Point(16, 168); + this.label76.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label76.Name = "label76"; - this.label76.Size = new System.Drawing.Size(40, 13); + this.label76.Size = new System.Drawing.Size(59, 20); this.label76.TabIndex = 46; this.label76.Text = "Size X:"; // // PathNodeJunctionMinZUpDown // - this.PathNodeJunctionMinZUpDown.Location = new System.Drawing.Point(57, 29); + this.PathNodeJunctionMinZUpDown.DecimalPlaces = 5; + this.PathNodeJunctionMinZUpDown.Increment = new decimal(new int[] { + 3125, + 0, + 0, + 327680}); + this.PathNodeJunctionMinZUpDown.Location = new System.Drawing.Point(86, 45); + this.PathNodeJunctionMinZUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionMinZUpDown.Maximum = new decimal(new int[] { - 32767, + 102396875, 0, 0, - 0}); + 327680}); this.PathNodeJunctionMinZUpDown.Minimum = new decimal(new int[] { - 32768, + 102396875, 0, 0, - -2147483648}); + -2147155968}); this.PathNodeJunctionMinZUpDown.Name = "PathNodeJunctionMinZUpDown"; - this.PathNodeJunctionMinZUpDown.Size = new System.Drawing.Size(86, 20); + this.PathNodeJunctionMinZUpDown.Size = new System.Drawing.Size(129, 26); this.PathNodeJunctionMinZUpDown.TabIndex = 32; this.PathNodeJunctionMinZUpDown.ValueChanged += new System.EventHandler(this.PathNodeJunctionMinZUpDown_ValueChanged); // // label67 // this.label67.AutoSize = true; - this.label67.Location = new System.Drawing.Point(14, 32); + this.label67.Location = new System.Drawing.Point(21, 49); + this.label67.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label67.Name = "label67"; - this.label67.Size = new System.Drawing.Size(37, 13); + this.label67.Size = new System.Drawing.Size(52, 20); this.label67.TabIndex = 33; this.label67.Text = "Min Z:"; // // PathNodeJunctionMaxZUpDown // - this.PathNodeJunctionMaxZUpDown.Location = new System.Drawing.Point(57, 3); + this.PathNodeJunctionMaxZUpDown.DecimalPlaces = 5; + this.PathNodeJunctionMaxZUpDown.Increment = new decimal(new int[] { + 3125, + 0, + 0, + 327680}); + this.PathNodeJunctionMaxZUpDown.Location = new System.Drawing.Point(86, 5); + this.PathNodeJunctionMaxZUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionMaxZUpDown.Maximum = new decimal(new int[] { - 32767, + 102396875, 0, 0, - 0}); + 327680}); this.PathNodeJunctionMaxZUpDown.Minimum = new decimal(new int[] { - 32768, + 102396875, 0, 0, - -2147483648}); + -2147155968}); this.PathNodeJunctionMaxZUpDown.Name = "PathNodeJunctionMaxZUpDown"; - this.PathNodeJunctionMaxZUpDown.Size = new System.Drawing.Size(86, 20); + this.PathNodeJunctionMaxZUpDown.Size = new System.Drawing.Size(129, 26); this.PathNodeJunctionMaxZUpDown.TabIndex = 30; this.PathNodeJunctionMaxZUpDown.ValueChanged += new System.EventHandler(this.PathNodeJunctionMaxZUpDown_ValueChanged); // // label65 // this.label65.AutoSize = true; - this.label65.Location = new System.Drawing.Point(11, 5); + this.label65.Location = new System.Drawing.Point(16, 8); + this.label65.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label65.Name = "label65"; - this.label65.Size = new System.Drawing.Size(40, 13); + this.label65.Size = new System.Drawing.Size(56, 20); this.label65.TabIndex = 31; this.label65.Text = "Max Z:"; // // PathNodeJunctionEnableCheckBox // this.PathNodeJunctionEnableCheckBox.AutoSize = true; - this.PathNodeJunctionEnableCheckBox.Location = new System.Drawing.Point(6, 6); + this.PathNodeJunctionEnableCheckBox.Location = new System.Drawing.Point(9, 9); + this.PathNodeJunctionEnableCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.PathNodeJunctionEnableCheckBox.Name = "PathNodeJunctionEnableCheckBox"; - this.PathNodeJunctionEnableCheckBox.Size = new System.Drawing.Size(156, 17); + this.PathNodeJunctionEnableCheckBox.Size = new System.Drawing.Size(231, 24); this.PathNodeJunctionEnableCheckBox.TabIndex = 0; this.PathNodeJunctionEnableCheckBox.Text = "Enable Junction Heightmap"; this.PathNodeJunctionEnableCheckBox.UseVisualStyleBackColor = true; @@ -1750,11 +1903,12 @@ // // EditYndNodePanel // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(522, 451); + this.ClientSize = new System.Drawing.Size(914, 711); this.Controls.Add(this.PathNodeTabControl); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "EditYndNodePanel"; this.Text = "Edit Ynd Node"; this.PathNodeTabControl.ResumeLayout(false); @@ -1765,6 +1919,7 @@ ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags5UpDown)).EndInit(); this.PathNodeFlags4GroupBox.ResumeLayout(false); this.PathNodeFlags4GroupBox.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags44UpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags42UpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.PathNodeFlags4UpDown)).EndInit(); this.PathNodeFlags3GroupBox.ResumeLayout(false); @@ -1826,18 +1981,10 @@ private System.Windows.Forms.TabControl PathNodeTabControl; private System.Windows.Forms.TabPage PathNodePropertiesTabPage; private System.Windows.Forms.GroupBox PathNodeFlags5GroupBox; - private System.Windows.Forms.CheckBox PathNodeFlags52CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags53CheckBox; private System.Windows.Forms.CheckBox PathNodeFlags51CheckBox; private System.Windows.Forms.NumericUpDown PathNodeFlags5UpDown; private System.Windows.Forms.GroupBox PathNodeFlags4GroupBox; - private System.Windows.Forms.CheckBox PathNodeFlags45CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags46CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags47CheckBox; private System.Windows.Forms.CheckBox PathNodeFlags48CheckBox; - private System.Windows.Forms.NumericUpDown PathNodeFlags42UpDown; - private System.Windows.Forms.Label label71; - private System.Windows.Forms.CheckBox PathNodeFlags41CheckBox; private System.Windows.Forms.NumericUpDown PathNodeFlags4UpDown; private System.Windows.Forms.Label PathNodeFlags4Label; private System.Windows.Forms.GroupBox PathNodeFlags3GroupBox; @@ -1859,13 +2006,8 @@ private System.Windows.Forms.Label PathNodeFlags2Label; private System.Windows.Forms.GroupBox PathNodeFlags1GroupBox; private System.Windows.Forms.CheckBox PathNodeFlags11CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags18CheckBox; private System.Windows.Forms.CheckBox PathNodeFlags12CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags17CheckBox; private System.Windows.Forms.CheckBox PathNodeFlags13CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags16CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags14CheckBox; - private System.Windows.Forms.CheckBox PathNodeFlags15CheckBox; private System.Windows.Forms.NumericUpDown PathNodeFlags1UpDown; private System.Windows.Forms.Label PathNodeFlags1Label; private System.Windows.Forms.GroupBox PathNodeFlags0GroupBox; @@ -1912,7 +2054,6 @@ private System.Windows.Forms.NumericUpDown PathNodeLinkOffsetSizeUpDown; private System.Windows.Forms.Label label61; private System.Windows.Forms.CheckBox PathNodeLinkFlags11CheckBox; - private System.Windows.Forms.CheckBox PathNodeLinkFlags18CheckBox; private System.Windows.Forms.CheckBox PathNodeLinkFlags12CheckBox; private System.Windows.Forms.CheckBox PathNodeLinkFlags13CheckBox; private System.Windows.Forms.CheckBox PathNodeLinkFlags14CheckBox; @@ -1951,5 +2092,19 @@ private System.Windows.Forms.NumericUpDown PathNodeJunctionMaxZUpDown; private System.Windows.Forms.Label label65; private System.Windows.Forms.CheckBox PathNodeJunctionEnableCheckBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox PathNodesSpeedComboBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox PathNodeSpecialTypeComboBox; + private System.Windows.Forms.CheckBox YndNodeIsPedNodeCheckBox; + private System.Windows.Forms.NumericUpDown PathNodeFlags42UpDown; + private System.Windows.Forms.Label label71; + private System.Windows.Forms.Button PathNodeSelectPartnerButton; + private System.Windows.Forms.Button PathNodeEnableDisableButton; + private System.Windows.Forms.Button PathNodeFloodCopyButton; + private System.Windows.Forms.NumericUpDown PathNodeFlags44UpDown; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button YndNodeJunctionGenerateButton; + private System.Windows.Forms.CheckBox PathNodeLinkFlags18CheckBox; } } \ No newline at end of file diff --git a/CodeWalker/Project/Panels/EditYndNodePanel.cs b/CodeWalker/Project/Panels/EditYndNodePanel.cs index 8303ec2..8879545 100644 --- a/CodeWalker/Project/Panels/EditYndNodePanel.cs +++ b/CodeWalker/Project/Panels/EditYndNodePanel.cs @@ -39,7 +39,7 @@ namespace CodeWalker.Project.Panels private void UpdateFormTitle() { - var sn = CurrentPathNode.StreetName.Hash == 0 ? "Path node" : CurrentPathNode.StreetName.ToString(); + var sn = CurrentPathNode.StreetName.Hash == 0 ? "Path node" : CurrentPathNode?.StreetName.ToString() ?? string.Empty; Text = sn + " " + CurrentPathNode.NodeID.ToString(); } @@ -108,6 +108,22 @@ namespace CodeWalker.Project.Panels ProjectForm.WorldForm.SelectObject(CurrentPathNode); } + if (PathNodesSpeedComboBox.Items.Count == 0) + { + PathNodesSpeedComboBox.Items.AddRange(Enum.GetValues(typeof(YndNodeSpeed)).Cast().ToArray()); + } + + if (PathNodeSpecialTypeComboBox.Items.Count == 0) + { + PathNodeSpecialTypeComboBox.Items.AddRange(Enum.GetValues(typeof(YndNodeSpecialType)).Cast().ToArray()); + } + + PathNodeSpecialTypeComboBox.SelectedItem = CurrentPathNode.Special; + PathNodesSpeedComboBox.SelectedItem = CurrentPathNode.Speed; + + PathNodeEnableDisableButton.Text = CurrentPathNode.IsDisabledUnk0 + ? "Enable Section" + : "Disable Section"; } } @@ -128,8 +144,8 @@ namespace CodeWalker.Project.Panels { populatingui = true; PathNodeLinkPanel.Enabled = true; - PathNodeLinkAreaIDUpDown.Value = CurrentPathLink._RawData.AreaID; - PathNodeLinkNodeIDUpDown.Value = CurrentPathLink._RawData.NodeID; + PathNodeLinkAreaIDUpDown.Value = CurrentPathLink.Node2?.AreaID ?? 0; + PathNodeLinkNodeIDUpDown.Value = CurrentPathLink.Node2?.NodeID ?? 0; UpdatePathNodeLinkFlagsUI(true, true); @@ -166,10 +182,10 @@ namespace CodeWalker.Project.Panels populatingui = true; PathNodeJunctionEnableCheckBox.Checked = CurrentPathNode.HasJunction; PathNodeJunctionPanel.Enabled = PathNodeJunctionEnableCheckBox.Checked; - PathNodeJunctionMaxZUpDown.Value = junc.MaxZ; - PathNodeJunctionMinZUpDown.Value = junc.MinZ; - PathNodeJunctionPosXUpDown.Value = junc.PositionX; - PathNodeJunctionPosYUpDown.Value = junc.PositionY; + PathNodeJunctionMaxZUpDown.Value = (decimal)junc.MaxZ / 32; + PathNodeJunctionMinZUpDown.Value = (decimal)junc.MinZ / 32; + PathNodeJunctionPosXUpDown.Value = (decimal)junc.PositionX / 32; + PathNodeJunctionPosYUpDown.Value = (decimal)junc.PositionY / 32 ; PathNodeJunctionHeightmapDimXUpDown.Value = junc.Heightmap.CountX; PathNodeJunctionHeightmapDimYUpDown.Value = junc.Heightmap.CountY; PathNodeJunctionHeightmapBytesTextBox.Text = junc.Heightmap?.GetDataString() ?? ""; @@ -204,11 +220,6 @@ namespace CodeWalker.Project.Panels PathNodeFlags11CheckBox.Checked = BitUtil.IsBitSet(flags1, 0); PathNodeFlags12CheckBox.Checked = BitUtil.IsBitSet(flags1, 1); PathNodeFlags13CheckBox.Checked = BitUtil.IsBitSet(flags1, 2); - PathNodeFlags14CheckBox.Checked = BitUtil.IsBitSet(flags1, 3); - PathNodeFlags15CheckBox.Checked = BitUtil.IsBitSet(flags1, 4); - PathNodeFlags16CheckBox.Checked = BitUtil.IsBitSet(flags1, 5); - PathNodeFlags17CheckBox.Checked = BitUtil.IsBitSet(flags1, 6); - PathNodeFlags18CheckBox.Checked = BitUtil.IsBitSet(flags1, 7); PathNodeFlags21CheckBox.Checked = BitUtil.IsBitSet(flags2, 0); PathNodeFlags22CheckBox.Checked = BitUtil.IsBitSet(flags2, 1); @@ -222,16 +233,15 @@ namespace CodeWalker.Project.Panels PathNodeFlags31CheckBox.Checked = BitUtil.IsBitSet(flags3, 0); PathNodeFlags32UpDown.Value = (flags3 >> 1) & 127; - PathNodeFlags41CheckBox.Checked = BitUtil.IsBitSet(flags4, 0); - PathNodeFlags42UpDown.Value = (flags4 >> 1) & 7; - PathNodeFlags45CheckBox.Checked = BitUtil.IsBitSet(flags4, 4); - PathNodeFlags46CheckBox.Checked = BitUtil.IsBitSet(flags4, 5); - PathNodeFlags47CheckBox.Checked = BitUtil.IsBitSet(flags4, 6); + PathNodeFlags42UpDown.Value = (flags4) & 15; + PathNodeFlags44UpDown.Value = (flags4 >> 4) & 7; PathNodeFlags48CheckBox.Checked = BitUtil.IsBitSet(flags4, 7); PathNodeFlags51CheckBox.Checked = BitUtil.IsBitSet(flags5, 0); - PathNodeFlags52CheckBox.Checked = BitUtil.IsBitSet(flags5, 1); - PathNodeFlags53CheckBox.Checked = BitUtil.IsBitSet(flags5, 2); + YndNodeIsPedNodeCheckBox.Checked = CurrentPathNode?.IsPedNode ?? false; + + PathNodesSpeedComboBox.SelectedItem = CurrentPathNode?.Speed ?? (YndNodeSpeed)(-1); + PathNodeSpecialTypeComboBox.SelectedItem = CurrentPathNode?.Special ?? YndNodeSpecialType.None; } if (updateUpDowns) { @@ -280,7 +290,7 @@ namespace CodeWalker.Project.Panels PathNodeLinkFlags12CheckBox.Checked = BitUtil.IsBitSet(flags1, 1); PathNodeLinkFlags13CheckBox.Checked = BitUtil.IsBitSet(flags1, 2); PathNodeLinkFlags14CheckBox.Checked = BitUtil.IsBitSet(flags1, 3); - PathNodeLinkOffsetSizeUpDown.Value = (flags1 >> 4) & 7; + PathNodeLinkOffsetSizeUpDown.Value = flags1 >> 4 & 7; PathNodeLinkFlags18CheckBox.Checked = BitUtil.IsBitSet(flags1, 7); PathNodeLinkFlags21CheckBox.Checked = BitUtil.IsBitSet(flags2, 0); @@ -333,11 +343,6 @@ namespace CodeWalker.Project.Panels flags1 = BitUtil.UpdateBit(flags1, 0, PathNodeFlags11CheckBox.Checked); flags1 = BitUtil.UpdateBit(flags1, 1, PathNodeFlags12CheckBox.Checked); flags1 = BitUtil.UpdateBit(flags1, 2, PathNodeFlags13CheckBox.Checked); - flags1 = BitUtil.UpdateBit(flags1, 3, PathNodeFlags14CheckBox.Checked); - flags1 = BitUtil.UpdateBit(flags1, 4, PathNodeFlags15CheckBox.Checked); - flags1 = BitUtil.UpdateBit(flags1, 5, PathNodeFlags16CheckBox.Checked); - flags1 = BitUtil.UpdateBit(flags1, 6, PathNodeFlags17CheckBox.Checked); - flags1 = BitUtil.UpdateBit(flags1, 7, PathNodeFlags18CheckBox.Checked); flags2 = BitUtil.UpdateBit(flags2, 0, PathNodeFlags21CheckBox.Checked); flags2 = BitUtil.UpdateBit(flags2, 1, PathNodeFlags22CheckBox.Checked); @@ -351,16 +356,11 @@ namespace CodeWalker.Project.Panels flags3 = BitUtil.UpdateBit(flags3, 0, PathNodeFlags31CheckBox.Checked); flags3 += (((uint)PathNodeFlags32UpDown.Value & 127u) << 1); - flags4 = BitUtil.UpdateBit(flags4, 0, PathNodeFlags41CheckBox.Checked); - flags4 += (((uint)PathNodeFlags42UpDown.Value & 7u) << 1); - flags4 = BitUtil.UpdateBit(flags4, 4, PathNodeFlags45CheckBox.Checked); - flags4 = BitUtil.UpdateBit(flags4, 5, PathNodeFlags46CheckBox.Checked); - flags4 = BitUtil.UpdateBit(flags4, 6, PathNodeFlags47CheckBox.Checked); + flags4 = (byte)((flags4 & ~ 15) | ((uint)PathNodeFlags42UpDown.Value & 15u)); + flags4 = (byte)((flags4 & ~ 112) | ((uint)PathNodeFlags44UpDown.Value & 7) << 4); flags4 = BitUtil.UpdateBit(flags4, 7, PathNodeFlags48CheckBox.Checked); flags5 = BitUtil.UpdateBit(flags5, 0, PathNodeFlags51CheckBox.Checked); - flags5 = BitUtil.UpdateBit(flags5, 1, PathNodeFlags52CheckBox.Checked); - flags5 = BitUtil.UpdateBit(flags5, 2, PathNodeFlags53CheckBox.Checked); lock (ProjectForm.ProjectSyncRoot) @@ -372,7 +372,8 @@ namespace CodeWalker.Project.Panels } if (CurrentPathNode.Flags1.Value != flags1) { - CurrentPathNode.Flags1 = (byte)flags1; + // Ignore the last 5 bits for special type + CurrentPathNode.Flags1 = (byte)((uint)(CurrentPathNode.Flags1 &~ 7) | (flags1 & 7)); ProjectForm.SetYndHasChanged(true); } if (CurrentPathNode.Flags2.Value != flags2) @@ -387,15 +388,26 @@ namespace CodeWalker.Project.Panels } if (CurrentPathNode.Flags4.Value != flags4) { - CurrentPathNode.Flags4 = (byte)flags4; + CurrentPathNode.Flags4 = (byte)(flags4); ProjectForm.SetYndHasChanged(true); } if (CurrentPathNode.LinkCountUnk != flags5) { - CurrentPathNode.LinkCountUnk = (byte)flags5; + // Ignore bits 1 and 2 for speed + CurrentPathNode.LinkCountUnk = (byte)((uint)(CurrentPathNode.LinkCountUnk &~ 0xF9) | (flags5 & 0xF9)); ProjectForm.SetYndHasChanged(true); } + + // Allow partner nodes to check if they've become an offroad junction + if (CurrentPathNode.Links != null) + { + foreach (var yndLink in CurrentPathNode.Links) + { + yndLink.Node2?.CheckIfJunction(); + } + } } + populatingui = true; UpdatePathNodeFlagsUI(false, true); //update updowns @@ -423,7 +435,7 @@ namespace CodeWalker.Project.Panels } if (CurrentPathNode.Flags1.Value != flags1) { - CurrentPathNode.Flags1 = (byte)flags1; + CurrentPathNode.Flags1 = (byte)((uint)(CurrentPathNode.Flags1 & ~7) | (flags1 & 7)); ProjectForm.SetYndHasChanged(true); } if (CurrentPathNode.Flags2.Value != flags2) @@ -443,7 +455,7 @@ namespace CodeWalker.Project.Panels } if (CurrentPathNode.LinkCountUnk != flags5) { - CurrentPathNode.LinkCountUnk = (byte)flags5; + CurrentPathNode.LinkCountUnk = (byte)((uint)(CurrentPathNode.LinkCountUnk & ~0xF9) | (flags5 & 0xF9)); ProjectForm.SetYndHasChanged(true); } } @@ -475,8 +487,6 @@ namespace CodeWalker.Project.Panels flags2 = BitUtil.UpdateBit(flags2, 0, PathNodeLinkFlags21CheckBox.Checked); flags2 = BitUtil.UpdateBit(flags2, 1, PathNodeLinkFlags22CheckBox.Checked); - flags2 += (((uint)PathNodeLinkBackLanesUpDown.Value & 7u) << 2); - flags2 += (((uint)PathNodeLinkFwdLanesUpDown.Value & 7u) << 5); bool updgfx = false; lock (ProjectForm.ProjectSyncRoot) @@ -494,7 +504,24 @@ namespace CodeWalker.Project.Panels } if (CurrentPathLink.Flags2.Value != flags2) { - CurrentPathLink.Flags2 = (byte)flags2; + CurrentPathLink.Flags2= (byte)((uint)(CurrentPathLink.Flags2 & ~ 3) | flags2); + ProjectForm.SetYndHasChanged(true); + updgfx = true; + } + + int forwardLanes = (int)PathNodeLinkFwdLanesUpDown.Value; + + if (forwardLanes != CurrentPathLink.LaneCountForward) + { + CurrentPathLink.SetForwardLanesBidirectionally(forwardLanes); + ProjectForm.SetYndHasChanged(true); + updgfx = true; + } + + int backwardLanes = (int)PathNodeLinkBackLanesUpDown.Value; + if (backwardLanes != CurrentPathLink.LaneCountBackward) + { + CurrentPathLink.SetBackwardLanesBidirectionally(backwardLanes); ProjectForm.SetYndHasChanged(true); updgfx = true; } @@ -555,6 +582,7 @@ namespace CodeWalker.Project.Panels { if (CurrentPathNode == null) return; + var l = CurrentPathNode.AddLink(); LoadPathNodeTabPage(); @@ -572,6 +600,12 @@ namespace CodeWalker.Project.Panels if (CurrentPathLink == null) return; if (CurrentPathNode == null) return; + var partners = CurrentPathLink.Node2.Links.Where(l => l.Node2 == CurrentPathNode); + foreach (var partner in partners) + { + partner.Node1.RemoveLink(partner); + } + var r = CurrentPathNode.RemoveLink(CurrentPathLink); if (!r) return; @@ -592,6 +626,7 @@ namespace CodeWalker.Project.Panels YndNode linknode = null; ushort areaid = CurrentPathLink._RawData.AreaID; ushort nodeid = CurrentPathLink._RawData.NodeID; + if (areaid == CurrentYndFile.AreaID) { //link to the same ynd. find the new node in the current ynd. @@ -618,9 +653,17 @@ namespace CodeWalker.Project.Panels PathNodeLinkageStatusLabel.Text = ""; } + var partner = CurrentPathLink.Node2.Links.FirstOrDefault(l => l.Node2 == CurrentPathNode); + partner?.Node1.RemoveLink(partner); + CurrentPathLink.Node2 = linknode; CurrentPathLink.UpdateLength(); + var l2 = linknode?.AddLink(CurrentPathNode); + if (l2 != null && partner != null) + { + l2.CopyFlags(partner); + } ////need to rebuild the link verts.. updating the graphics should do it... if (ProjectForm.WorldForm != null) @@ -679,7 +722,14 @@ namespace CodeWalker.Project.Panels { if (CurrentPathNode.Position != v) { - CurrentPathNode.SetPosition(v); + CurrentPathNode.SetYndNodePosition(ProjectForm.WorldForm.Space, v, out var affectedFiles); + + foreach (var affectedFile in affectedFiles) + { + ProjectForm.AddYndToProject(affectedFile); + ProjectForm.SetYndHasChanged(affectedFile, true); + } + ProjectForm.SetYndHasChanged(true); change = true; } @@ -933,17 +983,11 @@ namespace CodeWalker.Project.Panels SetPathNodeFlagsFromCheckBoxes(); //treat this one like checkboxes } - private void PathNodeFlags52CheckBox_CheckedChanged(object sender, EventArgs e) + private void PathNodeFlags44UpDown_ValueChanged(object sender, EventArgs e) { - SetPathNodeFlagsFromCheckBoxes(); + SetPathNodeFlagsFromCheckBoxes(); //treat this one like checkboxes } - private void PathNodeFlags53CheckBox_CheckedChanged(object sender, EventArgs e) - { - SetPathNodeFlagsFromCheckBoxes(); - } - - private void PathNodeLinksListBox_SelectedIndexChanged(object sender, EventArgs e) { CurrentPathLink = PathNodeLinksListBox.SelectedItem as YndLink; @@ -1123,14 +1167,19 @@ namespace CodeWalker.Project.Panels { var j = new YndJunction(); //init new junction - j._RawData.HeightmapDimX = 1; - j._RawData.HeightmapDimY = 1; - j.Heightmap = new YndJunctionHeightmap(new byte[] { 255 }, j); + j._RawData.HeightmapDimX = 16; + j._RawData.HeightmapDimY = 16; + j.MaxZ = (short)(CurrentPathNode.Position.Z * 32 + 32); + j.MinZ = (short)(CurrentPathNode.Position.Z * 32 - 32); + j.PositionX = (short)(CurrentPathNode.Position.X * 4f - j.RawData.HeightmapDimY * 4f); + j.PositionY = (short)(CurrentPathNode.Position.Y * 4f - j.RawData.HeightmapDimY * 4f); + j.Heightmap = new YndJunctionHeightmap(Enumerable.Repeat((byte)255, j._RawData.HeightmapDimX * j._RawData.HeightmapDimY).ToArray(), j); j.RefData = new NodeJunctionRef() { AreaID = (ushort)CurrentPathNode.AreaID, NodeID = (ushort)CurrentPathNode.NodeID }; CurrentPathNode.Junction = j; } ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } } LoadPathNodeJunctionPage(); @@ -1141,7 +1190,7 @@ namespace CodeWalker.Project.Panels if (populatingui) return; if (CurrentPathNode == null) return; if (CurrentPathNode.Junction == null) return; - short val = (short)PathNodeJunctionMaxZUpDown.Value; + short val = (short)(PathNodeJunctionMaxZUpDown.Value * 32); lock (ProjectForm.ProjectSyncRoot) { if (CurrentPathNode.Junction.MaxZ != val) @@ -1149,6 +1198,7 @@ namespace CodeWalker.Project.Panels CurrentPathNode.Junction.MaxZ = val; CurrentPathNode.Junction._RawData.MaxZ = val; ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } } } @@ -1158,7 +1208,7 @@ namespace CodeWalker.Project.Panels if (populatingui) return; if (CurrentPathNode == null) return; if (CurrentPathNode.Junction == null) return; - short val = (short)PathNodeJunctionMinZUpDown.Value; + short val = (short)(PathNodeJunctionMinZUpDown.Value * 32); lock (ProjectForm.ProjectSyncRoot) { if (CurrentPathNode.Junction.MinZ != val) @@ -1166,6 +1216,7 @@ namespace CodeWalker.Project.Panels CurrentPathNode.Junction.MinZ = val; CurrentPathNode.Junction._RawData.MinZ = val; ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } } } @@ -1175,7 +1226,7 @@ namespace CodeWalker.Project.Panels if (populatingui) return; if (CurrentPathNode == null) return; if (CurrentPathNode.Junction == null) return; - short val = (short)PathNodeJunctionPosXUpDown.Value; + short val = (short)(PathNodeJunctionPosXUpDown.Value * 32); lock (ProjectForm.ProjectSyncRoot) { if (CurrentPathNode.Junction.PositionX != val) @@ -1183,6 +1234,7 @@ namespace CodeWalker.Project.Panels CurrentPathNode.Junction.PositionX = val; CurrentPathNode.Junction._RawData.PositionX = val; ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } } } @@ -1192,7 +1244,7 @@ namespace CodeWalker.Project.Panels if (populatingui) return; if (CurrentPathNode == null) return; if (CurrentPathNode.Junction == null) return; - short val = (short)PathNodeJunctionPosYUpDown.Value; + short val = (short)(PathNodeJunctionPosYUpDown.Value * 32); lock (ProjectForm.ProjectSyncRoot) { if (CurrentPathNode.Junction.PositionY != val) @@ -1200,6 +1252,7 @@ namespace CodeWalker.Project.Panels CurrentPathNode.Junction.PositionY = val; CurrentPathNode.Junction._RawData.PositionY = val; ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } } } @@ -1217,6 +1270,7 @@ namespace CodeWalker.Project.Panels CurrentPathNode.Junction._RawData.HeightmapDimX = val; CurrentPathNode.Junction.ResizeHeightmap(); ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } } LoadPathNodeJunctionPage(); @@ -1235,6 +1289,7 @@ namespace CodeWalker.Project.Panels CurrentPathNode.Junction._RawData.HeightmapDimY = val; CurrentPathNode.Junction.ResizeHeightmap(); ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } } LoadPathNodeJunctionPage(); @@ -1249,8 +1304,166 @@ namespace CodeWalker.Project.Panels { CurrentPathNode.Junction.SetHeightmap(PathNodeJunctionHeightmapBytesTextBox.Text); ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); } //LoadPathNodeJunctionPage(); } + + private void YndNodeJunctionGenerateButton_Click(object sender, EventArgs e) + { + if (populatingui) return; + if (CurrentPathNode == null) return; + if (CurrentPathNode.Junction == null) return; + + lock (ProjectForm.ProjectSyncRoot) + { + CurrentPathNode.GenerateYndNodeJunctionHeightMap(ProjectForm.WorldForm.Space); + ProjectForm.SetYndHasChanged(true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); + } + + LoadPathNodeJunctionPage(); + } + + private void PathNodesSpeedComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (CurrentPathNode == null) return; + + lock (ProjectForm.ProjectSyncRoot) + { + var speed = (YndNodeSpeed)PathNodesSpeedComboBox.SelectedItem; + if (CurrentPathNode.Speed != speed) + { + CurrentPathNode.Speed = speed; + ProjectForm.SetYndHasChanged(true); + UpdatePathNodeFlagsUI(true, true); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); + } + } + } + + private void PathNodeSpecialTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (CurrentPathNode == null) return; + lock (ProjectForm.ProjectSyncRoot) + { + var special = (YndNodeSpecialType)PathNodeSpecialTypeComboBox.SelectedItem; + + if (CurrentPathNode.Special != special) + { + var isPedNode = CurrentPathNode.IsPedNode; + bool specialIsPedNode = YndNode.IsSpecialTypeAPedNode(special); + if (isPedNode != specialIsPedNode) + { + var res = MessageBox.Show( + specialIsPedNode + ? "This operation will change this node from a vehicle node to a ped node. This will remove all links. Are you sure you want to do this?" + : "This operation will change this node from a ped node to a vehicle node. This will remove all links. Are you sure you want to do this?", + "Are you sure?", + MessageBoxButtons.YesNo + ); + + if (res == DialogResult.No) + { + PathNodeSpecialTypeComboBox.SelectedItem = CurrentPathNode.Special; + return; + } + + if (ProjectForm != null) + { + CurrentPathNode.RemoveYndLinksForNode(ProjectForm.WorldForm.Space, out var affectedFiles); + ProjectForm.AddYndToProject(CurrentYndFile); + ProjectForm.WorldForm?.UpdatePathYndGraphics(CurrentYndFile, false); + foreach (var file in affectedFiles) + { + ProjectForm.AddYndToProject(file); + ProjectForm.WorldForm?.UpdatePathYndGraphics(file, false); + ProjectForm.SetYndHasChanged(file, true); + } + } + } + + CurrentPathNode.Special = special; + YndNodeIsPedNodeCheckBox.Checked = CurrentPathNode.IsPedNode; + UpdatePathNodeFlagsUI(true, true); + ProjectForm.SetYndHasChanged(true); + } + + } + } + + private void PathNodeSelectPartnerButton_Click(object sender, EventArgs e) + { + if (CurrentPathLink == null) + return; + + var partner = CurrentPathLink.Node2.Links.FirstOrDefault(l => l.Node2 == CurrentPathNode); + if (partner == null) + { + MessageBox.Show("Could not find partner!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + CurrentPathNode = partner.Node1; + CurrentPathLink = partner; + LoadPathNodeLinkPage(); + LoadPathNodeLinkPage(); + PathNodeLinksListBox.SelectedItem = partner; + } + + private void PathNodeFloodCopyButton_Click(object sender, EventArgs e) + { + if (CurrentPathNode == null) + { + return; + } + + CurrentPathNode.FloodCopyFlags(out var affectedFiles); + + ProjectForm.AddYndToProject(CurrentYndFile); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); + + foreach (var affectedFile in affectedFiles) + { + ProjectForm.AddYndToProject(affectedFile); + ProjectForm.SetYndHasChanged(affectedFile, true); + ProjectForm.WorldForm.UpdatePathYndGraphics(affectedFile, false); + } + } + + private void PathNodeEnableDisableButton_Click(object sender, EventArgs e) + { + if (CurrentPathNode == null) + { + return; + } + + lock (ProjectForm.ProjectSyncRoot) + { + CurrentPathNode.IsDisabledUnk0 = !CurrentPathNode.IsDisabledUnk0; + CurrentPathNode.IsDisabledUnk1 = CurrentPathNode.IsDisabledUnk0; + CurrentPathNode.FloodCopyFlags(out var affectedFiles); + + PathNodeEnableDisableButton.Text = CurrentPathNode.IsDisabledUnk0 + ? "Enable Section" + : "Disable Section"; + + ProjectForm.AddYndToProject(CurrentYndFile); + ProjectForm.WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); + + foreach (var affectedFile in affectedFiles) + { + ProjectForm.AddYndToProject(affectedFile); + ProjectForm.SetYndHasChanged(affectedFile, true); + ProjectForm.WorldForm.UpdatePathYndGraphics(affectedFile, false); + } + + } + + UpdatePathNodeFlagsUI(true, false); + } + } } diff --git a/CodeWalker/Project/Panels/EditYndPanel.Designer.cs b/CodeWalker/Project/Panels/EditYndPanel.Designer.cs index f660921..587746c 100644 --- a/CodeWalker/Project/Panels/EditYndPanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditYndPanel.Designer.cs @@ -55,53 +55,58 @@ // label88 // this.label88.AutoSize = true; - this.label88.Location = new System.Drawing.Point(183, 20); + this.label88.Location = new System.Drawing.Point(274, 31); + this.label88.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label88.Name = "label88"; - this.label88.Size = new System.Drawing.Size(17, 13); + this.label88.Size = new System.Drawing.Size(24, 20); this.label88.TabIndex = 36; this.label88.Text = "Y:"; // // YndAreaIDYUpDown // - this.YndAreaIDYUpDown.Location = new System.Drawing.Point(206, 18); + this.YndAreaIDYUpDown.Location = new System.Drawing.Point(309, 28); + this.YndAreaIDYUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.YndAreaIDYUpDown.Maximum = new decimal(new int[] { 31, 0, 0, 0}); this.YndAreaIDYUpDown.Name = "YndAreaIDYUpDown"; - this.YndAreaIDYUpDown.Size = new System.Drawing.Size(48, 20); + this.YndAreaIDYUpDown.Size = new System.Drawing.Size(72, 26); this.YndAreaIDYUpDown.TabIndex = 35; this.YndAreaIDYUpDown.ValueChanged += new System.EventHandler(this.YndAreaIDYUpDown_ValueChanged); // // label87 // this.label87.AutoSize = true; - this.label87.Location = new System.Drawing.Point(101, 20); + this.label87.Location = new System.Drawing.Point(152, 31); + this.label87.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label87.Name = "label87"; - this.label87.Size = new System.Drawing.Size(17, 13); + this.label87.Size = new System.Drawing.Size(24, 20); this.label87.TabIndex = 34; this.label87.Text = "X:"; // // YndAreaIDXUpDown // - this.YndAreaIDXUpDown.Location = new System.Drawing.Point(124, 18); + this.YndAreaIDXUpDown.Location = new System.Drawing.Point(186, 28); + this.YndAreaIDXUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.YndAreaIDXUpDown.Maximum = new decimal(new int[] { 31, 0, 0, 0}); this.YndAreaIDXUpDown.Name = "YndAreaIDXUpDown"; - this.YndAreaIDXUpDown.Size = new System.Drawing.Size(48, 20); + this.YndAreaIDXUpDown.Size = new System.Drawing.Size(72, 26); this.YndAreaIDXUpDown.TabIndex = 33; this.YndAreaIDXUpDown.ValueChanged += new System.EventHandler(this.YndAreaIDXUpDown_ValueChanged); // // label48 // this.label48.AutoSize = true; - this.label48.Location = new System.Drawing.Point(23, 216); + this.label48.Location = new System.Drawing.Point(34, 332); + this.label48.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label48.Name = "label48"; - this.label48.Size = new System.Drawing.Size(68, 13); + this.label48.Size = new System.Drawing.Size(99, 20); this.label48.TabIndex = 32; this.label48.Text = "Project Path:"; // @@ -109,18 +114,20 @@ // this.YndProjectPathTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.YndProjectPathTextBox.Location = new System.Drawing.Point(97, 213); + this.YndProjectPathTextBox.Location = new System.Drawing.Point(146, 328); + this.YndProjectPathTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.YndProjectPathTextBox.Name = "YndProjectPathTextBox"; this.YndProjectPathTextBox.ReadOnly = true; - this.YndProjectPathTextBox.Size = new System.Drawing.Size(450, 20); + this.YndProjectPathTextBox.Size = new System.Drawing.Size(673, 26); this.YndProjectPathTextBox.TabIndex = 31; // // label46 // this.label46.AutoSize = true; - this.label46.Location = new System.Drawing.Point(23, 190); + this.label46.Location = new System.Drawing.Point(34, 292); + this.label46.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label46.Name = "label46"; - this.label46.Size = new System.Drawing.Size(51, 13); + this.label46.Size = new System.Drawing.Size(75, 20); this.label46.TabIndex = 30; this.label46.Text = "File Path:"; // @@ -128,89 +135,100 @@ // this.YndFilePathTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.YndFilePathTextBox.Location = new System.Drawing.Point(97, 187); + this.YndFilePathTextBox.Location = new System.Drawing.Point(146, 288); + this.YndFilePathTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.YndFilePathTextBox.Name = "YndFilePathTextBox"; this.YndFilePathTextBox.ReadOnly = true; - this.YndFilePathTextBox.Size = new System.Drawing.Size(450, 20); + this.YndFilePathTextBox.Size = new System.Drawing.Size(673, 26); this.YndFilePathTextBox.TabIndex = 29; // // label47 // this.label47.AutoSize = true; - this.label47.Location = new System.Drawing.Point(23, 164); + this.label47.Location = new System.Drawing.Point(34, 252); + this.label47.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label47.Name = "label47"; - this.label47.Size = new System.Drawing.Size(52, 13); + this.label47.Size = new System.Drawing.Size(76, 20); this.label47.TabIndex = 28; this.label47.Text = "Rpf Path:"; // // YndTotalNodesLabel // this.YndTotalNodesLabel.AutoSize = true; - this.YndTotalNodesLabel.Location = new System.Drawing.Point(23, 59); + this.YndTotalNodesLabel.Location = new System.Drawing.Point(34, 91); + this.YndTotalNodesLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.YndTotalNodesLabel.Name = "YndTotalNodesLabel"; - this.YndTotalNodesLabel.Size = new System.Drawing.Size(77, 13); + this.YndTotalNodesLabel.Size = new System.Drawing.Size(111, 20); this.YndTotalNodesLabel.TabIndex = 27; this.YndTotalNodesLabel.Text = "Total Nodes: 0"; // // YndPedNodesUpDown // - this.YndPedNodesUpDown.Location = new System.Drawing.Point(377, 57); + this.YndPedNodesUpDown.Enabled = false; + this.YndPedNodesUpDown.Location = new System.Drawing.Point(566, 88); + this.YndPedNodesUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.YndPedNodesUpDown.Maximum = new decimal(new int[] { 0, 0, 0, 0}); this.YndPedNodesUpDown.Name = "YndPedNodesUpDown"; - this.YndPedNodesUpDown.Size = new System.Drawing.Size(74, 20); + this.YndPedNodesUpDown.Size = new System.Drawing.Size(111, 26); this.YndPedNodesUpDown.TabIndex = 26; this.YndPedNodesUpDown.ValueChanged += new System.EventHandler(this.YndPedNodesUpDown_ValueChanged); // // label45 // this.label45.AutoSize = true; - this.label45.Location = new System.Drawing.Point(308, 59); + this.label45.Location = new System.Drawing.Point(462, 91); + this.label45.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label45.Name = "label45"; - this.label45.Size = new System.Drawing.Size(63, 13); + this.label45.Size = new System.Drawing.Size(91, 20); this.label45.TabIndex = 25; this.label45.Text = "Ped Nodes:"; // // YndVehicleNodesUpDown // - this.YndVehicleNodesUpDown.Location = new System.Drawing.Point(206, 57); + this.YndVehicleNodesUpDown.Enabled = false; + this.YndVehicleNodesUpDown.Location = new System.Drawing.Point(309, 88); + this.YndVehicleNodesUpDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.YndVehicleNodesUpDown.Maximum = new decimal(new int[] { 0, 0, 0, 0}); this.YndVehicleNodesUpDown.Name = "YndVehicleNodesUpDown"; - this.YndVehicleNodesUpDown.Size = new System.Drawing.Size(74, 20); + this.YndVehicleNodesUpDown.Size = new System.Drawing.Size(111, 26); this.YndVehicleNodesUpDown.TabIndex = 24; this.YndVehicleNodesUpDown.ValueChanged += new System.EventHandler(this.YndVehicleNodesUpDown_ValueChanged); // // label40 // this.label40.AutoSize = true; - this.label40.Location = new System.Drawing.Point(121, 59); + this.label40.Location = new System.Drawing.Point(182, 91); + this.label40.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label40.Name = "label40"; - this.label40.Size = new System.Drawing.Size(79, 13); + this.label40.Size = new System.Drawing.Size(115, 20); this.label40.TabIndex = 23; this.label40.Text = "Vehicle Nodes:"; // // YndAreaIDInfoLabel // this.YndAreaIDInfoLabel.AutoSize = true; - this.YndAreaIDInfoLabel.Location = new System.Drawing.Point(271, 20); + this.YndAreaIDInfoLabel.Location = new System.Drawing.Point(406, 31); + this.YndAreaIDInfoLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.YndAreaIDInfoLabel.Name = "YndAreaIDInfoLabel"; - this.YndAreaIDInfoLabel.Size = new System.Drawing.Size(30, 13); + this.YndAreaIDInfoLabel.Size = new System.Drawing.Size(43, 20); this.YndAreaIDInfoLabel.TabIndex = 22; this.YndAreaIDInfoLabel.Text = "ID: 0"; // // label33 // this.label33.AutoSize = true; - this.label33.Location = new System.Drawing.Point(45, 20); + this.label33.Location = new System.Drawing.Point(68, 31); + this.label33.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label33.Name = "label33"; - this.label33.Size = new System.Drawing.Size(46, 13); + this.label33.Size = new System.Drawing.Size(68, 20); this.label33.TabIndex = 21; this.label33.Text = "Area ID:"; // @@ -218,17 +236,18 @@ // this.YndRpfPathTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.YndRpfPathTextBox.Location = new System.Drawing.Point(97, 161); + this.YndRpfPathTextBox.Location = new System.Drawing.Point(146, 248); + this.YndRpfPathTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.YndRpfPathTextBox.Name = "YndRpfPathTextBox"; this.YndRpfPathTextBox.ReadOnly = true; - this.YndRpfPathTextBox.Size = new System.Drawing.Size(450, 20); + this.YndRpfPathTextBox.Size = new System.Drawing.Size(673, 26); this.YndRpfPathTextBox.TabIndex = 20; // // EditYndPanel // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(574, 499); + this.ClientSize = new System.Drawing.Size(861, 768); this.Controls.Add(this.label88); this.Controls.Add(this.YndAreaIDYUpDown); this.Controls.Add(this.label87); @@ -247,6 +266,7 @@ this.Controls.Add(this.label33); this.Controls.Add(this.YndRpfPathTextBox); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "EditYndPanel"; this.Text = "Edit Ynd"; ((System.ComponentModel.ISupportInitialize)(this.YndAreaIDYUpDown)).EndInit(); diff --git a/CodeWalker/Project/Panels/EditYndPanel.cs b/CodeWalker/Project/Panels/EditYndPanel.cs index 2df3fc9..c5ab1b5 100644 --- a/CodeWalker/Project/Panels/EditYndPanel.cs +++ b/CodeWalker/Project/Panels/EditYndPanel.cs @@ -101,14 +101,19 @@ namespace CodeWalker.Project.Panels int y = (int)YndAreaIDYUpDown.Value; lock (ProjectForm.ProjectSyncRoot) { - var areaid = y * 32 + x; - if (Ynd.AreaID != areaid) + if (ProjectForm.WorldForm == null) { - Ynd.AreaID = areaid; - Ynd.Name = "nodes" + areaid.ToString() + ".ynd"; - YndAreaIDInfoLabel.Text = "ID: " + areaid.ToString(); - ProjectForm.SetYndHasChanged(true); + MessageBox.Show("You can only do this while in full CodeWalker", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; } + + ProjectForm.WorldForm.Space.MoveYndArea(Ynd, x, y); + ProjectForm.SetYndHasChanged(Ynd, true); + + // Take the updated information + YndAreaIDInfoLabel.Text = Ynd.AreaID.ToString(); + YndAreaIDXUpDown.Value = Ynd.CellX; + YndAreaIDYUpDown.Value = Ynd.CellY; } UpdateFormTitleYndChanged(); } diff --git a/CodeWalker/Project/ProjectForm.cs b/CodeWalker/Project/ProjectForm.cs index 2802d13..5d1f1a6 100644 --- a/CodeWalker/Project/ProjectForm.cs +++ b/CodeWalker/Project/ProjectForm.cs @@ -792,7 +792,7 @@ namespace CodeWalker.Project } } - var multisel = MapSelection.FromProjectObject(arr); //convert to MapSelection array + var multisel = MapSelection.FromProjectObject(WorldForm, arr); //convert to MapSelection array item = multisel.MultipleSelectionItems; } @@ -4622,16 +4622,6 @@ namespace CodeWalker.Project if ((CurrentYndFile == null) && (CurrentPathNode != null)) CurrentYndFile = CurrentPathNode.Ynd; if (CurrentYndFile == null) return; - // Check that vehicle nodes and ped nodes add up to total nodes - if (CurrentYndFile.NodeDictionary != null && (CurrentYndFile.NodeDictionary.NodesCountPed + CurrentYndFile.NodeDictionary.NodesCountVehicle != CurrentYndFile.NodeDictionary.NodesCount)) - { - var result = MessageBox.Show($"YND Area {CurrentYndFile.AreaID}: The total number of nodes ({CurrentYndFile.NodeDictionary.NodesCount}) does not match the total number of ped ({CurrentYndFile.NodeDictionary.NodesCountPed}) and vehicle ({CurrentYndFile.NodeDictionary.NodesCountVehicle}) nodes. You should manually adjust the number of nodes on the YND screen.\n\nDo you want to continue saving the YND file? Some of your nodes may not work in game.", $"Node count mismatch in Area {CurrentYndFile.AreaID}", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); - if (result == DialogResult.Cancel) - { - return; - } - } - string yndname = CurrentYndFile.Name; string filepath = CurrentYndFile.FilePath; if (string.IsNullOrEmpty(filepath)) @@ -4662,7 +4652,7 @@ namespace CodeWalker.Project CurrentYndFile.Name = CurrentYndFile.RpfFileEntry.Name; } - + WorldForm.Space.RecalculateAllYndIndices(); data = CurrentYndFile.Save(); } @@ -4733,25 +4723,32 @@ namespace CodeWalker.Project { if (CurrentYndFile == null) return null; - var n = CurrentYndFile.AddNode(); - var areaid = n.AreaID; - var nodeid = n.NodeID; + var n = CurrentYndFile.AddYndNode(WorldForm.Space, out var affectedFiles); + + AddYndToProject(CurrentYndFile); + foreach (var affectedFile in affectedFiles) + { + AddYndToProject(affectedFile); + SetYndHasChanged(affectedFile, true); + } + if (copy == null) { copy = CurrentPathNode; } if (copy != null) { - n.Init(CurrentYndFile, copy.RawData); + n.Flags0 = copy.Flags0; + n.Flags1 = copy.Flags1; + n.Flags2 = copy.Flags2; + n.Flags3 = copy.Flags3; + n.Flags4 = copy.Flags4; n.LinkCountUnk = copy.LinkCountUnk; } - n.AreaID = areaid; - n.NodeID = nodeid; bool cp = copyPosition && (copy != null); Vector3 pos = cp ? copy.Position : GetSpawnPos(10.0f); - n.SetPosition(pos); - + n.SetYndNodePosition(WorldForm.Space, pos, out _); if (copy != null) { @@ -4777,6 +4774,9 @@ namespace CodeWalker.Project } } + n.CheckIfJunction(); + copy?.CheckIfJunction(); + CurrentYndFile.UpdateAllNodePositions(); //for the graphics... CurrentYndFile.BuildBVH(); @@ -4811,20 +4811,22 @@ namespace CodeWalker.Project //} bool res = false; + YndFile[] affectedFiles = new YndFile[0]; if (WorldForm != null) { lock (WorldForm.RenderSyncRoot) //don't try to do this while rendering... { - res = CurrentYndFile.RemoveNode(CurrentPathNode); + res = CurrentYndFile.RemoveYndNode(WorldForm.Space, CurrentPathNode, true, out affectedFiles); //WorldForm.SelectItem(null, null, null); } } else - { - res = CurrentYndFile.RemoveNode(CurrentPathNode); - } - if (!res) + //{ + // res = CurrentYndFile.RemoveNode(CurrentPathNode); + //} + + //if (!res) { MessageBox.Show("Unable to delete the path node. This shouldn't happen!"); } @@ -4832,7 +4834,7 @@ namespace CodeWalker.Project var delnode = CurrentPathNode; ProjectExplorer?.RemovePathNodeTreeNode(CurrentPathNode); - ProjectExplorer?.SetYndHasChanged(CurrentYndFile, true); + SetYndHasChanged(CurrentYndFile, true); ClosePanel((EditYndNodePanel p) => { return p.Tag == delnode; }); @@ -4841,6 +4843,15 @@ namespace CodeWalker.Project if (WorldForm != null) { WorldForm.UpdatePathYndGraphics(CurrentYndFile, false); + AddYndToProject(CurrentYndFile); + + foreach (var affectedFile in affectedFiles) + { + WorldForm.UpdatePathYndGraphics(affectedFile, false); + AddYndToProject(affectedFile); + SetYndHasChanged(affectedFile, true, true); + } + WorldForm.SelectItem(null); } @@ -7082,7 +7093,9 @@ namespace CodeWalker.Project lock (projectsyncroot) { - if (renderitems && (CurrentProjectFile != null)) + if (CurrentProjectFile == null) return; + var hasymapytyp = ((CurrentProjectFile.YmapFiles.Count > 0) || (CurrentProjectFile.YtypFiles.Count > 0)); + if (renderitems && hasymapytyp) { for (int i = 0; i < CurrentProjectFile.YmapFiles.Count; i++) { @@ -7100,12 +7113,12 @@ namespace CodeWalker.Project } visiblemloentities.Clear(); - foreach (var kvp in ymaps) + foreach (var kvp in ymaps)//TODO: improve performance { var ymap = kvp.Value; - if (ymap.AllEntities != null) + if (ymap.AllEntities != null)//THIS IS TERRIBLE! EATING ALL FPS { - foreach (var ent in ymap.AllEntities) + foreach (var ent in ymap.AllEntities)//WHYYYY - maybe only do this after loading/editing ytyp! { Archetype arch = GameFileCache.GetArchetype(ent._CEntityDef.archetypeName); if ((arch != null) && (ent.Archetype != arch)) @@ -8431,16 +8444,21 @@ namespace CodeWalker.Project PromoteIfPreviewPanelActive(); } - public void SetYndHasChanged(bool changed) + + public void SetYndHasChanged(bool changed, bool force = false) { - if (CurrentYndFile == null) return; + SetYndHasChanged(CurrentYndFile, changed, force); + } + public void SetYndHasChanged(YndFile yndFile, bool changed, bool force = false) + { + if (yndFile == null) return; - bool changechange = changed != CurrentYndFile.HasChanged; - if (!changechange) return; + bool changechange = changed != yndFile.HasChanged; + if (!force && !changechange) return; - CurrentYndFile.HasChanged = changed; + yndFile.HasChanged = changed; - ProjectExplorer?.SetYndHasChanged(CurrentYndFile, changed); + ProjectExplorer?.SetYndHasChanged(yndFile, changed); PromoteIfPreviewPanelActive(); } @@ -8609,10 +8627,25 @@ namespace CodeWalker.Project byte[] data = File.ReadAllBytes(filename); ynd.Load(data); + WorldForm.Space.PatchYndFile(ynd); if (WorldForm != null) { - WorldForm.UpdatePathYndGraphics(ynd, true); //links don't get drawn until something changes otherwise + // TODO: Wasteful -- be smarter about this + foreach (var file in CurrentProjectFile.YndFiles) + { + foreach (var affected in WorldForm.Space.GetYndFilesThatDependOnYndFile(file)) + { + if (CurrentProjectFile.ContainsYnd(affected)) + { + continue; + } + + WorldForm.UpdatePathYndGraphics(affected, true); + } + + WorldForm.UpdatePathYndGraphics(file, true); //links don't get drawn until something changes otherwise + } //note: this is actually necessary to properly populate junctions data........ } } diff --git a/CodeWalker/Project/UndoStep.cs b/CodeWalker/Project/UndoStep.cs index d7a93f2..e4f4aec 100644 --- a/CodeWalker/Project/UndoStep.cs +++ b/CodeWalker/Project/UndoStep.cs @@ -1286,7 +1286,8 @@ namespace CodeWalker.Project private void Update(WorldForm wf, ref MapSelection sel, Vector3 p) { - PathNode?.SetPosition(p); + //TODO: Support migrating back! + PathNode.SetYndNodePosition(wf.Space, p, out _); if (PathNode != sel.PathNode) { diff --git a/CodeWalker/World/MapSelection.cs b/CodeWalker/World/MapSelection.cs index dc00b58..d80f2a1 100644 --- a/CodeWalker/World/MapSelection.cs +++ b/CodeWalker/World/MapSelection.cs @@ -45,6 +45,7 @@ namespace CodeWalker [TypeConverter(typeof(ExpandableObjectConverter))] public struct MapSelection { + public WorldForm WorldForm { get; set; } public YmapEntityDef EntityDef { get; set; } public Archetype Archetype { get; set; } public DrawableBase Drawable { get; set; } @@ -1062,7 +1063,11 @@ namespace CodeWalker } else if (PathNode != null) { - PathNode.SetPosition(newpos); + PathNode.SetYndNodePosition(WorldForm.Space, newpos, out var affectedFiles); + foreach (var affectedFile in affectedFiles) + { + WorldForm.UpdatePathYndGraphics(affectedFile, false); + } } else if (NavPoly != null) { @@ -1491,16 +1496,17 @@ namespace CodeWalker return null; } - public static MapSelection FromProjectObject(object o, object parent = null) + public static MapSelection FromProjectObject(WorldForm worldForm, object o, object parent = null) { const float nrad = 0.5f; var ms = new MapSelection(); + ms.WorldForm = worldForm; if (o is object[] arr) { var multi = new MapSelection[arr.Length]; for (int i = 0; i < arr.Length; i++) { - multi[i] = FromProjectObject(arr[i]); + multi[i] = FromProjectObject(worldForm, arr[i]); } ms.SetMultipleSelectionItems(multi); } diff --git a/CodeWalker/WorldForm.cs b/CodeWalker/WorldForm.cs index af8853f..d0c03ea 100644 --- a/CodeWalker/WorldForm.cs +++ b/CodeWalker/WorldForm.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using System.Threading; using System.Diagnostics; +using System.Linq; using SharpDX; using SharpDX.XInput; using Device = SharpDX.Direct3D11.Device; @@ -221,6 +222,10 @@ namespace CodeWalker weather = Renderer.weather; clouds = Renderer.clouds; + CurMouseHit.WorldForm = this; + LastMouseHit.WorldForm = this; + PrevMouseHit.WorldForm = this; + initedOk = Renderer.Init(); } @@ -1865,6 +1870,15 @@ namespace CodeWalker public void UpdatePathYndGraphics(YndFile ynd, bool fullupdate) { + if (ynd == null) + { + return; + } + + var selection = SelectedItem.PathNode != null + ? new[] { SelectedItem.PathNode } + : null; + if (fullupdate) { ynd.UpdateAllNodePositions(); @@ -1875,7 +1889,7 @@ namespace CodeWalker else { ynd.UpdateAllNodePositions(); - space.BuildYndVerts(ynd); + space.BuildYndVerts(ynd, selection); } //lock (Renderer.RenderSyncRoot) { @@ -3140,7 +3154,7 @@ namespace CodeWalker MapBox mb = new MapBox(); int lanestot = ln.LaneCountForward + ln.LaneCountBackward; - float lanewidth = n.IsPedNode ? 0.5f : 5.5f; + float lanewidth = ln.GetLaneWidth(); float inner = ln.LaneOffset * lanewidth;// 0.0f; float outer = inner + Math.Max(lanewidth * ln.LaneCountForward, 0.5f); float totwidth = lanestot * lanewidth; @@ -3416,7 +3430,7 @@ namespace CodeWalker } else { - var ms = MapSelection.FromProjectObject(obj, parent); + var ms = MapSelection.FromProjectObject(this, obj, parent); if (!ms.HasValue) { SelectItem(null, addSelection); @@ -3446,7 +3460,7 @@ namespace CodeWalker mhitv.Drawable = gameFileCache.TryGetDrawable(mhitv.Archetype); //no drawable given.. try to get it from the cache.. if it's not there, drawable info won't display... } - + var oldnode = SelectedItem.PathNode; bool change = false; if (mhit != null) { @@ -3594,6 +3608,19 @@ namespace CodeWalker { ProjectForm.OnWorldSelectionChanged(SelectedItem); } + + var newnode = SelectedItem.PathNode; + if (newnode != oldnode)//this is to allow junction heightmaps to be displayed when selecting a junction node + { + UpdatePathYndGraphics(oldnode?.Ynd, false); + UpdatePathYndGraphics(newnode?.Ynd, false); + } + + if (change) + { + // If an item has been selected the user is likely to use a keybind. We need focus! + Focus(); + } } public void SelectMulti(MapSelection[] items, bool addSelection = false, bool notifyProject = true) { @@ -5213,16 +5240,27 @@ namespace CodeWalker private void DeletePathNode(YndNode pathnode) { if (pathnode == null) return; + if (pathnode.Ynd == null) return; - //project not open, or cargen not selected there, just remove the cargen from the ymap... + //project not open, or node not selected there, just remove the node from the ynd... var ynd = pathnode.Ynd; - if (!ynd.RemoveNode(pathnode)) + if (!ynd.RemoveYndNode(Space, pathnode, true, out var affectedFiles)) { MessageBox.Show("Unable to remove path node."); } else { UpdatePathNodeGraphics(pathnode, false); + ProjectForm?.AddYndToProject(ynd); + + foreach (var affectedFile in affectedFiles) + { + UpdatePathYndGraphics(affectedFile, false); + ProjectForm?.AddYndToProject(affectedFile); + affectedFile.HasChanged = true; + } + + SelectItem(null); } } @@ -5798,6 +5836,82 @@ namespace CodeWalker + private void TryCreateNodeLink()//TODO: move this to project window + { + if (SelectionMode != MapSelectionMode.Path) + { + return; + } + + var selection = SelectedItem.MultipleSelectionItems; + if (selection?.Length != 2) + { + MessageBox.Show("Please select 2 nodes to perform this action", + "Join Failed.", + MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + var n1 = selection[0].PathNode; + var n2 = selection[1].PathNode; + if (n1 != null && n2 != null) + { + var link = n1.AddLink(n2); + if (link == null) + { + MessageBox.Show("Failed to join nodes. The nodes are likely too far away!", "Join Failed.", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + var copy = n1.Links.FirstOrDefault(); + + link.SetForwardLanesBidirectionally(copy?.LaneCountBackward ?? 1); + link.SetBackwardLanesBidirectionally(copy?.LaneCountForward ?? 1); + UpdatePathYndGraphics(n1.Ynd, false); + UpdatePathYndGraphics(n2.Ynd, false); + } + } + + private void TryCreateNodeShortcut()//TODO: move this to project window + { + if (SelectionMode != MapSelectionMode.Path) + { + return; + } + + var selection = SelectedItem.MultipleSelectionItems; + if (selection?.Length != 2) + { + MessageBox.Show("Please select 2 nodes to perform this action", + "Join Failed.", + MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + var n1 = selection[0].PathNode; + var n2 = selection[1].PathNode; + if (n1 != null && n2 != null) + { + var link = n1.AddLink(n2); + if (link == null) + { + MessageBox.Show("Failed to join nodes. The nodes are likely too far away!", "Join Failed.", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + link.SetForwardLanesBidirectionally(1); + link.Shortcut = true; + + if (n2.TryGetLinkForNode(n1, out var backLink)) + { + backLink.Shortcut = true; + } + + UpdatePathYndGraphics(n1.Ynd, false); + UpdatePathYndGraphics(n2.Ynd, false); + } + } + @@ -6209,6 +6323,17 @@ namespace CodeWalker { DeleteItem(); } + if (SelectionMode == MapSelectionMode.Path) + { + if (k == Keys.J) + { + TryCreateNodeLink(); + } + if (k == Keys.K) + { + TryCreateNodeShortcut(); + } + } } else {