Game Development Community

Whats getLoadFileName() do?

by Sean H. · in Torque Game Engine · 02/03/2006 (9:55 am) · 3 replies

Whats getLoadFileName() do? I ran across this function last night and I can't find it any of my engine references. could someone explain to me what the function returns and how to use it. Thanks!

#1
02/03/2006 (10:59 am)
Where did you see it I think it would probably be tied to openfileforwrite or openfileforread
#2
02/03/2006 (11:43 am)
It's in .../common/ui/LoadFileDlg.gui

looks like it opens a file list dialog and then calls the supplied callback when a file is selected.

//------------------------------------------------------------------------------
// ex: getLoadFilename("stuff\*.*", loadStuff);
//     -- calls 'loadStuff(%filename)' on dblclick or ok
//------------------------------------------------------------------------------
function getLoadFilename(%filespec, %callback)
{  
   $loadFileCommand = "if(loadFileList.getSelectedId() >= 0)" @ %callback @ "(loadFileList.getValue());";
   Canvas.pushDialog(LoadFileDlg, 99);
   fillFileList(%filespec, loadFileList);
}
#3
02/03/2006 (11:50 am)
Thanks treb and orion!