EHDSeven

paa2tga

Aug 5th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.72 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Diagnostics;
  6. using System.IO;
  7.  
  8. namespace paatotga
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string arguments = "";
  15.             if (args.Count() != 0)
  16.             {
  17.                 var pal2pace = new ProcessStartInfo();
  18.                 foreach (string file in args)
  19.                 {
  20.                     string filename = "";
  21.                     string ext = Path.GetExtension(file);
  22.                     if (ext == ".paa" || ext == ".pac")
  23.                     {
  24.                         filename = Path.GetFileNameWithoutExtension(file);
  25.                         arguments = file + " " + filename + ".tga";
  26.                         Console.WriteLine("Converting " + filename + " to " + filename + ".tga");
  27.                         pal2pace.FileName = "pal2pace.exe";
  28.                         pal2pace.Arguments = arguments;
  29.                         pal2pace.CreateNoWindow = true;
  30.                         pal2pace.UseShellExecute = false;
  31.                         Process.Start(pal2pace);
  32.                     }
  33.                     else
  34.                     {
  35.                         Console.WriteLine("Skipping: " + file);
  36.                     }
  37.                 }
  38.                 Console.WriteLine("Finished converting files to .tga");
  39.                 Console.WriteLine("Press any key to continue...");
  40.                 Console.ReadKey(true);
  41.             }
  42.             else
  43.             {
  44.                 Console.WriteLine("No List Given!");
  45.                 Console.WriteLine("Press any key to continue...");
  46.                 Console.ReadKey(true);
  47.             }
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment