public SplinePoint0Node(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; StructProperty splineInfo = export.GetProperty <StructProperty>("SplineInfo"); if (splineInfo != null) { ArrayProperty <StructProperty> pointsProp = splineInfo.GetProp <ArrayProperty <StructProperty> >("Points"); StructProperty point0 = pointsProp[0]; StructProperty point1 = pointsProp[1]; a = PathfindingEditor.GetVector2(point0.GetProp <StructProperty>("OutVal")); tan1 = PathfindingEditor.GetVector2(point0.GetProp <StructProperty>("LeaveTangent")); tan2 = PathfindingEditor.GetVector2(point1.GetProp <StructProperty>("ArriveTangent")); d = PathfindingEditor.GetVector2(point1.GetProp <StructProperty>("OutVal")); // = getType(s); float w = 25; float h = 25; shape = PPath.CreateEllipse(0, 0, w, h); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = pathfindingNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(export.Index + "\nSpline Start"); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); var props = export.GetProperties(); this.TranslateBy(x, y); } }
private int HandleCommandLineJumplistCall(string[] args, out int exitCode) { if (args.Length < 2) { exitCode = 0; return(1); } string arg = args[1]; if (arg == "JUMPLIST_PACKAGE_EDITOR") { PackageEditor editor = new PackageEditor(); editor.BringToFront(); editor.Show(); exitCode = 0; return(0); } if (arg == "JUMPLIST_SEQUENCE_EDITOR") { SequenceEditor editor = new SequenceEditor(); editor.BringToFront(); editor.Show(); exitCode = 0; return(0); } if (arg == "JUMPLIST_PATHFINDING_EDITOR") { PathfindingEditor editor = new PathfindingEditor(); editor.BringToFront(); editor.Show(); exitCode = 0; return(0); } string ending = Path.GetExtension(args[1]).ToLower(); switch (ending) { case ".pcc": PackageEditor editor = new PackageEditor(); editor.Show(); editor.LoadFile(args[1]); exitCode = 0; return(1); } exitCode = 0; return(1); }
public void PassPathfindingNodeEditorIn(PathfindingEditor PathfindingEditorInstance) { this.PathfindingEditorInstance = PathfindingEditorInstance; }
private void populateDuplicateGUIDs() { navGuidLists = new Dictionary <string, List <UnrealGUID> >(); duplicateGuids = new List <UnrealGUID>(); IExportEntry level = null; foreach (IExportEntry exp in pcc.Exports) { if (exp.ClassName == "Level" && exp.ObjectName == "PersistentLevel") { level = exp; break; } } int start = 0x4; if (level != null) { start = PathfindingEditor.findEndOfProps(level); } //Read persistent level binary byte[] data = level.Data; uint exportid = BitConverter.ToUInt32(data, start); start += 4; uint numberofitems = BitConverter.ToUInt32(data, start); int countoffset = start; int itemcount = 2; start += 8; while (itemcount < numberofitems) { //get header. uint itemexportid = BitConverter.ToUInt32(data, start); if (itemexportid - 1 < pcc.Exports.Count && itemexportid > 0) { IExportEntry exportEntry = pcc.Exports[(int)itemexportid - 1]; StructProperty navguid = exportEntry.GetProperty <StructProperty>("NavGuid"); if (navguid != null) { int a = navguid.GetProp <IntProperty>("A"); int b = navguid.GetProp <IntProperty>("B"); int c = navguid.GetProp <IntProperty>("C"); int d = navguid.GetProp <IntProperty>("D"); UnrealGUID nav = new UnrealGUID(); nav.A = a; nav.B = b; nav.C = c; nav.D = d; nav.export = exportEntry; nav.levelListIndex = itemcount; List <UnrealGUID> list; if (navGuidLists.TryGetValue(nav.ToString(), out list)) { list.Add(nav); } else { list = new List <UnrealGUID>(); navGuidLists[nav.ToString()] = list; list.Add(nav); } } start += 4; itemcount++; } else { //INVALID or empty item encountered. We don't care right now though. start += 4; itemcount++; } } duplicatesListBox.Items.Clear(); foreach (List <UnrealGUID> guidList in navGuidLists.Values) { if (guidList.Count > 1) { Debug.WriteLine("Number of duplicates: " + guidList.Count); //contains duplicates foreach (UnrealGUID guid in guidList) { //Debug.WriteLine(guid.levelListIndex + " Duplicate: " + guid.export.ObjectName); duplicateGuids.Add(guid); duplicatesListBox.Items.Add(guid.levelListIndex + " " + guid.export.Index + " " + guid.export.ObjectName + "_" + guid.export.indexValue); } } else { Debug.WriteLine("Not a duplicate "); } } }
public ReachSpecRecalculator(PathfindingEditor pe) { this.pe = pe; InitializeComponent(); CenterToParent(); }