mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
Added support for large lists of shape formats. Needed for assimp.
This commit is contained in:
parent
938e28b6f3
commit
eb74525a38
10 changed files with 154 additions and 20 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue