diff --git a/components/lua_ui/adapter.cpp b/components/lua_ui/adapter.cpp index aa04f4c374..88f282c970 100644 --- a/components/lua_ui/adapter.cpp +++ b/components/lua_ui/adapter.cpp @@ -58,3 +58,4 @@ namespace LuaUi mElement = nullptr; } } + diff --git a/components/lua_ui/widget.cpp b/components/lua_ui/widget.cpp index c98b7ad38f..5a747a79d9 100644 --- a/components/lua_ui/widget.cpp +++ b/components/lua_ui/widget.cpp @@ -96,6 +96,10 @@ namespace LuaUi ext->mParent = this; ext->mTemplateChild = false; ext->widget()->attachToWidget(mSlot->widget()); + // workaround for MyGUI bug + // parent visibility doesn't affect added children + ext->widget()->setVisible(!ext->widget()->getVisible()); + ext->widget()->setVisible(!ext->widget()->getVisible()); } void WidgetExtension::attachTemplate(WidgetExtension* ext) @@ -103,6 +107,10 @@ namespace LuaUi ext->mParent = this; ext->mTemplateChild = true; ext->widget()->attachToWidget(widget()); + // workaround for MyGUI bug + // parent visibility doesn't affect added children + ext->widget()->setVisible(!ext->widget()->getVisible()); + ext->widget()->setVisible(!ext->widget()->getVisible()); } WidgetExtension* WidgetExtension::findDeep(std::string_view flagName)