public void LoadFile(string path) { currfilepath = path; this.Text = "Camera Tool - " + Path.GetFileName(path); pcc = new PCCPackage(path, true, false, true); Indexes = new List<int>(); for (int i = 0; i < pcc.Exports.Count; i++) { PCCPackage.ExportEntry e = pcc.Exports[i]; string c = pcc.GetObject(e.idxClass); if (c == "InterpData") { List<PropertyReader.Property> props = PropertyReader.ReadProp(pcc, e.Data, PropertyReader.detectStart(pcc, e.Data, (uint)e.ObjectFlags)); bool has = false; foreach (PropertyReader.Property p in props) if (pcc.GetName(p.Name) == "InterpGroups") { has = true; break; } if (has) Indexes.Add(i); } } FreshList(); }
public void Init(PCCPackage p, int index = 0) { pcc = p; comboBox1.Items.Clear(); comboBox2.Items.Clear(); for (int i = 0; i < pcc.Header.ExportCount; i++) comboBox1.Items.Add(i.ToString("d6") + " : " + pcc.GetObjectPath(i + 1) + pcc.GetObject(i + 1)); for (int i = 0; i < pcc.Header.ImportCount; i++) comboBox2.Items.Add(i.ToString("d6") + " : " + pcc.GetObjectPath(-i - 1) + pcc.GetObject(-i - 1)); comboBox1.SelectedIndex = comboBox2.SelectedIndex = 0; if (index == 0) r1.Checked = true; if (index > 0) { comboBox1.SelectedIndex = index - 1; r2.Checked = true; } if (index < 0) { comboBox2.SelectedIndex = -index - 1; r3.Checked = true; } }
private void listBox2_SelectedIndexChanged(object sender, EventArgs e) { int n = listBox2.SelectedIndex; if (n == -1) return; PCCPackage p = new PCCPackage(OverView[n].filepath, false, false, true); listBox3.Items.Clear(); foreach (int i in OverView[n].Indexes) listBox3.Items.Add(i + " : " + p.GetObjectPath(i + 1) + p.GetObject(i + 1) + "(" + p.Exports[i].Index + ")"); }
private void generateFromBasefolderToolStripMenuItem_Click(object sender, EventArgs e) { string basepath = KFreonLib.MEDirectories.ME3Directory.cookedPath; if (String.IsNullOrEmpty(basepath)) { MessageBox.Show("This functionality requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3"); return; } KFreonLib.Debugging.DebugOutput.StartDebugger("Main ME3Explorer Form"); string[] files = Directory.GetFiles(basepath, "*.pcc"); OverView = new List<OverViewStruct>(); 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, false, false, true); OverViewStruct o = new OverViewStruct(); o.filepath = file; o.Indexes = new List<int>(); int count = 0; for (int i = 0; i < p.Exports.Count; i++) { if (p.GetObject(p.Exports[i].idxClass) == "InterpData") { o.Indexes.Add(i); string s = ""; if (count++ == 0) s = "\n"; KFreonLib.Debugging.DebugOutput.PrintLn(s + "found " + i + " : " + p.GetObjectPath(i + 1) + p.GetObject(i + 1), false); } } if (o.Indexes.Count != 0) OverView.Add(o); Application.DoEvents(); } FreshOverView(); }
private void button3_Click(object sender, EventArgs e) { OpenFileDialog d = new OpenFileDialog(); d.Filter = "*.pcc|*.pcc"; if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (importpcc != null && importpcc.Source != null) importpcc.Source.Close(); importpcc = new PCCPackage(d.FileName, true); listBox6.Items.Clear(); listBox6.Visible = false; for (int i = 0; i < importpcc.Imports.Count; i++) listBox6.Items.Add(i.ToString("d6") + " : " + importpcc.GetObjectPath(-i - 1) + importpcc.GetObject(-i - 1)); listBox6.Visible = true; } }