mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
change loadUI/UI.display lua API
This commit is contained in:
@@ -156,10 +156,14 @@ void UIWidget::setStyleFromNode(const OTMLNodePtr& styleNode)
|
||||
|
||||
void UIWidget::setParent(const UIWidgetPtr& parent)
|
||||
{
|
||||
UIWidgetPtr self = asUIWidget();
|
||||
|
||||
// remove from old parent
|
||||
UIWidgetPtr oldParent = getParent();
|
||||
|
||||
// the parent is already the same
|
||||
if(oldParent == parent)
|
||||
return;
|
||||
|
||||
UIWidgetPtr self = asUIWidget();
|
||||
if(oldParent && oldParent->hasChild(self))
|
||||
oldParent->removeChild(self);
|
||||
|
||||
|
Reference in New Issue
Block a user