Added support for large lists of shape formats. Needed for assimp.

This commit is contained in:
Andrew Mac 2014-05-21 14:50:44 -03:00
parent 938e28b6f3
commit eb74525a38
10 changed files with 154 additions and 20 deletions

View file

@ -42,3 +42,29 @@ function getLoadFilename(%filespec, %callback, %currentFile)
%dlg.delete();
}
// Opens a choose file dialog with format filters already loaded
// in. This avoids the issue of passing a massive list of format
// filters into a function as an arguement.
function getLoadFormatFilename(%callback, %currentFile)
{
%dlg = new OpenFileDialog()
{
Filters = getFormatFilters() @ "(All Files (*.*)|*.*|";
DefaultFile = %currentFile;
ChangePath = false;
MustExist = true;
MultipleFiles = false;
};
if ( filePath( %currentFile ) !$= "" )
%dlg.DefaultPath = filePath(%currentFile);
if ( %dlg.Execute() )
{
eval(%callback @ "(\"" @ %dlg.FileName @ "\");");
$Tools::FileDialogs::LastFilePath = filePath( %dlg.FileName );
}
%dlg.delete();
}