mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
new lua function for creating widgets: createWidget
This commit is contained in:
@@ -226,7 +226,7 @@ bool luavalue_cast(int index, Size& size)
|
||||
}
|
||||
|
||||
// otml nodes
|
||||
void push_luavalue(const OTMLNodePtr& node)
|
||||
void push_otml_subnode_luavalue(const OTMLNodePtr& node)
|
||||
{
|
||||
if(node->hasValue()) {
|
||||
g_lua.pushString(node->value());
|
||||
@@ -251,6 +251,20 @@ void push_luavalue(const OTMLNodePtr& node)
|
||||
g_lua.pushNil();
|
||||
}
|
||||
|
||||
void push_luavalue(const OTMLNodePtr& node)
|
||||
{
|
||||
g_lua.newTable();
|
||||
for(const OTMLNodePtr& cnode : node->children()) {
|
||||
if(cnode->isUnique()) {
|
||||
push_otml_subnode_luavalue(cnode);
|
||||
if(!g_lua.isNil()) {
|
||||
g_lua.setField(cnode->tag());
|
||||
} else
|
||||
g_lua.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool luavalue_cast(int index, OTMLNodePtr& node)
|
||||
{
|
||||
node = OTMLNode::create();
|
||||
|
Reference in New Issue
Block a user