Example #1
0
        public static void DumpAll(string inFolder, string outFolder)
        {
            VoiceIndex t = new VoiceIndex()
            {
                Entries = new List <IndexEntry>()
            };

            using (FileStream fileStream1 = new FileStream(Path.Combine(inFolder, "maplist"), FileMode.Open))
            {
                ushort num1     = Util.ReadUShortFrom((Stream)fileStream1, 0);
                byte[] numArray = new byte[32];
                foreach (int num2 in Enumerable.Range(0, (int)num1))
                {
                    fileStream1.Position = (long)(2 + 32 * num2);
                    fileStream1.Read(numArray, 0, 32);
                    string str  = Encoding.ASCII.GetString(numArray).Trim().TrimEnd(new char[1]);
                    string path = Path.Combine(inFolder, str);
                    if (File.Exists(path))
                    {
                        using (FileStream fileStream2 = new FileStream(path, FileMode.Open))
                        {
                            using (FileStream fileStream3 = new FileStream(Path.Combine(outFolder, str + ".xml"), FileMode.Create))
                                Util.Serialise <VoiceList>(Dumper.Dump((Stream)fileStream2, str), (Stream)fileStream3);
                        }
                        t.Entries.Add(new IndexEntry()
                        {
                            File    = str + ".xml",
                            FieldID = num2
                        });
                    }
                    Debug.WriteLine("Processed " + str);
                }
            }
            using (FileStream fileStream = new FileStream(Path.Combine(outFolder, "index.xml"), FileMode.Create))
                Util.Serialise <VoiceIndex>(t, (Stream)fileStream);
        }
Example #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     Dumper.DumpAll("C:\\games\\FF7\\data\\field\\fl", "C:\\games\\ff7\\voicetest");
 }