Exemplo n.º 1
0
 public DlgObj(int idx, float x, float y, BioConversation bc, DialogVis dialogvis)
     : base()
 {
     conv          = bc;
     dv            = dialogvis;
     index         = idx;
     this.Pickable = true;
 }
Exemplo n.º 2
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            int n = toolStripComboBox1.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            Dialog = new BioConversation(pcc, Objs[n]);
            tlkFileSet.loadData(Dialog.TlkFileSet - 1);
            if (!tlkFiles.tlkList.Contains(tlkFileSet.talkFiles[tlkFileSet.selectedTLK]))
            {
                tlkFiles.tlkList.Add(tlkFileSet.talkFiles[tlkFileSet.selectedTLK]);
            }
            RefreshTabs();
        }
Exemplo n.º 3
0
        public DlgStart(int idx, float x, float y, BioConversation 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);
        }
Exemplo n.º 4
0
        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
                {
                    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=====");
                }
            }
        }
Exemplo n.º 5
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");
            }
        }
Exemplo n.º 6
0
 public DlgReply(int idx, float x, float y, BioConversation bc, DialogVis dialogvis)
     : base(idx, x, y, bc, dialogvis)
 {
 }