Example #1
0
        private void convertButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(charsetPathTextBox.Text) || String.IsNullOrEmpty(outputDirectoryTextBox.Text))
            {
                return;
            }

            if (!File.Exists(charsetPathTextBox.Text) || !Directory.Exists(outputDirectoryTextBox.Text))
            {
                return;
            }

            FileInfo inputFileInfo = new FileInfo(charsetPathTextBox.Text);

            RPGMaker2000CharsetConverter converter = new RPGMaker2000CharsetConverter();
            List <RPGMakerXPCharset>     charsets  = converter.ToRPGMakerXpCharset(charsetPathTextBox.Text);

            for (int i = 0; i < charsets.Count; i++)
            {
                string outputPath = Path.Combine(outputDirectoryTextBox.Text,
                                                 String.Format("{0}_{1}", Path.GetFileNameWithoutExtension(inputFileInfo.FullName), i));

                charsets[i].Save(outputPath);
            }

            MessageBox.Show("Conversion successful!", "Conversion successful!", MessageBoxButtons.OK,
                            MessageBoxIcon.Information);
        }
Example #2
0
        private static void ProcessCharsetConversion()
        {
            FileInfo inputFileInfo = new FileInfo(_commandLineOptions.InputPaths.First());

            if (!inputFileInfo.Exists)
            {
                Console.WriteLine("Input file does not exists.");
                Environment.Exit(1);
            }

            RPGMaker2000CharsetConverter converter = new RPGMaker2000CharsetConverter();
            List <RPGMakerXPCharset>     charsets  = converter.ToRPGMakerXpCharset(inputFileInfo.FullName);

            for (int i = 0; i < charsets.Count; i++)
            {
                charsets[i].Save(String.Format("{0}_{1}", Path.GetFileNameWithoutExtension(inputFileInfo.FullName), i));
            }
        }