public void OpenWorkspace(string wrkspce) { Manager.ReadWRKSPC(wrkspce); List <TreeNode> col = new List <TreeNode>(); FileTree.BeginUpdate(); foreach (Project p in Manager.Projects) { _curFighter = Manager.OpenFighter(p.ACMDPath); _curFighter.AnimationHashPairs = Manager.getAnimNames(p.AnimationFile); string name = $"{p.ProjectName} - [{(p.ProjectType == ProjType.Fighter ? "Fighter" : "Weapon")}]"; TreeNode pNode = new TreeNode(name); TreeNode Actions = new TreeNode("MSCSB (ActionScript)"); TreeNode ACMD = new TreeNode("ACMD (AnimCmd)"); TreeNode Weapons = new TreeNode("Weapons"); TreeNode Parameters = new TreeNode("Parameters"); foreach (uint u in _curFighter.MotionTable) { if (u == 0) { continue; } CommandListGroup g = new CommandListGroup(_curFighter, u) { ToolTipText = $"[{u:X8}]" }; if (AnimHashPairs.ContainsKey(u)) { g.Text = AnimHashPairs[u]; } ACMD.Nodes.Add(g); } pNode.Nodes.AddRange(new[] { Actions, ACMD, Weapons, Parameters }); col.Add(pNode); } FileTree.Nodes.AddRange(col.ToArray()); Runtime.isRoot = true; FileTree.EndUpdate(); }
private void parseAnimations(string path) { TreeView tree = FileTree; AnimHashPairs = Manager.getAnimNames(path); tree.BeginUpdate(); for (int i = 0; i < tree.Nodes.Count; i++) { if (tree.Nodes[i] is CommandListNode | tree.Nodes[i] is CommandListGroup) { var node = ((BaseNode)tree.Nodes[i]); string str = ""; AnimHashPairs.TryGetValue(node.CRC, out str); if (string.IsNullOrEmpty(str)) { str = node.Name; } tree.Nodes[i].Text = str; } } tree.EndUpdate(); }