public PartProperties(PartTreeNode node, GuiCommandExecutor ex, NodeClick click) : base(click, ex) { part = node.getPart(); Name = part.SongInfo.SongName; Artist = part.SongInfo.ArtistName; Album = part.SongInfo.AlbumName; }
public InstrumentProperties(PartTreeNode n, GuiCommandExecutor ex, NodeClick cl) : base(cl, ex) { part = n.getPart(); Instrument = part.InstrumentInfo.Type.getStringFromInstrumentType(); Instruments = InstrumentTypeExtensions.getAllInstrumentTypeStrings(); Strings = part.InstrumentInfo.Strings.ToString(); }
private void RecursiveGroupImageCheck(PartTreeNode node, ref bool hasEnabled, ref bool hasDisabled) { if (hasEnabled && hasDisabled) return; if (node.Nodes.Count == 0) { if (node.PartEnabled) hasEnabled = true; else hasDisabled = true; } else { foreach (PartTreeNode n in node.Nodes) RecursiveGroupImageCheck(n, ref hasEnabled, ref hasDisabled); } }
public static void RecursiveAssign(PartTreeNode node, bool setAll, bool setTo = true) { foreach (PartTreeNode subNode in node.Nodes) { if (subNode.Nodes.Count != 0) RecursiveAssign(subNode, setAll, setTo); else { if (setAll) subNode.PartEnabled = setTo; else subNode.PartEnabled = !subNode.PartEnabled; } } node.CheckGroupImage(); }
private void FillPartList() { var owners = new List<PartTreeNode>(); var radios = new List<PartTreeNode>(); treeView2.Nodes.Clear(); int meshIndex = 0; foreach (Mesh part in CurrentModel.Meshes) { string name = part.Name; PartTreeNode node; if (name.Contains('.')) { string[] args = name.Split('.'); PartTreeNode owner = CreateNodePath(treeView2, CurrentModel, part, args, owners, radios); owner.Nodes.Add(node = new PartTreeNode(CurrentModel, part, meshIndex, args[args.Length - 1])); } else treeView2.Nodes.Add(node = new PartTreeNode(CurrentModel, part, meshIndex)); if (node.IsRadio) radios.Add(node); meshIndex++; } radios.Reverse(); foreach (PartTreeNode n in owners) n.CheckGroupImage(); foreach (var r in radios) { var other = r.IsOtherRadioButtonEnabled(); if (other != null) { PartTreeNode.RecursiveAssign(r, true, false); r.CheckGroupImage(); } } for (int i = 1; i <= (int)ModelPart.RightLegArmor; ++i) CheckQuickPartState((ModelPart)i); }
private PartTreeNode CreateNodePath(TreeView treeView, Model m, Mesh part, string[] path, List<PartTreeNode> owners, List<PartTreeNode> radios) { PartTreeNode node = null; for (int i = 0; i < path.Length - 1; ++i) { if (node == null) { TreeNode[] nodes = treeView.Nodes.Find(path[i], false); if (nodes.Length == 0) { treeView.Nodes.Add(node = new PartTreeNode(CurrentModel, part, -1, path[i])); owners.Add(node); if (node.IsRadio) radios.Add(node); } else node = (PartTreeNode) nodes[0]; } else { TreeNode[] nodes = node.Nodes.Find(path[i], false); if (nodes.Length == 0) { PartTreeNode old = node; old.Nodes.Add(node = new PartTreeNode(CurrentModel, part, -1, path[i])); owners.Add(node); if (node.IsRadio) radios.Add(node); } else node = (PartTreeNode)nodes[0]; } } return node; }
public void updatePartBounds(PartTreeNode node) { position.resetPositionToPartBeginning(node.Bounds); node?.updateBounds(); }