ME3Explorer.KFreonTPFTools3.ExtractButton_Click C# (CSharp) Method

ExtractButton_Click() private method

private ExtractButton_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        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!");
        }
KFreonTPFTools3