public void GetProperties(int n) { List<PropertyReader.Property> p; switch (pcc.Exports[n].ClassName) { default: byte[] buff = pcc.Exports[n].Data; p = PropertyReader.getPropList(pcc, buff); break; } pg = new PropGrid(); pg1.SelectedObject = pg; pg.Add(new CustomProperty("Name", "_Meta", pcc.Exports[n].ObjectName, typeof(string), true, true)); pg.Add(new CustomProperty("Class", "_Meta", pcc.Exports[n].ClassName, typeof(string), true, true)); pg.Add(new CustomProperty("Data Offset", "_Meta", pcc.Exports[n].DataOffset, typeof(int), true, true)); pg.Add(new CustomProperty("Data Size", "_Meta", pcc.Exports[n].DataSize, typeof(int), true, true)); for (int l = 0; l < p.Count; l++) pg.Add(PropertyReader.PropertyToGrid(p[l], pcc)); pg1.Refresh(); }
//private void PreviewProps(int n) //{ // PCCObject.ExportEntry ent = pcc.Exports[n]; // List<SaltPropertyReader.Property> props = SaltPropertyReader.getPropList(pcc, ent.Data); // rtb1.Visible = true; // string s = ""; // s += "ObjectName : " + ent.ObjectName + "\n"; // s += "Class : " + ent.ClassName + "\n"; // s += "Data size : 0x" + ent.DataSize.ToString("X8") + "\n"; // s += "Data offset : 0x" + ent.DataOffset.ToString("X8") + "\n\nProperties: \n"; // foreach (SaltPropertyReader.Property p in props) // s += SaltPropertyReader.PropertyToText(p, pcc) + "\n"; // if (ent.ClassName == "Texture2D" || ent.ClassName == "LightMapTexture2D" || ent.ClassName == "TextureFlipBook") // { // s += "\nImage Info: \n"; // try // { // Texture2D tex2D = new Texture2D(pcc, n, Path.Combine(ME2Directory.gamePath, "BIOGame")); // for (int i = 0; i < tex2D.imgList.Count; i++) // { // s += i + ": Location: " + tex2D.imgList[i].storageType + ", Offset: " + tex2D.imgList[i].offset + ", ImgSize: " + tex2D.imgList[i].imgSize.ToString() + ", CprSize = " + tex2D.imgList[i].cprSize + ", UncSize = " + tex2D.imgList[i].uncSize + "\n"; // } // } // catch { } // } // rtb1.Text = s; // Status.Text = ent.ClassName + " Offset: " + ent.DataOffset + " - " + (ent.DataOffset + ent.DataSize); //} public void PreviewProps() { int n = GetSelected(); if (n == -1 || !(CurrentView == 2 || CurrentView == 3)) return; List<SaltPropertyReader.Property> p; //propGrid.Visible = true; //hb1.Visible = false; //rtb1.Visible = false; //treeView1.Visible = false; switch (pcc.Exports[n].ClassName) { default: byte[] buff = pcc.Exports[n].Data; p = SaltPropertyReader.getPropList(pcc, buff); break; } pg = new PropGrid(); propGrid.SelectedObject = pg; pg.Add(new CustomProperty("Name", "_Meta", pcc.Exports[n].ObjectName, typeof(string), true, true)); pg.Add(new CustomProperty("Class", "_Meta", pcc.Exports[n].ClassName, typeof(string), true, true)); pg.Add(new CustomProperty("Data Offset", "_Meta", pcc.Exports[n].DataOffset, typeof(int), true, true)); pg.Add(new CustomProperty("Data Size", "_Meta", pcc.Exports[n].DataSize, typeof(int), true, true)); for (int l = 0; l < p.Count; l++) pg.Add(SaltPropertyReader.PropertyToGrid(p[l], pcc)); propGrid.Refresh(); propGrid.ExpandAllGridItems(); //UpdateStatusEx(n); }