|
|
|
@ -189,8 +189,8 @@ namespace LuaUi
|
|
|
|
|
assert(!mRoot);
|
|
|
|
|
if (!mRoot)
|
|
|
|
|
{
|
|
|
|
|
mRoot = createWidget(mLayout, 0);
|
|
|
|
|
mLayer = setLayer(mRoot, mLayout);
|
|
|
|
|
mRoot = createWidget(layout(), 0);
|
|
|
|
|
mLayer = setLayer(mRoot, layout());
|
|
|
|
|
updateAttachment();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -199,16 +199,16 @@ namespace LuaUi
|
|
|
|
|
{
|
|
|
|
|
if (mRoot && mUpdate)
|
|
|
|
|
{
|
|
|
|
|
if (mRoot->widget()->getTypeName() != widgetType(mLayout))
|
|
|
|
|
if (mRoot->widget()->getTypeName() != widgetType(layout()))
|
|
|
|
|
{
|
|
|
|
|
destroyWidget(mRoot);
|
|
|
|
|
mRoot = createWidget(mLayout, 0);
|
|
|
|
|
mRoot = createWidget(layout(), 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
updateWidget(mRoot, mLayout, 0);
|
|
|
|
|
updateWidget(mRoot, layout(), 0);
|
|
|
|
|
}
|
|
|
|
|
mLayer = setLayer(mRoot, mLayout);
|
|
|
|
|
mLayer = setLayer(mRoot, layout());
|
|
|
|
|
updateAttachment();
|
|
|
|
|
}
|
|
|
|
|
mUpdate = false;
|
|
|
|
@ -216,9 +216,11 @@ namespace LuaUi
|
|
|
|
|
|
|
|
|
|
void Element::destroy()
|
|
|
|
|
{
|
|
|
|
|
if (mRoot)
|
|
|
|
|
destroyWidget(mRoot);
|
|
|
|
|
if (!mRoot)
|
|
|
|
|
return;
|
|
|
|
|
destroyWidget(mRoot);
|
|
|
|
|
mRoot = nullptr;
|
|
|
|
|
mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
|
|
|
|
|
sAllElements.erase(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|