Beispiel #1
0
        public void LoadFileNames()
        {
            TV1.BeginUpdate();
            TV1.Nodes.Clear();
            TV1.Sort();

            // add pcc list of main directory
            currentPCC = "";
            string[] files = Directory.GetFiles(pathCooked, "*.pcc");
            TreeNode t     = new TreeNode(mainPCCFolder);

            t.ImageIndex = 1;
            for (int i = 0; i < files.Length; i++)
            {
                TreeNode t2 = new TreeNode(Path.GetFileName(files[i]));
                t2.ImageIndex = 1;
                t.Nodes.Add(t2);
            }
            TV1.Nodes.Add(t);

            // add pcc list of every dlc found

            /*string[] dlcs = Directory.GetDirectories(ME3Directory.DLCPath, "DLC_*");
             * foreach (string dlcPath in dlcs)
             * {
             *  // build path of current dlc
             *  string dlcName = Path.GetFileName(dlcPath);
             *  string dlcFullPath = ME3Directory.DLCFilePath(dlcName);
             *
             *  // build root node of current dlc
             *  TreeNode dlcNode = new TreeNode(dlcName);
             *  dlcNode.ImageIndex = 1;
             *  TV1.Nodes.Add(dlcNode);
             *
             *  // load list of pcc stored in current dlc and add nodes to root node
             *  AmaroK86.MassEffect3.DLCBase dlcBase = new AmaroK86.MassEffect3.DLCBase(dlcFullPath);
             *  List<string> dlcPccList = dlcBase.fileNameList.Where(fileName => Path.GetExtension(fileName) == ".pcc").ToList();
             *  foreach (string path in dlcPccList)
             *  {
             *      // pcc are selectable inside treeView throught their full name (ex. "/BIOGame/DLC/DLC_HEN_PR/CookedPCConsole/BioA_Cat001.pcc")
             *      TreeNode dlcPccNode = dlcNode.Nodes.Add(path, Path.GetFileName(path));
             *      dlcPccNode.ImageIndex = 1;
             *  }
             * }*/

            //TV1.Nodes[0].Expand();
            TV1.EndUpdate();

            listView1.Clear();
        }
Beispiel #2
0
        public void GeneratePccTree()
        {
            TV1.BeginUpdate();
            TV1.Nodes.Clear();

            TreeNode root = TV1.Nodes.Add(pcc.pccFileName, pcc.pccFileName);

            root.ImageIndex = 1;

            foreach (KFreonLib.PCCObjects.ME3ExportEntry exportEntry in pcc.Exports)
            {
                string[] pathChunks = (exportEntry.PackageFullName).Split('.');

                string recombinedPath = "";
                foreach (string chunk in pathChunks)
                {
                    if (recombinedPath == "")
                    {
                        recombinedPath += chunk;
                    }
                    else
                    {
                        recombinedPath += "." + chunk;
                    }

                    if (root.Nodes.ContainsKey(recombinedPath))
                    {
                        root = root.Nodes[recombinedPath];
                    }
                    else
                    {
                        root = root.Nodes.Add(recombinedPath, chunk);
                    }

                    root.ImageIndex = 1;
                }

                root = TV1.Nodes[pcc.pccFileName];
            }
            root.Expand();

            TV1.Sort();
            TV1.EndUpdate();
        }