Code: Select all
private void OnClickExportAllToVD(object sender, EventArgs e)
{
if (FileType != 0)
{
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
dialog.Description = "Select directory";
dialog.ShowNewFolderButton = true;
if (dialog.ShowDialog() == DialogResult.OK)
{
for (int i = 0; i < treeView1.Nodes.Count; ++i)
{
int index = (int)treeView1.Nodes[i].Tag;
if (index >= 0 && treeView1.Nodes[i].Parent == null && treeView1.Nodes[i].ForeColor != Color.Red)
{
string FileName = Path.Combine(dialog.SelectedPath, String.Format("anim{0}_0x{1:X}.vd", FileType, index));
Ultima.AnimationEdit.ExportToVD(FileType, index, FileName);
}
}
MessageBox.Show(String.Format("All Animations saved to {0}", dialog.SelectedPath.ToString()),
"Export", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
}
}
}
}
It works well but it can be better... i'm working on it.
There is a problem with the memory management, maybe it's in the ultima sdk: when it saves the anim from a file it seems to not free the memory after closing each file, or when it ends.
So, if I try to export anims from another file the memory usage grows, and again with another file until it freeze and I must kill from Program Manager. I managed to export only from to files at time without seeing uofiddler freezing.