Beispiel #1
0
        static void Main(string[] args)
        {
            if (args == null || args.Length < 2)
            {
                return;
            }

            // Loads texture
            //XPR2 xp = XPR2.FromFile(args[0]);
            //return;

            // Loads song resources
            SongManager sm = new SongManager(args[0]);

            // Loads single rif file
            RiffFile rif = sm.LoadRiffFile(args[1]);

            if (args.Length < 3)
            {
                return;
            }

            // Exports strings to file
            StringKey.ExportToFile(args[2]);
        }
Beispiel #2
0
        private void exportStringsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // This exports all strings from all rif files found
            fbd.Description = "Open Folder";
            if (!(fbd.ShowDialog() == DialogResult.OK))
            {
                return;
            }

            sfd.Title            = "Save";
            sfd.Filter           = "Text|*.txt";
            sfd.InitialDirectory = fbd.SelectedPath;

            if (!(sfd.ShowDialog() == DialogResult.OK))
            {
                return;
            }

            string[] files = Directory.GetFiles(fbd.SelectedPath, "*.rif", SearchOption.AllDirectories);

            foreach (string file in files)
            {
                RiffFile rif = new RiffFile();

                try
                {
                    // Loads strings from file
                    rif.Import(file);
                }
                catch
                {
                }
            }

            // Exports all strings
            StringKey.ExportToFile(sfd.FileName);
            MessageBox.Show("Exported strings successfully!");
        }