aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/gui/iguifiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/lua_api/gui/iguifiledialog.cpp')
-rw-r--r--src/client/lua_api/gui/iguifiledialog.cpp16
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;
}