mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
add options style for UIComboBox, fix push values of otml nodes
This commit is contained in:
@@ -219,15 +219,18 @@ void push_otml_subnode_luavalue(const OTMLNodePtr& node)
|
||||
} else if(node->hasChildren()) {
|
||||
g_lua.newTable();
|
||||
bool pushedChild = false;
|
||||
int currentIndex = 1;
|
||||
for(const OTMLNodePtr& cnode : node->children()) {
|
||||
if(cnode->isUnique()) {
|
||||
push_luavalue(cnode);
|
||||
if(!g_lua.isNil()) {
|
||||
g_lua.setField(cnode->tag());
|
||||
pushedChild = true;
|
||||
push_otml_subnode_luavalue(cnode);
|
||||
if(!g_lua.isNil()) {
|
||||
if(cnode->isUnique()) {
|
||||
g_lua.pushString(cnode->tag());
|
||||
g_lua.rawSet();
|
||||
} else
|
||||
g_lua.pop();
|
||||
}
|
||||
g_lua.rawSeti(currentIndex++);
|
||||
pushedChild = true;
|
||||
} else
|
||||
g_lua.pop();
|
||||
}
|
||||
if(!pushedChild) {
|
||||
g_lua.pop();
|
||||
|
@@ -364,6 +364,9 @@ void UIWidget::unlockChild(const UIWidgetPtr& child)
|
||||
|
||||
void UIWidget::applyStyle(const OTMLNodePtr& styleNode)
|
||||
{
|
||||
if(styleNode->size() == 0)
|
||||
return;
|
||||
|
||||
m_loadingStyle = true;
|
||||
try {
|
||||
onStyleApply(styleNode->tag(), styleNode);
|
||||
|
Reference in New Issue
Block a user