diff options
| author | Alexander <alex@cogarr.net> | 2019-10-27 17:25:16 -0400 |
|---|---|---|
| committer | Alexander <alex@cogarr.net> | 2019-10-27 17:25:16 -0400 |
| commit | 0d2de2ba9c616862d7881f089382db772d034f89 (patch) | |
| tree | 5fc58b63c593e2ac17f3353b50318c299f643390 /src/client/lua_api/gui/iguifiledialog.cpp | |
| parent | c9db55cdc2f69c3dc7aefabe0cc828a64e377024 (diff) | |
| download | brokengine-0d2de2ba9c616862d7881f089382db772d034f89.tar.gz brokengine-0d2de2ba9c616862d7881f089382db772d034f89.tar.bz2 brokengine-0d2de2ba9c616862d7881f089382db772d034f89.zip | |
Various updates
Diffstat (limited to 'src/client/lua_api/gui/iguifiledialog.cpp')
| -rw-r--r-- | src/client/lua_api/gui/iguifiledialog.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/client/lua_api/gui/iguifiledialog.cpp b/src/client/lua_api/gui/iguifiledialog.cpp index 6303230..d717673 100644 --- a/src/client/lua_api/gui/iguifiledialog.cpp +++ b/src/client/lua_api/gui/iguifiledialog.cpp @@ -28,7 +28,11 @@ extern IrrlichtDevice* device; /*** @function newfileopendialog() -Creates a new dialog to open a file +Creates a new dialog to open a file. +The file creation window may have the following fields set for callbacks: + .onDirectorySelect(self) + .onFileSelect(self) + .onCanceled(self) @tparam ?string title The rectangle to place the button at. If the box has a parent, it is offset from the upper-left of the parent element. @tparam ?string path The path to open the file dialog to @@ -66,10 +70,10 @@ static int newfileopendialog(lua_State* L){ mbstowcs(title,titlec,titlecslen); title[titlecslen] = L'\0'; } - + //printf("Got all arguments\n"); IGUIEnvironment *env = device->getGUIEnvironment(); IGUIFileOpenDialog *but = env->addFileOpenDialog(title,modal,parent,-1,false,path); - + //printf("Created file open dialog\n"); //printf("Added file open dialog\n"); lua_newtable(L);//{} lua_pushlightuserdata(L,but);//{},ud_iguibutton @@ -78,13 +82,13 @@ static int newfileopendialog(lua_State* L){ lua_setmetatable(L,-2);//{guielement} //printf("Created lua representation\n"); - setelementcallback(L,EGET_DIRECTORY_SELECTED,"onDirectory");// - setelementcallback(L,EGET_FILE_SELECTED,"onFileSelected"); + setelementcallback(L,EGET_DIRECTORY_SELECTED,"onDirectorySelect");// + setelementcallback(L,EGET_FILE_SELECTED,"onFileSelect"); setelementcallback(L,EGET_FILE_CHOOSE_DIALOG_CANCELLED,"onCanceled"); //printf("Finished registering callback\n"); free(title); - free(path); + //printf("Freed everything\n"); return 1; } |
