#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; }
private void toolStripButton1_Click(object sender, EventArgs e) { int n = bioConversationComboBox.SelectedIndex; if (n == -1) return; Dialog = new ME3BioConversation(Objs[n] as ME3ExportEntry); RefreshTabs(); RefreshVisualizer(); }
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 DlgReply(int idx, float x, float y, ME3BioConversation bc, DialogVis dialogvis) : base(idx, x, y, bc, dialogvis) { }
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.export.Index)) { //loaded dialog is no longer a dialog if (Dialog.export.ClassName != "BioConversation") { startingListBox.Items.Clear(); speakerListBox.Items.Clear(); stageDirectionsListBox.Items.Clear(); maleFaceSetsListBox.Items.Clear(); femaleFaceSetsListBox.Items.Clear(); entryListTreeView.Nodes.Clear(); replyListTreeView.Nodes.Clear(); } else { Dialog = new ME3BioConversation(Dialog.export); RefreshTabs(); } updatedExports.Remove(Dialog.export.Index); } if (updatedExports.Intersect(Objs.Select(x => x.Index)).Count() > 0) { RefreshCombo(); } else { foreach (var i in updatedExports) { if (pcc.getExport(i).ClassName == "BioConversation") { RefreshCombo(); break; } } } }
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 = 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 (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 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 = 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 (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"); }