Game Development Community

About DirectoryFileList and DirectoryList

by Kiyaku · in Torque Game Engine Advanced · 04/14/2008 (6:51 am) · 4 replies

Hi,
i have 2 questions belonging to both GUI objects.

1) I heard the DirectoryList got replaced by something else in 1.7. If using now, it causes the engine to crash so what can i use to list folders?

2) How can i change the path of the DirectoryFileList object? I tried it with "setPath" but it seems not to change anything in the listed files (also a clear() before it doesnt help).


Thanks in advance!

#1
06/04/2008 (6:13 am)
Oh dang... just stumbled across this. Sorry you never got an answer.

Don't know if you still have use for this information but anyway:

1) That stuff got replaced by native dialogs. In the case of DirectoryList, that's OpenFolderDialog. Example.

$foo = new OpenFolderDialog();

//set some properties, like e.g.
$foo.title = "Select some random folder...";

$foo.execute();

Unfortunately, the directory selection is at the moment implemented in such a way that it will *not* show the native directory selection dialog but rather use the normal file selection dialog instead.

2) setPath is the correct method. Are you sure you are invoking it correctly? I tried it and it worked fine using something like this

2122.setPath( "scriptsAndAssets" );
#2
06/04/2008 (6:41 am)
Rene, will setPath point to a directory outside the game folder in this new version?
#3
06/05/2008 (5:07 am)
Theoretically, the control can use any desired path since it is accessing the platform layer directly. Unfortunately, because of what's basically a bug in the code it is not possible to use absolute paths on Windows (will fix that immediately). You can, however, use relative paths that point outside the game folder, though that's only of limited use.
#4
06/05/2008 (7:09 am)
Ah, OK. I'm just looking for a solution to allow the user to select files from anywhere on their system for certain user customization options. I can do it within the game folder of course but that's a little unfriendly.