Пример #1
0
        private void linesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            animationListBox.ItemsSource = null;
            lineText.Text = null;

            if (e.AddedItems.Count != 1)
            {
                return;
            }
            selectedLine = (ME3FaceFXLine)e.AddedItems[0];
            updateAnimListBox();
            if (int.TryParse(selectedLine.ID, out int tlkID))
            {
                if (pcc.Game == MEGame.ME3)
                {
                    lineText.Text = ME3TalkFiles.findDataById(tlkID);
                }
                else
                {
                    lineText.Text = ME2Explorer.ME2TalkFiles.findDataById(tlkID);
                }
            }
            treeView.Nodes.Clear();
            System.Windows.Forms.TreeNode[] treeNodes = FaceFX.DataToTree2(selectedLine);
            treeView.Nodes.AddRange(treeNodes);
        }
Пример #2
0
            public TreeNode ToTree(int MyIndex, ME3Package pcc)
            {
                string s = "";

                if (Text.Length != 0)
                {
                    s = Text.Substring(0, Text.Length - 1);
                }
                TreeNode res = new TreeNode(MyIndex + " : " + s + "  " + ME3TalkFiles.findDataById(refText));
                TreeNode t   = new TreeNode("Reply List");

                for (int i = 0; i < ReplyList.Count; i++)
                {
                    EntryListReplyListStruct e = ReplyList[i];
                    string par = e.Paraphrase;
                    if (par.Length != 0 && par[par.Length - 1] == '\0')
                    {
                        par = par.Substring(0, par.Length - 1);
                    }
                    t.Nodes.Add(i + " : "
                                + par
                                + " "
                                + e.refParaphrase
                                + " "
                                + ME3TalkFiles.findDataById(e.refParaphrase)
                                + " "
                                + e.Index
                                + " "
                                + pcc.getNameEntry(e.CategoryValue));
                }
                res.Nodes.Add(t);
                TreeNode t2 = new TreeNode("Speaker List");

                for (int i = 0; i < SpeakerList.Count; i++)
                {
                    t2.Nodes.Add(i + " : " + SpeakerList[i]);
                }
                res.Nodes.Add(t2);
                res.Nodes.Add("SpeakerIndex : " + SpeakerIndex);
                res.Nodes.Add("ListenerIndex : " + ListenerIndex);
                res.Nodes.Add("ConditionalFunc : " + ConditionalFunc);
                res.Nodes.Add("ConditionalParam : " + ConditionalParam);
                res.Nodes.Add("StateTransition : " + StateTransition);
                res.Nodes.Add("StateTransitionParam : " + StateTransitionParam);
                res.Nodes.Add("ExportID : " + ExportID);
                res.Nodes.Add("ScriptIndex : " + ScriptIndex);
                res.Nodes.Add("CameraIntimacy : " + CameraIntimacy);
                res.Nodes.Add("Skippable : " + Skippable);
                res.Nodes.Add("FireConditional : " + FireConditional);
                res.Nodes.Add("Ambient : " + Ambient);
                res.Nodes.Add("NonTextline : " + NonTextline);
                res.Nodes.Add("IgnoreBodyGestures : " + IgnoreBodyGestures);
                res.Nodes.Add("AlwaysHideSubtitle : " + AlwaysHideSubtitle);
                res.Nodes.Add("Text : " + Text);
                res.Nodes.Add("refText : " + refText + " " + ME3TalkFiles.findDataById(refText, true));
                res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue));
                return(res);
            }
Пример #3
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values[0] is int strRef && values[1] is IMEPackage pcc)
            {
                switch (pcc.Game)
                {
                case MEGame.ME1:
                    return("ME1 StrRef not supported");

                case MEGame.ME2:
                    return($"\"{ME2TalkFiles.findDataById(strRef)}\"");

                case MEGame.ME3:
                    return($"\"{ME3TalkFiles.findDataById(strRef)}\"");

                case MEGame.UDK:
                    return("UDK StrRef not supported");
                }
            }
            return("No Data");
        }
Пример #4
0
 private static void loadME3Tlk()
 {
     if (File.Exists(LoadedTLKsPathME3))
     {
         List <string> files = JsonConvert.DeserializeObject <List <string> >(File.ReadAllText(LoadedTLKsPathME3));
         foreach (string filePath in files)
         {
             try
             {
                 ME3TalkFiles.LoadTlkData(filePath);
             }
             catch
             {
             }
         }
     }
     else
     {
         string tlkPath = ME3Directory.CookedPCPath + "BIOGame_INT.tlk";
         ME3TalkFiles.LoadTlkData(tlkPath);
     }
 }
Пример #5
0
            public TreeNode ToTree(int MyIndex, ME3Package pcc)
            {
                string s = "";

                if (Text.Length != 0)
                {
                    s = Text.Substring(0, Text.Length - 1);
                }
                TreeNode res = new TreeNode(MyIndex + " : " + s + "  " + ME3TalkFiles.findDataById(refText));
                TreeNode t   = new TreeNode("Entry List");

                for (int i = 0; i < EntryList.Count; i++)
                {
                    t.Nodes.Add(i + " : " + EntryList[i]);
                }
                res.Nodes.Add(t);
                res.Nodes.Add("Listener Index : " + ListenerIndex);
                res.Nodes.Add("Unskippable : " + Unskippable);
                res.Nodes.Add("IsDefaultAction : " + IsDefaultAction);
                res.Nodes.Add("IsMajorDecision : " + IsMajorDecision);
                res.Nodes.Add("ReplyType : (" + pcc.getNameEntry(ReplyTypeType) + ") " + pcc.getNameEntry(ReplyTypeValue));
                res.Nodes.Add("Text : " + Text);
                res.Nodes.Add("refText : " + refText + " " + ME3TalkFiles.findDataById(refText, true));
                res.Nodes.Add("ConditionalFunc : " + ConditionalFunc);
                res.Nodes.Add("ConditionalParam : " + ConditionalParam);
                res.Nodes.Add("StateTransition : " + StateTransition);
                res.Nodes.Add("StateTransitionParam : " + StateTransitionParam);
                res.Nodes.Add("ExportID : " + ExportID);
                res.Nodes.Add("ScriptIndex : " + ScriptIndex);
                res.Nodes.Add("CameraIntimacy : " + CameraIntimacy);
                res.Nodes.Add("FireConditional : " + FireConditional);
                res.Nodes.Add("Ambient : " + Ambient);
                res.Nodes.Add("NonTextline : " + NonTextLine);
                res.Nodes.Add("IgnoreBodyGestures : " + IgnoreBodyGestures);
                res.Nodes.Add("AlwaysHideSubtitle : " + AlwaysHideSubtitle);
                res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue));
                return(res);
            }
Пример #6
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
                {
                    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=====");
                }
            }
        }
Пример #7
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());
                                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");
            }
        }