예제 #1
0
        private void Test()
        {
            string dir = @"";
            var    enc = new PersonaEditorLib.PersonaEncoding(@"");

            string[] files = Directory.GetFiles(dir, "*.*", SearchOption.AllDirectories);
            foreach (var file in files)
            {
                if (new FileInfo(file).Length > 100000000)
                {
                    continue;
                }

                var temp = PersonaEditorLib.GameFormatHelper.OpenFile(Path.GetFileName(file), File.ReadAllBytes(file));

                if (temp != null)
                {
                    foreach (var a in temp.GetAllObjectFiles(PersonaEditorLib.FormatEnum.BMD))
                    {
                        var bmd = a.GameData as BMD;
                        var ptp = new PTP(bmd);

                        string newPath = Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(a.Name.Replace('/', '+')) + ".txt");
                        File.WriteAllLines(newPath, ptp.ExportTXT(true, enc));
                    }
                }
            }
        }
예제 #2
0
        static void Test(string[] args)
        {
            string testPath = @"d:\Persona 5\DATA_PS3_JAP\";
            var    par      = new Parameters(new string[][] { new string[] { "/sub" } });
            var    files    = Directory.EnumerateFiles(testPath, "*.*", SearchOption.AllDirectories).ToArray();
            int    index    = 0;

            foreach (var filePath in files)
            {
                Console.Write($"{index++}/{files.Length}\r");

                var OpenedFileDir = Path.GetDirectoryName(filePath);
                if (new FileInfo(filePath).Length > 10000000)
                {
                    continue;
                }
                GameFile file = GameFormatHelper.OpenFile(Path.GetFileName(filePath), File.ReadAllBytes(filePath));
                if (file != null)
                {
                    SubFileAction((a, b, c, d) =>
                    {
                        try
                        {
                            if (a.GameData is BMD bmd)
                            {
                                PTP ptp     = new PTP(bmd);
                                var newName = a.Name.Replace('/', '+');
                                string path = Path.Combine(c, Path.GetFileNameWithoutExtension(newName) + ".TXT");

                                var exp = ptp.ExportTXT(true, Static.OldEncoding());
                                File.WriteAllLines(path, exp);
                            }
                        }
                        catch { }
                    }, file, "", OpenedFileDir, par);
                }
            }
        }