aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/gui/iguibutton.cpp
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2020-05-18 13:41:40 -0400
committerAlexander <alex@cogarr.net>2020-05-18 13:41:40 -0400
commit355589a9100c7d08fdc4094ad32eb9852c88fcc4 (patch)
tree9e2d2ce6b736539907fc06fc3acc2c23daadafac /src/client/lua_api/gui/iguibutton.cpp
parent377ca5d31a35009913a795c8542659e4872d7c35 (diff)
downloadbrokengine-355589a9100c7d08fdc4094ad32eb9852c88fcc4.tar.gz
brokengine-355589a9100c7d08fdc4094ad32eb9852c88fcc4.tar.bz2
brokengine-355589a9100c7d08fdc4094ad32eb9852c88fcc4.zip
various updates
Diffstat (limited to 'src/client/lua_api/gui/iguibutton.cpp')
-rw-r--r--src/client/lua_api/gui/iguibutton.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/lua_api/gui/iguibutton.cpp b/src/client/lua_api/gui/iguibutton.cpp
index b8ff517..3d4580b 100644
--- a/src/client/lua_api/gui/iguibutton.cpp
+++ b/src/client/lua_api/gui/iguibutton.cpp
@@ -47,13 +47,17 @@ static int newiguibutton(lua_State* L){
//printf("Createing gui button!\n");
int nargs = lua_gettop(L);
+ if(nargs > 3 || nargs < 2){
+ lua_pop(L,nargs);
+ lua_pushstring(L,"Incorrect number of arguments for gui.newbutton(rect,\"text\"[,parent])");
+ lua_error(L);
+ }
IGUIElement* parent = NULL;
if(nargs == 3){
lua_getfield(L,-1,"guielement");
parent = (IGUIElement*)lua_touserdata(L,-1);
lua_pop(L,2);//{{sx,sy},{ex,ey}},"text"
}
-
const char* label_c = lua_tostring(L,-1);//{{sx,sy},{ex,ey}},"text"
size_t label_c_len = strlen(label_c);
wchar_t label_w[label_c_len + 1] = L"";