aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/load_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/lua_api/load_gui.cpp')
-rw-r--r--src/client/lua_api/load_gui.cpp47
1 files changed, 25 insertions, 22 deletions
diff --git a/src/client/lua_api/load_gui.cpp b/src/client/lua_api/load_gui.cpp
index c90c8f5..598f842 100644
--- a/src/client/lua_api/load_gui.cpp
+++ b/src/client/lua_api/load_gui.cpp
@@ -27,38 +27,41 @@ extern IrrlichtDevice* device;
//Things from guiparts.hpp
std::map<irr::gui::IGUIElement*,int> iguielements;
IrrlichtDevice* guidevice;
-long gui_elenum;
-std::vector<irr::gui::IGUIElement*> guielements(1);
+//long gui_elenum;
+//std::vector<irr::gui::IGUIElement*> guielements(1);
lua_State* tL;
int screenwidth(lua_State* L);
int screenheight(lua_State* L);
void load_guifuncs(lua_State* L){
- tL = L;
- guidevice = device;
- gui_elenum = 0;
- guielements[0] = NULL;
+ printf("Started loading gui...\n");
+ tL = L;
+ guidevice = device;
+ //gui_elenum = 0;
+ //guielements[0] = NULL;
- iguilabel_register(L,device);
- lua_pop(L, 1);
-
- //Various enums
- register_skin(L);
+ //Various enums
+ register_skin(L);
- lua_newtable(L);
- lua_setglobal(L,"gui");
- iguicheckbox_register(L);
- iguiwindow_register(L,device);
- iguiimage_register(L);
- iguibutton_register(L);
-
- lua_pushcfunction(L,screenwidth);
- lua_setglobal(L,"scrw");
+ lua_newtable(L);
+ lua_setglobal(L,"gui");
+ //printf("Registering label...\n");
+ iguilabel_register(L);
+ //printf("Registering checkbox...\n");
+ iguicheckbox_register(L);
+ //printf("Registering window...\n");
+ iguiwindow_register(L,device);
+ //printf("Registering guiimage\n");
+ iguiimage_register(L);
+ //printf("Registering button\n");
+ iguibutton_register(L);
- lua_pushcfunction(L,screenheight);
- lua_setglobal(L,"scrh");
+ lua_pushcfunction(L,screenwidth);
+ lua_setglobal(L,"scrw");
+ lua_pushcfunction(L,screenheight);
+ lua_setglobal(L,"scrh");
}