Ejemplo n.º 1
0
        private void BatchConvertPAKToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CommonOpenFileDialog folderBrowserDialog = new CommonOpenFileDialog();

            folderBrowserDialog.IsFolderPicker   = true;
            folderBrowserDialog.RestoreDirectory = true;
            folderBrowserDialog.Title            = "Open folder for batch PAK processing";
            var result = folderBrowserDialog.ShowDialog();

            if (result == CommonFileDialogResult.Ok)
            {
                int      exportCount = 0;
                string[] workFiles   = Directory.GetFiles(folderBrowserDialog.FileName);
                foreach (string filePath in workFiles)
                {
                    if (filePath.ToLower().EndsWith(".pak"))
                    {
                        PAKFile currentPAK = new PAKFile(filePath);
                        if (currentPAK.IsValid())
                        {
                            currentPAK.Extract();
                        }
                        exportCount++;
                    }
                }
                MessageBox.Show($"Extracted from {exportCount} files.");
            }
        }
Ejemplo n.º 2
0
        private void ConvertPAKToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "ASW packed file (*.pak)|*.pak";
            openFileDialog.RestoreDirectory = true;
            openFileDialog.ShowHelp         = false;
            openFileDialog.Multiselect      = false;
            openFileDialog.Title            = "Open PAK file";
            DialogResult result = openFileDialog.ShowDialog();

            if (result == DialogResult.OK || result == DialogResult.Yes)
            {
                PAKFile currentPAK = new PAKFile(openFileDialog.FileName);
                if (currentPAK.IsValid())
                {
                    currentPAK.Extract();
                }
                MessageBox.Show("Extracted PAK file");
            }
        }