diff options
| author | Alexander Pickering <alex@cogarr.net> | 2018-07-31 16:42:13 -0400 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2018-07-31 16:42:13 -0400 |
| commit | 1d677927e73e2d66591738777f6a1559527dbab2 (patch) | |
| tree | a4a0190ac748191dd863c19440c82e8d4f5aa427 /src/client/lua_api/gui/iguiwindow.cpp | |
| parent | 11857adbdce423ca93980c884d3dc94a974f735f (diff) | |
| download | brokengine-1d677927e73e2d66591738777f6a1559527dbab2.tar.gz brokengine-1d677927e73e2d66591738777f6a1559527dbab2.tar.bz2 brokengine-1d677927e73e2d66591738777f6a1559527dbab2.zip | |
Added an editbox
Added bindings to Irrlicht's EditBox gui element.
Diffstat (limited to 'src/client/lua_api/gui/iguiwindow.cpp')
| -rw-r--r-- | src/client/lua_api/gui/iguiwindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/lua_api/gui/iguiwindow.cpp b/src/client/lua_api/gui/iguiwindow.cpp index fc85217..e5c3193 100644 --- a/src/client/lua_api/gui/iguiwindow.cpp +++ b/src/client/lua_api/gui/iguiwindow.cpp @@ -24,7 +24,7 @@ using namespace gui; static int newiguiwindow(lua_State* L){ IGUIElement* parent = NULL; int numargs = lua_gettop(L); - + if(numargs == 4){ lua_getfield(L,-1,"guielement");//{{sx,sy},{ex,ey}},"title",{guielement=parent},parent parent = (IGUIElement*)lua_touserdata(L,-1); @@ -34,11 +34,11 @@ static int newiguiwindow(lua_State* L){ const char* title_c = lua_tostring(L,-1); const wchar_t* title_w = irr::core::stringw(title_c).c_str(); lua_pop(L,1);//{{sx,sy},{ex,ey}} - + //Frame position long sx,sy,ex,ey; poprecti(L,&sx,&sy,&ex,&ey);// - + //Create the window IGUIEnvironment* env = guidevice->getGUIEnvironment(); IGUIWindow* wi = env->addWindow( @@ -58,7 +58,7 @@ static int newiguiwindow(lua_State* L){ int ref = luaL_ref(L,LUA_REGISTRYINDEX);// lua_rawgeti(L,LUA_REGISTRYINDEX,ref);//{element=ud_window, __meta=gui.window} - registerguielement(L); + registerguielement(L,EGET_ELEMENT_CLOSED,"onClose"); iguielements[wi] = ref; //registerguicallback(wi,EGET_ELEMENT_CLOSED,iguiwindowevent); @@ -79,7 +79,7 @@ int iguiwindow_register(lua_State* L, IrrlichtDevice* d){ luaL_newmetatable(L,"gui.window");//m{gui.checkbox} luaL_register(L,NULL,iguiwindow_m); lua_pop(L,1);// - + lua_getglobal(L,"gui"); lua_pushcfunction(L,newiguiwindow); lua_setfield(L,-2,"newwindow"); |
