public void RefreshSelected() { int n = listBox1.SelectedIndex; if (n == -1) return; int index = objects[n]; bank = new WwiseBank(pcc, index); hb1.ByteProvider = new DynamicByteProvider(bank.getBinary()); rtb1.Text = bank.GetQuickScan(); ListRefresh2(); }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { int n = listBox1.SelectedIndex; if (n == -1) return; rtb1.Text = ""; rtb1.Visible = true; hb1.Visible = false; int index = ObjectIndexes[n]; IExportEntry ex = pcc.Exports[index]; if (ex.ClassName == "WwiseStream") { w = new WwiseStream(pcc as ME3Package, index); string s = "#" + index + " WwiseStream : " + ex.ObjectName + "\n\n"; s += "Filename : \"" + w.FileName + "\"\n"; s += "Data size: " + w.DataSize + " bytes\n"; s += "Data offset: 0x" + w.DataOffset.ToString("X8") + "\n"; s += "ID: 0x" + w.Id.ToString("X8") + " = " + w.Id +"\n"; rtb1.Text = s; } if (ex.ClassName == "WwiseBank") { rtb1.Visible = false; hb1.Visible = true; wb = new WwiseBank(pcc as ME3Package, index); hb1.ByteProvider = new DynamicByteProvider(wb.getBinary()); } }
public override void handleUpdate(List<PackageUpdate> updates) { IEnumerable<PackageUpdate> relevantUpdates = updates.Where(x => x.change != PackageChange.Import && x.change != PackageChange.ImportAdd && x.change != PackageChange.Names); List<int> updatedExports = relevantUpdates.Select(x => x.index).ToList(); if (updatedExports.Contains(bank.MyIndex)) { int index = bank.MyIndex; //loaded sequence is no longer a sequence if (pcc.getExport(index).ClassName != "WwiseBank") { bank = null; listBox2.Items.Clear(); rtb1.Text = ""; hb1.ByteProvider = new DynamicByteProvider(new List<byte>()); hb2.ByteProvider = new DynamicByteProvider(new List<byte>()); } RefreshSelected(); updatedExports.Remove(index); } if (updatedExports.Intersect(objects).Count() > 0) { ListRefresh(); } foreach (var i in updatedExports) { if (pcc.getExport(i).ClassName.Contains("WwiseBank")) { ListRefresh(); break; } } }