MCPcopy Create free account
hub / github.com/OpenMW/openmw / pluckElementRoot

Function pluckElementRoot

components/lua_ui/element.cpp:94–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 WidgetExtension* pluckElementRoot(const sol::object& child, uint64_t depth)
95 {
96 std::shared_ptr<Element> element = child.as<std::shared_ptr<Element>>();
97 if (element->mState == Element::Destroyed || element->mState == Element::Destroy)
98 throw std::logic_error("Using a destroyed element as a layout child");
99 // child Element was created in the same frame and its action hasn't been processed yet
100 if (element->mState == Element::New)
101 element->create(depth + 1);
102 WidgetExtension* root = element->mRoot;
103 assert(root);
104 return root;
105 }
106
107 WidgetExtension* createWidget(const sol::table& layout, bool isRoot, uint64_t depth);
108 void updateWidget(WidgetExtension* ext, const sol::table& layout, uint64_t depth);

Callers 1

updateContentFunction · 0.85

Calls 1

createMethod · 0.45

Tested by

no test coverage detected