private void duplicateToolStripMenuItem_Click(object sender, EventArgs e) { Entity.InternalLocation currentLoc = GetSelectedLocation(); if (currentLoc == null) return; Entity.InternalLocation location = new Entity.InternalLocation(); location.Name = "New Location"; location.Index = TheEntity.Locations.Count; location.Orientation = new Quaterniond(currentLoc.Orientation.Xyz, currentLoc.Orientation.W); location.Origin = new Vector3d(currentLoc.Origin); location.Size = new Vector3d(currentLoc.Size); location.Shape = currentLoc.Shape; TheEntity.Locations.Add(location); TreeNode node = new TreeNode(location.ToString()); node.Tag = location; EntityRootNode.Nodes.Add(node); ComponentsList.SelectedNode = node; Dirty(); }
private void newToolStripMenuItem1_Click(object sender, EventArgs e) { Entity.InternalLocation location = new Entity.InternalLocation(); location.Name = "New Location"; location.Index = TheEntity.Locations.Count; TheEntity.Locations.Add(location); TreeNode node = AddLocatioNode(location); ComponentsList.SelectedNode = node; Dirty(); }
public override void Set(object item, Entity ent) { base.Set(item, ent); Entity.InternalLocation location = item as Entity.InternalLocation; TheLocation = location; }