public BoneImage(BoneGraphics parent) { IsRoot = false; this.Parent = parent; Length = 100; Angle = 0; }
public void Add(BoneGraphics graphics) { list.Add(graphics); if (sortedList.Count == 0) { sortedList.Add(graphics); } else if (sortedList.Count == 1) { if (sortedList[0].Order > graphics.Order) sortedList.Add(graphics); else sortedList.Insert(0, graphics); } else { if (sortedList[0].Order < graphics.Order) { sortedList.Insert(0, graphics); } else if (sortedList[sortedList.Count - 1].Order >= graphics.Order) { sortedList.Add(graphics); } else { for (int i = 0; i < sortedList.Count - 1; i++) { if (sortedList[i].Order >= graphics.Order && sortedList[i + 1].Order <= graphics.Order) { sortedList.Insert(i + 1, graphics); break; } } } } }
public void Remove(BoneGraphics graphics) { list.Remove(graphics); sortedList.Remove(graphics); }
public void Resort(BoneGraphics g) { if (sortedList.IndexOf(g) < 0) return; sortedList.Remove(g); Add(g); }
public int FindGraphics(BoneGraphics g) { return list.IndexOf(g); }
public void RemoveImage(BoneImage img, BoneGraphics bg) { //РЕАЛИЗОВАТЬ }
public void RemoveGraphics(BoneGraphics bg) { //РЕАЛИЗОВАТЬ }
public void AddImage(BoneGraphics bg, Bitmap bmp, bool asDefault) { BoneImage bi; if (asDefault) bi = bg.AddDefaultImage(bmp); else bi = bg.AddImage(bmp); if (parentImageNode == null) return; int idx = Character.GraphicsManager.FindGraphics(bg); TreeNode node = parentImageNode.Nodes.Find("boneGraphics" + idx, false)[0]; TreeNode node2 = node.Nodes.Add("boneImage" + (bg.Count - 1), "image " + (bg.Count - 1), "image", "image"); node2.Tag = bi; bi.Shift = new PointF(0, -bi.Image.Width / 2); node2.EnsureVisible(); Redraw(); }
public void AddGraphics(Bone bone) { BoneGraphics bg; Character.GraphicsManager.Add(bg = new BoneGraphics(Character)); bg.SetParent(bone); if (parentImageNode == null) return; TreeNode node = parentImageNode.Nodes.Add("boneGraphics" + (Character.GraphicsManager.Count - 1), bone.Name + " graphics " + (Character.GraphicsManager.Count - 1), "graphics"); node.SelectedImageKey = "graphics"; node.Tag = bg; node.EnsureVisible(); }