private void ExtractButton_Click(object sender, EventArgs e)
{
List<TPFTexInfo> temps = GetCheckedTexes();
if (temps.Count == 0)
return;
if (temps.Count == 1)
{
TPFTexInfo tex = temps[0];
string outputPath = "";
using (SaveFileDialog sfd = new SaveFileDialog())
{
sfd.Title = "Where to extract to?";
sfd.Filter = "DirectX Images|*.dds";
string hash = KFreonLib.Textures.Methods.FormatTexmodHashAsString(tex.Hash);
sfd.FileName = tex.TexName + "_" + hash + ".dds";
if (tex.TexName == null)
sfd.FileName = tex.FileName.Contains(hash) ? tex.FileName : Path.GetFileNameWithoutExtension(tex.FileName) + "_" + hash + Path.GetExtension(tex.FileName);
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
outputPath = sfd.FileName;
else
return;
}
Extractor(outputPath, tex, null);
}
else
{
var dialog = new CommonOpenFileDialog();
dialog.IsFolderPicker = true;
dialog.EnsurePathExists = true;
if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
Extractor(dialog.FileName, null, t => temps.Contains(t));
}
Overall.UpdateText("Extraction complete!");
}