public override void Execute()
        {
            string modName = GetModName(Program.Configuration.ModsPath);

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine($" Extracting mod: {modName}...");
            Console.ForegroundColor = ConsoleColor.DarkGray;

            DirectoryInfo directory = Directory.CreateDirectory(Path.Combine(Program.Configuration.ExtractPath, modName));
            TModFile      modFile;

            using (FileStream stream = File.Open(Path.Combine(Program.Configuration.ModsPath, modName), FileMode.Open))
                using (BinaryReader reader = new(stream))
                {
                    modFile = new TModFile(reader);
                }

            Stopwatch sw = Stopwatch.StartNew();

            ExtractAllFiles(modFile.files, directory);
            sw.Stop();

            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine($" Finished extracting mod: {modName}");
            Console.WriteLine($" Extraction time: {sw.Elapsed}");

            Program.Instance.WriteOptionsList(new ConsoleOptions("Return:"));
        }
Beispiel #2
0
        public void ExecuteRequest()
        {
            using (FileStream stream = FileIO.Open(FilePath, FileMode.Open))
                using (BinaryReader reader = new(stream))
                {
                    File = new TModFile(reader);
                }

            ExtractAllFiles(File.files, ExtractDirectory);
        }