CLuaInstance: Add parameter 'vertical' to CLuaSignalBox

This commit is contained in:
M. Liebmann
2014-01-21 17:20:40 +01:00
parent 9a346f8d25
commit 1f7e8b41d7

View File

@@ -1400,14 +1400,16 @@ int CLuaInstance::SignalBoxNew(lua_State *L)
std::string name, icon = std::string(NEUTRINO_ICON_INFO);
int x = 110, y = 150, dx = 430, dy = 150;
int vertical = true;
tableLookup(L, "x", x);
tableLookup(L, "y", y);
tableLookup(L, "dx", dx);
tableLookup(L, "dy", dy);
tableLookup(L, "vertical", vertical);
CLuaSignalBox **udata = (CLuaSignalBox **) lua_newuserdata(L, sizeof(CLuaSignalBox *));
*udata = new CLuaSignalBox();
(*udata)->s = new CSignalBox(x, y, dx, dy);
(*udata)->s = new CSignalBox(x, y, dx, dy, NULL, (vertical!=0)?true:false);
luaL_getmetatable(L, "signalbox");
lua_setmetatable(L, -2);
return 1;