|
Post by NicusorN5 on Jul 7, 2015 8:45:06 GMT
How to make the command iFileOpenDialog to return selected file name ?
|
|
|
Post by n_iron on Jul 7, 2015 8:50:19 GMT
Hi I will get back soon
n_iron
|
|
|
Post by n_iron on Jul 7, 2015 9:26:56 GMT
Hi NicursorN5 Welcome back.
I have been working on an editor that can load and save files.
This is the basic script to open the dialogue The iFileOpenDialog() returns a bool true or false. It puts the game on hold until the user selects a file to load. If uses selects Cancel it returns false and by passes the load.
The filename, is the name of the file and default folder example 'c:\temp\data\default.txt'. It will display the filename only in the file input field. filename=filepath; The "txt", displays all the files with that extension in the folder. This is so you can hide other files in the same folder and the user can only load what you want them to load.
The "Load Village Data" is the heading for the open window.
Note all of the load statements or call to load function like in example must be in between the if() {statement} or it will not load.
The filename and filepath variables. filename can be only local but the filepath must be global. This helps remember what file is current and loaded. It also can be used in the Save dialogue so the uses doesn't have to wright it in every time they save the file.
The Save dialogue is virtually the same.
n_iron
|
|
|
Post by NicusorN5 on Jul 7, 2015 12:52:13 GMT
Thanks,it's working!
|
|