private void OpenSpawn(LVDEntry entry) { point2dGroup.Visible = true; currentPoint = (Spawn)entry; xPointUpDown.Value = (decimal)((Spawn)entry).x; yPointUpDown.Value = (decimal)((Spawn)entry).y; }
public void Clear() { currentEntry = null; currentVert = new Vector2(0); currentNormal = new Vector2(0); currentMat = null; currentTreeNode = null; currentPoint = null; currentBounds = null; currentItemSection = null; currentGeneralPoint = null; currentGeneralRect = null; currentGeneralPath = null; name.Text = ""; subname.Text = ""; lvdEntryGroup.Visible = false; collisionGroup.Visible = false; cliffGroup.Visible = false; point2dGroup.Visible = false; boundsGroup.Visible = false; itemSpawnerGroup.Visible = false; point3dGroup.Visible = false; rectangleGroup.Visible = false; pathGroup.Visible = false; }
private void OpenBounds(LVDEntry entry) { boundsGroup.Visible = true; currentBounds = (Bounds)entry; topValUpDown.Value = (decimal)currentBounds.top; rightValUpDown.Value = (decimal)currentBounds.right; leftVal.Value = (decimal)currentBounds.left; bottomVal.Value = (decimal)currentBounds.bottom; }
private void OpenLvdEntry(LVDEntry entry, TreeNode entryTree) { lvdEntryGroup.Visible = true; currentEntry = entry; currentTreeNode = entryTree; nameTB.Text = currentEntry.name; subnameTB.Text = currentEntry.subname; xStartPosUpDown.Value = (decimal)currentEntry.startPos[0]; yStartPosUpDown.Value = (decimal)currentEntry.startPos[1]; zStartPosUpDown.Value = (decimal)currentEntry.startPos[2]; useStartPosCB.Checked = currentEntry.useStartPos; string boneNameRigging = currentEntry.boneName; if (boneNameRigging.Length == 0) { boneNameRigging = "None"; } boneRigSelectButton.Text = boneNameRigging; if (entry is Collision) { Collision col = (Collision)entry; OpenCollision(col); } else if (entry is CollisionCliff) { CollisionCliff cliff = (CollisionCliff)entry; OpenCliff(cliff); } else if (entry is Spawn) { OpenSpawn(entry); } else if (entry is Bounds) { OpenBounds(entry); } else if (entry is ItemSpawner) { OpenItemSpawner(entry); } else if (entry is GeneralPoint) { GeneralPoint generalPoint = (GeneralPoint)entry; OpenGeneralPoint(generalPoint); } else if (entry is GeneralShape) { GeneralShape s = (GeneralShape)entry; OpenGeneralShape(s); } else if (entry is DAT.COLL_DATA) { OpenDatCollData(entry); } }
public void ResetUi() { currentEntry = null; currentTreeNode = null; currentMat = null; currentPoint = null; currentBounds = null; nameTB.Text = ""; subnameTB.Text = ""; HideAllGroupBoxes(); }
public void deleteNode(TreeNode treeNode) { if (!(treeNode.Tag is LVDEntry)) { return; } LVDEntry entry = (LVDEntry)treeNode.Tag; if (entry is Collision) { TargetLVD.collisions.Remove((Collision)entry); } if (entry is CollisionCliff) { TargetLVD.collisions[treeView1.SelectedNode.Parent.Index].cliffs.Remove((CollisionCliff)entry); } if (entry is Spawn) { TargetLVD.respawns.Remove((Spawn)entry); TargetLVD.spawns.Remove((Spawn)entry); } if (entry is Bounds) { TargetLVD.blastzones.Remove((Bounds)entry); TargetLVD.cameraBounds.Remove((Bounds)entry); } if (entry is DamageShape) { TargetLVD.damageShapes.Remove((DamageShape)entry); } if (entry is EnemyGenerator) { TargetLVD.enemySpawns.Remove((EnemyGenerator)entry); } if (entry is GeneralShape) { TargetLVD.generalShapes.Remove((GeneralShape)entry); } if (entry is ItemSpawner) { TargetLVD.itemSpawns.Remove((ItemSpawner)entry); } if (entry is GeneralPoint) { TargetLVD.generalPoints.Remove((GeneralPoint)entry); } treeView1.Nodes.Remove(treeNode); }
public void Open(Object obj, TreeNode entryTree) { ResetUi(); if (obj is LVDEntry) { LVDEntry entry = (LVDEntry)obj; OpenLvdEntry(entry, entryTree); } else if (obj is DAT.JOBJ) { DAT.JOBJ jobj = (DAT.JOBJ)obj; OpenDatJObj(jobj); } }
public void deleteSelected() { if (treeView1.SelectedNode.Tag is LVDEntry) { LVDEntry entry = (LVDEntry)treeView1.SelectedNode.Tag; if (entry is Bounds) { Runtime.TargetLVD.blastzones.Remove((Bounds)entry); Runtime.TargetLVD.cameraBounds.Remove((Bounds)entry); } if (entry is Point) { Runtime.TargetLVD.generalPoints.Remove((Point)entry); Runtime.TargetLVD.respawns.Remove((Point)entry); Runtime.TargetLVD.spawns.Remove((Point)entry); } if (entry is Collision) { Runtime.TargetLVD.collisions.Remove((Collision)entry); } if (entry is Capsule) { Runtime.TargetLVD.damageCapsules.Remove((Capsule)entry); } if (entry is Sphere) { Runtime.TargetLVD.damageSpheres.Remove((Sphere)entry); } if (entry is EnemyGenerator) { Runtime.TargetLVD.enemySpawns.Remove((EnemyGenerator)entry); } if (entry is LVDGeneralShape) { Runtime.TargetLVD.generalShapes.Remove((LVDGeneralShape)entry); } if (entry is ItemSpawner) { Runtime.TargetLVD.items.Remove((ItemSpawner)entry); } if (entry is LVDGeneralShape) { Runtime.TargetLVD.generalShapes.Remove((LVDGeneralShape)entry); } treeView1.Nodes.Remove(treeView1.SelectedNode); } }
private void OpenItemSpawner(LVDEntry entry) { itemSpawnerGroup.Visible = true; ItemSpawner spawner = (ItemSpawner)entry; itemSpawnSectionTreeView.Nodes.Clear(); int i = 1; foreach (LVDShape section in spawner.sections) { itemSpawnSectionTreeView.Nodes.Add(new TreeNode($"Section {i++}") { Tag = section }); } }
public void Clear() { currentEntry = null; currentVert = null; currentNormal = null; currentMat = null; currentTreeNode = null; currentPoint = null; currentBounds = null; currentItemSection = null; currentGeneralPoint = null; currentGeneralRect = null; currentGeneralPath = null; name.Text = ""; subname.Text = ""; collisionGroup.Visible = false; pointGroup.Visible = false; boundGroup.Visible = false; itemSpawnerGroup.Visible = false; generalPointShapeBox.Visible = false; rectangleGroup.Visible = false; pathGroup.Visible = false; }
private void OpenDatCollData(LVDEntry entry) { meleeCollisionGroup.Visible = true; meleeVerts.Nodes.Clear(); meleeLinks.Nodes.Clear(); meleePolygons.Nodes.Clear(); int i = 0; foreach (Vector2 vert in ((DAT.COLL_DATA)entry).vertices) { meleeVerts.Nodes.Add(new TreeNode($"Vertex {i++}") { Tag = vert }); } int j = 0; foreach (DAT.COLL_DATA.Link link in ((DAT.COLL_DATA)entry).links) { meleeLinks.Nodes.Add(new TreeNode($"Link {j++}") { Tag = link }); } int k = 0; foreach (DAT.COLL_DATA.AreaTableEntry ate in ((DAT.COLL_DATA)entry).areaTable) { meleePolygons.Nodes.Add(new TreeNode($"Polygon {k++}") { Tag = ate }); } }
public void open(Object obj, TreeNode entryTree) { collisionGroup.Visible = false; pointGroup.Visible = false; boundGroup.Visible = false; itemSpawnerGroup.Visible = false; generalPointShapeBox.Visible = false; rectangleGroup.Visible = false; pathGroup.Visible = false; meleeCollisionGroup.Visible = false; if (obj is LVDEntry) { LVDEntry entry = (LVDEntry)obj; currentTreeNode = entryTree; currentEntry = entry; //These need implementation in the gui for all objects, not just collisions name.Text = currentEntry.name; subname.Text = currentEntry.subname; xStart.Value = (decimal)currentEntry.startPos[0]; yStart.Value = (decimal)currentEntry.startPos[1]; zStart.Value = (decimal)currentEntry.startPos[2]; flag1.Checked = currentEntry.useStartPos; string boneNameRigging = ""; foreach (char b in currentEntry.boneName) { if (b != (char)0) { boneNameRigging += b; } } if (boneNameRigging.Length == 0) { boneNameRigging = "None"; } button3.Text = boneNameRigging; if (entry is Collision) { Collision col = (Collision)entry; collisionGroup.Visible = true; flag2.Checked = col.flag2; flag3.Checked = col.flag3; flag4.Checked = col.flag4; vertices.Nodes.Clear(); for (int i = 0; i < col.verts.Count; i++) { vertices.Nodes.Add(new TreeNode($"Vertex {i + 1} ({col.verts[i].x},{col.verts[i].y})") { Tag = col.verts[i] }); } lines.Nodes.Clear(); for (int i = 0; i < col.normals.Count; i++) { object[] temp = { col.normals[i], col.materials[i] }; lines.Nodes.Add(new TreeNode($"Line {i + 1}") { Tag = temp }); } } else if (entry is Spawn) { pointGroup.Visible = true; currentPoint = (Spawn)entry; xPoint.Value = (decimal)((Spawn)entry).x; yPoint.Value = (decimal)((Spawn)entry).y; } else if (entry is Bounds) { boundGroup.Visible = true; currentBounds = (Bounds)entry; topVal.Value = (decimal)currentBounds.top; rightVal.Value = (decimal)currentBounds.right; leftVal.Value = (decimal)currentBounds.left; bottomVal.Value = (decimal)currentBounds.bottom; } else if (entry is ItemSpawner) { itemSpawnerGroup.Visible = true; ItemSpawner spawner = (ItemSpawner)entry; treeView1.Nodes.Clear(); int i = 1; foreach (Section section in spawner.sections) { treeView1.Nodes.Add(new TreeNode($"Section {i++}") { Tag = section }); } } else if (entry is GeneralPoint) { generalPointShapeBox.Visible = true; GeneralPoint p = (GeneralPoint)entry; currentGeneralPoint = p; pointShapeX.Value = (Decimal)p.x; pointShapeY.Value = (Decimal)p.y; } else if (entry is GeneralShape) { GeneralShape s = (GeneralShape)entry; if (s.type == 3) { rectangleGroup.Visible = true; currentGeneralRect = s; rectUpperX.Value = (Decimal)s.x2; rectUpperY.Value = (Decimal)s.y2; rectLowerX.Value = (Decimal)s.x1; rectLowerY.Value = (Decimal)s.y1; } else if (s.type == 4) { pathGroup.Visible = true; currentGeneralPath = s; treeViewPath.Nodes.Clear(); int j = 0; foreach (Vector2D v in s.points) { treeViewPath.Nodes.Add(new TreeNode($"Point {++j} ({v.x},{v.y})") { Tag = v }); } } } else if (entry is DAT.COLL_DATA) { meleeCollisionGroup.Visible = true; meleeVerts.Nodes.Clear(); meleeLinks.Nodes.Clear(); meleePolygons.Nodes.Clear(); int i = 0; foreach (Vector2D vert in ((DAT.COLL_DATA)entry).vertices) { meleeVerts.Nodes.Add(new TreeNode($"Vertex {i++}") { Tag = vert }); } i = 0; foreach (DAT.COLL_DATA.Link link in ((DAT.COLL_DATA)entry).links) { meleeLinks.Nodes.Add(new TreeNode($"Link {i++}") { Tag = link }); } i = 0; foreach (DAT.COLL_DATA.AreaTableEntry ate in ((DAT.COLL_DATA)entry).areaTable) { meleePolygons.Nodes.Add(new TreeNode($"Polygon {i++}") { Tag = ate }); } } } else if (obj is DAT.JOBJ) { DAT.JOBJ jobj = (DAT.JOBJ)obj; currentJobj = jobj; jobjX.Value = (Decimal)jobj.pos.X; jobjY.Value = (Decimal)jobj.pos.Y; jobjZ.Value = (Decimal)jobj.pos.Z; } }
public void open(LVDEntry entry, TreeNode entryTree) { currentTreeNode = entryTree; currentEntry = entry; collisionGroup.Visible = false; pointGroup.Visible = false; boundGroup.Visible = false; itemSpawnerGroup.Visible = false; generalPointShapeBox.Visible = false; rectangleGroup.Visible = false; pathGroup.Visible = false; name.Text = currentEntry.name; subname.Text = currentEntry.subname; if (entry is Collision) { Collision col = (Collision)entry; collisionGroup.Visible = true; xStart.Value = (decimal)col.startPos[0]; yStart.Value = (decimal)col.startPos[1]; zStart.Value = (decimal)col.startPos[2]; flag1.Checked = col.useStartPos; flag2.Checked = col.flag2; flag3.Checked = col.flag3; flag4.Checked = col.flag4; vertices.Nodes.Clear(); string boneNameRigging = ""; foreach (char b in col.unk4) { if (b != (char)0) { boneNameRigging += b; } } if (boneNameRigging.Length == 0) { boneNameRigging = "None"; } button3.Text = boneNameRigging; for (int i = 0; i < col.verts.Count; i++) { vertices.Nodes.Add(new TreeNode($"Vertex {i+1} ({col.verts[i].x},{col.verts[i].y})") { Tag = col.verts[i] }); } lines.Nodes.Clear(); for (int i = 0; i < col.normals.Count; i++) { object[] temp = { col.normals[i], col.materials[i] }; lines.Nodes.Add(new TreeNode($"Line {i+1}") { Tag = temp }); } } else if (entry is Point) { pointGroup.Visible = true; currentPoint = (Point)entry; xPoint.Value = (decimal)((Point)entry).x; yPoint.Value = (decimal)((Point)entry).y; } else if (entry is Bounds) { boundGroup.Visible = true; currentBounds = (Bounds)entry; topVal.Value = (decimal)currentBounds.top; rightVal.Value = (decimal)currentBounds.right; leftVal.Value = (decimal)currentBounds.left; bottomVal.Value = (decimal)currentBounds.bottom; } else if (entry is ItemSpawner) { itemSpawnerGroup.Visible = true; ItemSpawner spawner = (ItemSpawner)entry; treeView1.Nodes.Clear(); int i = 1; foreach (Section section in spawner.sections) { treeView1.Nodes.Add(new TreeNode($"Section {i++}") { Tag = section }); } } else if (entry is GeneralPoint) { generalPointShapeBox.Visible = true; GeneralPoint p = (GeneralPoint)entry; currentGeneralPoint = p; pointShapeX.Value = (Decimal)p.x; pointShapeX.Value = (Decimal)p.y; } else if (entry is GeneralRect) { rectangleGroup.Visible = true; GeneralRect r = (GeneralRect)entry; currentGeneralRect = r; rectUpperX.Value = (Decimal)r.x2; rectUpperY.Value = (Decimal)r.y2; rectLowerX.Value = (Decimal)r.x1; rectLowerY.Value = (Decimal)r.y1; } else if (entry is GeneralPath) { pathGroup.Visible = true; GeneralPath p = (GeneralPath)entry; currentGeneralPath = p; treeViewPath.Nodes.Clear(); int j = 0; foreach (Vector2D v in p.points) { treeViewPath.Nodes.Add(new TreeNode($"Point {++j} ({v.x},{v.y})") { Tag = v }); } } }