public void InitTlkManager(ME1Package pcc, BioTlkFileSet tlkSet, TalkFiles tlks = null) { packages = new List<ME1Package>(); tlkFileSets = new List<BioTlkFileSet>(); selectedTlks = tlks ?? new TalkFiles(); packages.Add(pcc); refreshFileBox(); fileBox.SelectedIndex = 0; Application.DoEvents(); for (int i = 0; i < tlkFileSets.Count; i++) { if (tlkFileSets[i].index == tlkSet.index) { bioTlkSetBox.SelectedIndex = i; Application.DoEvents(); tlkFileBox.SelectedIndex = tlkSet.selectedTLK; break; } } TalkFile tlk = tlkSet.talkFiles[tlkSet.selectedTLK]; if (!selectedTlks.tlkList.Contains(tlk)) { selectedTlks.tlkList.Add(tlk); } foreach (TalkFile tlkFile in selectedTlks.tlkList) { selectedTlkFilesBox.Items.Add(Path.GetFileName(pcc.FileName) + " -> " + tlkFile.BioTlkSetName + tlkFile.Name); } }
private void fileBox_SelectedIndexChanged(object sender, EventArgs e) { bioTlkSetBox.Items.Clear(); tlkFileBox.Items.Clear(); int n = fileBox.SelectedIndex; if (n == -1) { return; } ME1Package pcc = packages[n]; tlkFileSets.Clear(); IReadOnlyList<IExportEntry> Exports = pcc.Exports; for (int i = 0; i < Exports.Count; i++) { if(Exports[i].ClassName == "BioTlkFileSet") { BioTlkFileSet b = new BioTlkFileSet(pcc, i); tlkFileSets.Add(b); bioTlkSetBox.Items.Add(b.Name); } } //No BioTlkSets, look for loose BioTlkFiles if(tlkFileSets.Count == 0) { BioTlkFileSet tlkSet = new BioTlkFileSet(pcc); for (int i = 0; i < Exports.Count; i++) { if (Exports[i].ClassName == "BioTlkFile") { TalkFile tlk = new TalkFile(pcc, i); tlkSet.talkFiles.Add(tlk); } } if (tlkSet.talkFiles.Count != 0) { tlkFileSets.Add(tlkSet); bioTlkSetBox.Items.Add("Misc TlkFiles"); } } }
public void InitBioTlkFileSet() { tlkFileSet = new BioTlkFileSet(pcc as ME1Package); tlkFiles = new TalkFiles(); tlkFile = tlkFileSet; }