From d169407dbc6d54ed4eb0bee06c6169b6ea40761d Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 12 Aug 2018 15:03:08 -0400 Subject: Changed files to use the common iguielement registry Files now use the registry defined in iguielement, so they are all in sync. --- src/client/lua_api/gui/iguibutton.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/client/lua_api/gui/iguibutton.cpp') diff --git a/src/client/lua_api/gui/iguibutton.cpp b/src/client/lua_api/gui/iguibutton.cpp index 0e16ef6..5da3773 100644 --- a/src/client/lua_api/gui/iguibutton.cpp +++ b/src/client/lua_api/gui/iguibutton.cpp @@ -17,6 +17,9 @@ extern "C" { #include #include +/*** +@module gui +*/ using namespace irr; using namespace core; using namespace gui; @@ -24,6 +27,15 @@ using namespace gui; extern IrrlichtDevice* device; char lhashkey[20]; +/*** +@function newbutton() +Creates a new checkbox +@tparam dimensions rect 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 parent (iguielement | nil) parent The parent element of the button. +@tparam default_text (string | nil) default_text The default text to have in the button +@treturn iguibutton The button element +*/ //gui.newbutton({{sx,sy},{ex,ey}},"text"[,parent]) static int newiguibutton(lua_State* L){ printf("Createing gui button!\n"); @@ -68,9 +80,6 @@ static const luaL_reg iguibutton_f[] = { }; static const luaL_reg iguibutton_m[] = { - {"move", moveiguielement}, - {"settext", setiguitext}, - {"remove", removeiguielement}, {0,0}, }; @@ -79,6 +88,7 @@ void iguibutton_register(lua_State* L){ luaL_newmetatable(L, "gui.iguibutton");//{m_iguibutton} lua_newtable(L);//{m_iguibutton},{} + luaL_register(L,NULL,iguielement_m); luaL_register(L,NULL,iguibutton_m);//{m_iguibutton},{} lua_setfield(L,-2,"__index");//{m_iguibutton} -- cgit v1.2.3-70-g09d2