コード例 #1
0
ファイル: Progress.cs プロジェクト: coolzoom/MultiTool
        private void ParseFinal()
        {
            try
            {
                string binaryPath = System.Reflection.Assembly.GetEntryAssembly().Location;
                string exeName    = Path.GetFileName(binaryPath);
                binaryPath = Directory.GetCurrentDirectory();

                List <string>[] parse = new List <string> [2];
                parse[0] = new List <string>();
                parse[1] = new List <string>();

                var file_3 = File.ReadAllLines(binaryPath + @"\tempProcess.dat").Select(s => s.Split(' ')).ToArray();

                for (Int32 i = 0; i < file_3.Length; i++)
                {
                    parse[0].Add(file_3[i][0]);
                    parse[1].Add(file_3[i][2]);
                }

                nbLines = parse[0].Count;

                StreamWriter sw = File.AppendText(binaryPath + @"\Model_Root\Root");

                for (Int32 i = 0; i < parse[0].Count; i++)
                {
                    var line              = parse[1].ElementAt(i);
                    var linelength        = line.Length;
                    var lastSlashPosition = line.LastIndexOf('/');
                    var name              = line.Substring(lastSlashPosition + 1, linelength - lastSlashPosition - 1);
                    sw.WriteLine(name + "," + parse[0].ElementAt(i).Substring(0, 10).TrimStart('0'));
                    FileName = name + "," + parse[0].ElementAt(i).Substring(0, 10).TrimStart('0');
                    ProcessedLines++;
                    PaintOnProgress(13, 39, (int)(ProcessedLines * 558f / (float)nbLines), 43, Color.Green);
                    Percentage.Text = (int)(ProcessedLines * 100f / (float)nbLines) + " %";
                    Percentage.Refresh();
                    Info.Text = FileName;
                    Info.Refresh();
                }

                sw.Close();
                sw.Dispose();

                binaryPath = System.Reflection.Assembly.GetEntryAssembly().Location;
                exeName    = Path.GetFileName(binaryPath);
                binaryPath = Directory.GetCurrentDirectory();

                if (File.Exists(binaryPath + @"\tempProcess.dat"))
                {
                    File.Delete(binaryPath + @"\tempProcess.dat");
                }
                this.Visible = false;
                GeosetDecryptor frm = new GeosetDecryptor();
                frm.ShowDialog();
            }
            catch
            {
            }
        }
コード例 #2
0
ファイル: Progress.cs プロジェクト: coolzoom/MultiTool
 private void Progress_Shown(object sender, EventArgs e)
 {
     if (File.Exists(DirectoryPath + @"\Model_Root\Root"))
     {
         FileInfo FI = new FileInfo(DirectoryPath + @"\Model_Root\Root");
         if (FI.Length > 0)
         {
             GeosetDecryptor frm = new GeosetDecryptor();
             frm.ShowDialog();
             this.Close();
         }
         else
         {
             Utils.Show("Empty File, trying to re-parse FileData", "Processing...", 2000);
             if (File.Exists(Path.Combine(DirectoryPath, Resources.PathData)))
             {
                 Utils.Show("Parsing FileData, please wait", "Processing...", 2000);
                 ParseStepOne();
             }
             else
             {
                 MessageBox.Show("The FileData file is missing", "Error");
                 Application.Exit();
             }
         }
     }
     else
     {
         if (File.Exists(Path.Combine(DirectoryPath, Resources.PathData)))
         {
             Utils.Show("Parsing FileData, please wait", "Processing...", 2000);
             ParseStepOne();
         }
         else
         {
             MessageBox.Show("The FileData file is missing", "Error");
             Application.Exit();
         }
     }
 }
コード例 #3
0
ファイル: Start.cs プロジェクト: coolzoom/MultiTool
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.DarkYellow;

            Console.WriteLine("-----------------------------------------------");
            Console.WriteLine("Roccus Multi Converter");
            Console.WriteLine("Created by ©Roccus");
            Console.WriteLine("-----------------------------------------------");
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("Press -M to go to M2 mode");
            Console.ForegroundColor = ConsoleColor.Magenta;
            Console.WriteLine("Press -R to go to SORTING/RETRIEVE menu");
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.WriteLine("Press -I to go to the DB Hotfix Application");
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Press -G to go to the Geoset Decryptor Application");
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine("Press -D to go to the Mask Decryptor Mode");
            Console.ForegroundColor = ConsoleColor.DarkMagenta;
            Console.WriteLine("Press -H to go to the Mask Generator Application");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Press -T to go to the Texture Reading Mode");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Press -E to exit the application");

            ConsoleKey response;

            do
            {
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.Write("Choose your mode : ");
                response = Console.ReadKey(false).Key;
                if (response != ConsoleKey.Enter)
                {
                    Console.WriteLine();
                }
            } while (response != ConsoleKey.M && response != ConsoleKey.R && response != ConsoleKey.I &&
                     response != ConsoleKey.G && response != ConsoleKey.D && response != ConsoleKey.H &&
                     response != ConsoleKey.T && response != ConsoleKey.E);

            if (response == ConsoleKey.M)
            {
                M2Menu();
            }
            else if (response == ConsoleKey.R)
            {
                Sorting_Retrieve_Menu();
            }
            else if (response == ConsoleKey.I)
            {
                frmConnection con = new frmConnection();
                con.ShowDialog();
                Console.Clear();
                Main(new string[0]);
            }
            else if (response == ConsoleKey.G)
            {
                if (File.Exists(System.Reflection.Assembly.GetEntryAssembly().Location.Substring(0, System.Reflection.Assembly.GetEntryAssembly().Location.LastIndexOf("\\")) + @"\Model_Root\Root"))
                {
                    GeosetDecryptor geo = new GeosetDecryptor();
                    geo.ShowDialog();
                    Console.Clear();
                    Main(new string[0]);
                }
                else
                {
                    Progress prg = new Progress();
                    prg.ShowDialog();
                    GeosetDecryptor geo = new GeosetDecryptor();
                    geo.ShowDialog();
                    Console.Clear();
                    Main(new string[0]);
                }
            }
            else if (response == ConsoleKey.D)
            {
                Console.Clear();
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("-----------------------------------------------");
                Console.WriteLine("Roccus Multi Converter");
                Console.WriteLine("Created by ©Roccus");
                Console.WriteLine("-----------------------------------------------");
                Console.WriteLine();
                Console.WriteLine();
                MaskDecryptor.Work();
            }
            else if (response == ConsoleKey.H)
            {
                MaskGenerator mg = new MaskGenerator();
                mg.ShowDialog();
                Console.Clear();
                Main(new string[0]);
            }
            else if (response == ConsoleKey.T)
            {
                Console.Clear();
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("-----------------------------------------------");
                Console.WriteLine("Roccus Multi Converter");
                Console.WriteLine("Created by ©Roccus");
                Console.WriteLine("-----------------------------------------------");
                Console.WriteLine();
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.White;
                M2_Reader();
            }
            else if (response == ConsoleKey.E)
            {
                Console.Clear();
                Environment.Exit(1);
            }

            Console.ReadLine();
        }