コード例 #1
0
ファイル: TlkManager.cs プロジェクト: ME3Explorer/ME3Explorer
        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); 
            }
        }
コード例 #2
0
ファイル: TlkManager.cs プロジェクト: ME3Explorer/ME3Explorer
 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");
         }
     }
 }
コード例 #3
0
 public void InitBioTlkFileSet()
 {
     tlkFileSet = new BioTlkFileSet(pcc as ME1Package);
     tlkFiles = new TalkFiles();
     tlkFile = tlkFileSet;
 }