From 1d677927e73e2d66591738777f6a1559527dbab2 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Tue, 31 Jul 2018 16:42:13 -0400 Subject: Added an editbox Added bindings to Irrlicht's EditBox gui element. --- src/client/lua_api/gui/iguiwindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client/lua_api/gui/iguiwindow.cpp') 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"); -- cgit v1.2.3-70-g09d2