#pragma warning disable RECS0154 // Parameter is never used protected DlgObj(int idx, float x, float y, ME3BioConversation bc, DialogVis dialogvis) #pragma warning restore RECS0154 // Parameter is never used : base() { conv = bc; dv = dialogvis; index = idx; this.Pickable = true; }
public DlgStart(int idx, float x, float y, ME3BioConversation bc, DialogVis dialogvis) : base(idx, x, y, bc, dialogvis) { outlinePen = new Pen(Color.Black); GetOutputLinks(); SText title = new SText("Start: " + index, titleBrush); title.TextAlignment = StringAlignment.Center; title.X = 5; title.Y = 3; title.Pickable = false; box = PPath.CreateRectangle(0, 0, title.Width + 10, title.Height + 5); box.Pen = outlinePen; box.Brush = nodeBrush; box.AddChild(title); this.AddChild(box); this.TranslateBy(x, y); }
public void ScanBasefolder() { string dir = ME3Directory.cookedPath; string[] files = Directory.GetFiles(dir, "*.pcc"); pbar1.Maximum = files.Length - 1; int count = 0; foreach (string file in files) { DebugOutput.PrintLn("Scan file #" + count + " : " + file, count % 10 == 0); try { using (ME3Package pcc = MEPackageHandler.OpenME3Package(file)) { IReadOnlyList <IExportEntry> Exports = pcc.Exports; for (int i = 0; i < Exports.Count; i++) { if (Exports[i].ClassName == "BioConversation") { DebugOutput.PrintLn("Found dialog \"" + Exports[i].ObjectName + "\"", false); ME3BioConversation Dialog = new ME3BioConversation(Exports[i] as ME3ExportEntry); foreach (ME3BioConversation.EntryListStuct e in Dialog.EntryList) { string text = ME3TalkFiles.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 = Exports[i].ObjectName; if (e.SpeakerIndex >= 0 && e.SpeakerIndex < Dialog.SpeakerList.Count) { t.speaker = Dialog.SpeakerList[e.SpeakerIndex].InstancedString; } 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 (ME3BioConversation.ReplyListStruct e in Dialog.ReplyList) { string text = ME3TalkFiles.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 = 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====="); } } }
public DlgReply(int idx, float x, float y, ME3BioConversation bc, DialogVis dialogvis) : base(idx, x, y, bc, dialogvis) { }
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()); using (ME3Package pcc = MEPackageHandler.OpenME3Package("temp.pcc")) { IReadOnlyList <IExportEntry> Exports = pcc.Exports; for (int i = 0; i < Exports.Count; i++) { if (Exports[i].ClassName == "BioConversation") { DebugOutput.PrintLn("Found dialog \"" + Exports[i].ObjectName + "\"", false); ME3BioConversation Dialog = new ME3BioConversation(Exports[i] as ME3ExportEntry); foreach (ME3BioConversation.EntryListStuct e in Dialog.EntryList) { string text = ME3TalkFiles.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 = Exports[i].ObjectName; if (e.SpeakerIndex >= 0 && e.SpeakerIndex < Dialog.SpeakerList.Count) { t.speaker = Dialog.SpeakerList[e.SpeakerIndex].InstancedString; } 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 (ME3BioConversation.ReplyListStruct e in Dialog.ReplyList) { string text = ME3TalkFiles.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 = 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"); } }