示例#1
0
        public TreeNode ToTree()
        {
            TreeNode t = new TreeNode("#E" + MyIndex.ToString("d6") + " : " + pcc.GetObject(MyIndex + 1) + "(" + pcc.GetObjectClass(MyIndex + 1) + ")");

            t.Name = (MyIndex + 1).ToString();
            for (int i = 0; i < Objects.Count; i++)
            {
                if (Objects[i] == 0)
                {
                    continue;
                }
                TreeNode t2 = new TreeNode();
                if (Objects[i] > 0)
                {
                    t2.Text = "#E" + (Objects[i] - 1).ToString("d6") + " : " + pcc.GetObject(Objects[i]) + "(" + pcc.GetObjectClass(Objects[i]) + ")";
                }
                else
                {
                    t2.Text = "#I" + (-Objects[i] - 1).ToString("d6") + " : " + pcc.GetObject(Objects[i]) + "(" + pcc.GetObjectClass(Objects[i]) + ")";
                }
                t2.Name = Objects[i].ToString();
                if (Objects[i] > 0 && pcc.GetObjectClass(Objects[i]) != "Sequence")
                {
                    t2 = MakeSubObj(t2, Objects[i] - 1);
                }
                t.Nodes.Add(t2);
            }
            return(t);
        }
示例#2
0
        //for debugging purposes. not exposed to user
        private void InterpTrackScan_Click(object sender, EventArgs e)
        {
            KFreonLib.Debugging.DebugOutput.StartDebugger("Main ME3Explorer Form");
            string basepath = ME3Directory.cookedPath;

            string[]      files  = Directory.GetFiles(basepath, "*.pcc");
            List <string> conds  = new List <string>();
            List <string> conds1 = new List <string>();

            //string property = Microsoft.VisualBasic.Interaction.InputBox("Please enter property name", "ME3 Explorer");
            string name;

            for (int f = 0; f < files.Length; f++)
            {
                string file = files[f];
                //KFreonLib.Debugging.DebugOutput.PrintLn((f + 1) + " / " + files.Length + " : " + file + " :", true);
                PCCPackage p = new PCCPackage(file, true, false, true);
                for (int i = 0; i < p.Exports.Count; i++)
                {
                    if (p.GetObjectClass(i).StartsWith("InterpTrackVisibility")) //GetObject(p.Exports[i].idxLink).StartsWith("InterpGroup"))
                    {
                        List <ME3LibWV.PropertyReader.Property> props = ME3LibWV.PropertyReader.getPropList(p, p.Exports[i].Data);
                        foreach (ME3LibWV.PropertyReader.Property prop in props)
                        {
                            //KFreonLib.Debugging.DebugOutput.PrintLn(p.GetName(prop.Name));
                            if (p.GetName(prop.Name) == "VisibilityTrack")
                            {
                                int pos   = 28;
                                int count = BitConverter.ToInt32(prop.raw, 24);
                                for (int j = 0; j < count; j++)
                                {
                                    List <ME3LibWV.PropertyReader.Property> p2 = ME3LibWV.PropertyReader.ReadProp(p, prop.raw, pos);
                                    for (int k = 0; k < p2.Count; k++)
                                    {
                                        name = p.GetName(p2[k].Name);
                                        if (name == "Action")
                                        {
                                            if (!conds.Contains(p.GetName(BitConverter.ToInt32(p2[k].raw, 32))))
                                            {
                                                conds.Add(p.GetName(BitConverter.ToInt32(p2[k].raw, 32)));
                                                KFreonLib.Debugging.DebugOutput.PrintLn("Action " + p.GetName(BitConverter.ToInt32(p2[k].raw, 24)) + ", " + p.GetName(BitConverter.ToInt32(p2[k].raw, 32)) + "               at: #" + i + " " + p.GetObjectPath(i + 1) + p.GetObjectClass(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                                            }
                                        }
                                        else if (name == "ActiveCondition")
                                        {
                                            if (!conds1.Contains(p.GetName(BitConverter.ToInt32(p2[k].raw, 32))))
                                            {
                                                conds1.Add(p.GetName(BitConverter.ToInt32(p2[k].raw, 32)));
                                                KFreonLib.Debugging.DebugOutput.PrintLn("ActiveCondition " + p.GetName(BitConverter.ToInt32(p2[k].raw, 24)) + ", " + p.GetName(BitConverter.ToInt32(p2[k].raw, 32)) + "               at: #" + i + " " + p.GetObjectPath(i + 1) + p.GetObjectClass(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                                            }
                                        }
                                        pos += p2[k].raw.Length;
                                    }
                                }
                            }
                            //if (p.GetName(prop.Name) == property)
                            //{
                            //    if(!conds.Contains(p.GetName(BitConverter.ToInt32(prop.raw, 32))))
                            //    {
                            //        conds.Add(p.GetName(BitConverter.ToInt32(prop.raw, 32)));
                            //        KFreonLib.Debugging.DebugOutput.PrintLn(p.GetName(BitConverter.ToInt32(prop.raw, 24)) + ", " + p.GetName(BitConverter.ToInt32(prop.raw, 32)) + "               at: #" + i + " " + p.GetObjectPath(i + 1) + p.GetObjectClass(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                            //    }
                            //}
                        }
                        //KFreonLib.Debugging.DebugOutput.PrintLn(i + " : " + p.GetObjectClass(i + 1) + "               at: " + p.GetObjectPath(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                    }
                }
                Application.DoEvents();
            }
            KFreonLib.Debugging.DebugOutput.PrintLn();
            KFreonLib.Debugging.DebugOutput.PrintLn("*****************");
            KFreonLib.Debugging.DebugOutput.PrintLn("Done");
        }