Skip to content

Commit

Permalink
enabled multiple file selection in openfiledialog
Browse files Browse the repository at this point in the history
enabled multiple file selection in openfiledialog
  • Loading branch information
DCxDemo committed Jun 12, 2021
1 parent 5e4282e commit 0bb4b0c
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions KAT2WAV/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace KAT2WAV
{
public partial class MainForm : Form
{
Kat kat;

public MainForm()
{
InitializeComponent();
Expand All @@ -19,30 +21,32 @@ private void convertButton_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.Filter = "Treyarch THPS Soundbank (*.kat, *.xsb)|*.kat;*.xsb";
op.Multiselect = true;

if (op.ShowDialog() == DialogResult.OK)
{
try
foreach (string file in op.FileNames)
{
string bankname = Path.GetFileNameWithoutExtension(op.FileName);
string wavdir = Path.GetDirectoryName(op.FileName) + "\\" + bankname;
string katext = Path.GetExtension(op.FileName);
try
{
string bankname = Path.GetFileNameWithoutExtension(file);
string wavdir = Path.GetDirectoryName(file) + "\\" + bankname;
string katext = Path.GetExtension(file);

kat = Kat.FromFile(op.FileName);
kat.Extract(wavdir);
}
catch
{
MessageBox.Show("Can't open " + op.FileName);
return;
kat = Kat.FromFile(file);
kat.Extract(wavdir);
}
catch
{
MessageBox.Show("Can't open " + file);
return;
}
}

MessageBox.Show("Done.");
}
}

Kat kat;

private void ExtractWavs(string filename)
{

Expand Down

0 comments on commit 0bb4b0c

Please sign in to comment.