private void toolStripButton1_Click(object sender, EventArgs e) { int n = toolStripComboBox1.SelectedIndex; if (n == -1) return; Dialog = new ME1BioConversation(pcc as ME1Package, Objs[n]); tlkFileSet.loadData(Dialog.TlkFileSet - 1); if (!tlkFiles.tlkList.Contains(tlkFileSet.talkFiles[tlkFileSet.selectedTLK])) { tlkFiles.tlkList.Add(tlkFileSet.talkFiles[tlkFileSet.selectedTLK]); } RefreshTabs(); }
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 (Dialog != null && updatedExports.Contains(Dialog.MyIndex)) { //loaded dialog is no longer a dialog if (pcc.getExport(Dialog.MyIndex).ClassName != "BioConversation") { listBox1.Items.Clear(); listBox2.Items.Clear(); listBox3.Items.Clear(); listBox4.Items.Clear(); listBox5.Items.Clear(); treeView1.Nodes.Clear(); treeView2.Nodes.Clear(); } else { Dialog = new ME1BioConversation(pcc as ME1Package, Dialog.MyIndex); RefreshTabs(); } updatedExports.Remove(Dialog.MyIndex); } if (updatedExports.Intersect(Objs).Count() > 0) { Objs = new List<int>(); for (int i = 0; i < pcc.Exports.Count; i++) if (pcc.Exports[i].ClassName == "BioConversation") Objs.Add(i); RefreshCombo(); } else { foreach (var i in updatedExports) { if (pcc.getExport(i).ClassName == "BioConversation") { Objs = new List<int>(); for (int j = 0; j < pcc.Exports.Count; j++) if (pcc.Exports[j].ClassName == "BioConversation") Objs.Add(j); RefreshCombo(); break; } } } }