mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
CLuaInstance: Add parameter 'vertical' to CLuaSignalBox
Origin commit data
------------------
Commit: 1f7e8b41d7
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-01-21 (Tue, 21 Jan 2014)
This commit is contained in:
@@ -1400,14 +1400,16 @@ int CLuaInstance::SignalBoxNew(lua_State *L)
|
|||||||
|
|
||||||
std::string name, icon = std::string(NEUTRINO_ICON_INFO);
|
std::string name, icon = std::string(NEUTRINO_ICON_INFO);
|
||||||
int x = 110, y = 150, dx = 430, dy = 150;
|
int x = 110, y = 150, dx = 430, dy = 150;
|
||||||
|
int vertical = true;
|
||||||
tableLookup(L, "x", x);
|
tableLookup(L, "x", x);
|
||||||
tableLookup(L, "y", y);
|
tableLookup(L, "y", y);
|
||||||
tableLookup(L, "dx", dx);
|
tableLookup(L, "dx", dx);
|
||||||
tableLookup(L, "dy", dy);
|
tableLookup(L, "dy", dy);
|
||||||
|
tableLookup(L, "vertical", vertical);
|
||||||
|
|
||||||
CLuaSignalBox **udata = (CLuaSignalBox **) lua_newuserdata(L, sizeof(CLuaSignalBox *));
|
CLuaSignalBox **udata = (CLuaSignalBox **) lua_newuserdata(L, sizeof(CLuaSignalBox *));
|
||||||
*udata = new 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");
|
luaL_getmetatable(L, "signalbox");
|
||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user