示例#1
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     int n = toolStripComboBox1.SelectedIndex;
     if (n == -1)
         return;
     Dialog = new BioConversation(pcc, Objs[n]);
     RefreshTabs();
 }
示例#2
0
 public void ScanDLCfolder2()
 {
     DebugOutput.PrintLn("\n\nDLC Scan for packed files...\n", true);
     string dir = ME3Directory.DLCPath;
     string[] files = Directory.GetFiles(dir, "*.sfar", SearchOption.AllDirectories);
     if (files.Length == 0)
         return;
     pbar1.Maximum = files.Length - 1;
     int count = 0;
     foreach (string file in files)
         if (!file.ToLower().Contains("patch"))
         {
             DebugOutput.PrintLn("Scan file #" + count + " : " + file, count % 10 == 0);
             try
             {
                 DLCPackage dlc = new DLCPackage(file);
                 DebugOutput.PrintLn("found " + dlc.Files.Length + " files : " + file);
                 for (int j = 0; j < dlc.Files.Length; j++)
                 {
                     if (dlc.Files[j].FileName.ToLower().EndsWith(".pcc"))
                     {
                         string filename = dlc.Files[j].FileName;
                         DebugOutput.PrintLn(" " + j.ToString("d4") + " / " + dlc.Files.Length.ToString("d4") + " : opening " + Path.GetFileName(filename),true);
                         MemoryStream mem = dlc.DecompressEntry(j);
                         File.WriteAllBytes("temp.pcc", mem.ToArray());
                         PCCObject pcc = new PCCObject("temp.pcc");
                         for (int i = 0; i < pcc.Exports.Count; i++)
                             if (pcc.Exports[i].ClassName == "BioConversation")
                             {
                                 DebugOutput.PrintLn("Found dialog \"" + pcc.Exports[i].ObjectName + "\"", false);
                                 BioConversation Dialog = new BioConversation(pcc, i);
                                 foreach (BioConversation.EntryListStuct e in Dialog.EntryList)
                                 {
                                     string text = talkFile.findDataById(e.refText);
                                     if (text.Length != 7 && text != "No Data")
                                     {
                                         EntryStruct t = new EntryStruct();
                                         t.inDLC = true;
                                         t.text = text;
                                         t.ID = e.refText;
                                         t.indexpcc = i;
                                         t.pathafc = "";//Todo
                                         t.pathdlc = file;
                                         t.pathpcc = filename;
                                         t.convname = pcc.Exports[i].ObjectName;
                                         if (e.SpeakerIndex >= 0 && e.SpeakerIndex < Dialog.SpeakerList.Count)
                                             t.speaker = pcc.getNameEntry(Dialog.SpeakerList[e.SpeakerIndex]);
                                         else
                                             t.speaker = "unknown";
                                         if (t.speaker == null || t.speaker == "")
                                             t.speaker = "unknown";
                                         Entries.Add(t);
                                         DebugOutput.PrintLn("Requ.: (" + t.speaker + ") " + t.text, false);
                                     }
                                 }
                                 foreach (BioConversation.ReplyListStruct e in Dialog.ReplyList)
                                 {
                                     string text = talkFile.findDataById(e.refText);
                                     if (text.Length != 7 && text != "No Data")
                                     {
                                         EntryStruct t = new EntryStruct();
                                         t.inDLC = true;
                                         t.text = text;
                                         t.ID = e.refText;
                                         t.indexpcc = i;
                                         t.pathafc = "";//Todo
                                         t.pathdlc = file;
                                         t.pathpcc = filename;
                                         t.convname = pcc.Exports[i].ObjectName;
                                         Entries.Add(t);
                                         DebugOutput.PrintLn("Reply: " + t.text, false);
                                     }
                                 }
                             }
                     }
                 }
                 if (count % 10 == 0)
                 {
                     Application.DoEvents();
                     pbar1.Value = count;
                 }
                 count++;
             }
             catch (Exception ex)
             {
                 DebugOutput.PrintLn("=====ERROR=====\n" + ex.ToString() + "\n=====ERROR=====");
             }
         }
     if (File.Exists("temp.pcc"))
         File.Delete("temp.pcc");
 }
示例#3
0
 public void ScanDLCfolder1()
 {
     DebugOutput.PrintLn("\n\nDLC Scan for unpacked files...\n", true);
     string dir = ME3Directory.DLCPath;
     string[] files = Directory.GetFiles(dir, "*.pcc", SearchOption.AllDirectories);
     if (files.Length == 0)
         return;
     pbar1.Maximum = files.Length - 1;
     int count = 0;
     foreach (string file in files)
         if (!file.ToLower().Contains("patch"))
         {
             DebugOutput.PrintLn("Scan file #" + count + " : " + file, count % 10 == 0);
             try
             {
                 PCCObject pcc = new PCCObject(file);
                 for (int i = 0; i < pcc.Exports.Count; i++)
                     if (pcc.Exports[i].ClassName == "BioConversation")
                     {
                         DebugOutput.PrintLn("Found dialog \"" + pcc.Exports[i].ObjectName + "\"", false);
                         BioConversation Dialog = new BioConversation(pcc, i);
                         foreach (BioConversation.EntryListStuct e in Dialog.EntryList)
                         {
                             string text = talkFile.findDataById(e.refText);
                             if (text.Length != 7 && text != "No Data")
                             {
                                 EntryStruct t = new EntryStruct();
                                 t.inDLC = false;
                                 t.text = text;
                                 t.ID = e.refText;
                                 t.indexpcc = i;
                                 t.pathafc = "";//Todo
                                 t.pathdlc = "";
                                 t.pathpcc = file;
                                 t.convname = pcc.Exports[i].ObjectName;
                                 if (e.SpeakerIndex >= 0 && e.SpeakerIndex < Dialog.SpeakerList.Count)
                                     t.speaker = pcc.getNameEntry(Dialog.SpeakerList[e.SpeakerIndex]);
                                 else
                                     t.speaker = "unknown";
                                 if (t.speaker == null || t.speaker == "")
                                     t.speaker = "unknown";
                                 Entries.Add(t);
                                 DebugOutput.PrintLn("Requ.: (" + t.speaker + ") " + t.text, false);
                             }
                         }
                         foreach (BioConversation.ReplyListStruct e in Dialog.ReplyList)
                         {
                             string text = talkFile.findDataById(e.refText);
                             if (text.Length != 7 && text != "No Data")
                             {
                                 EntryStruct t = new EntryStruct();
                                 t.inDLC = false;
                                 t.text = text;
                                 t.ID = e.refText;
                                 t.indexpcc = i;
                                 t.pathafc = "";//Todo
                                 t.pathdlc = "";
                                 t.pathpcc = file;
                                 t.convname = pcc.Exports[i].ObjectName;
                                 Entries.Add(t);
                                 DebugOutput.PrintLn("Reply: " + t.text, false);
                             }
                         }
                     }
                 if (count % 10 == 0)
                 {
                     Application.DoEvents();
                     pbar1.Value = count;
                 }
                 count++;
             }
             catch (Exception ex)
             {
                 DebugOutput.PrintLn("=====ERROR=====\n" + ex.ToString() + "\n=====ERROR=====");
             }
         }
 }