Commit 678cdc50 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Fixed LuaTreeItemTable to also show metatables of the corresponding Lua table.

refs #643
parent 38884324
......@@ -152,6 +152,13 @@ namespace campvis {
, _thisTable(thisTable)
, _isMetatable(isMetatable)
// this casting here is not really that beautiful, but does it's job:
// somehow, we need to get the parent table to check for the metatable.
auto ltit = dynamic_cast<LuaTreeItemTable*>(getParent());
if (ltit && ltit->_thisTable->hasMetatable(_name)) {
new LuaTreeItemTable(true, ltit->_thisTable->getMetatable(name), name, LUA_TTABLE, this);
auto& valueMap = thisTable->getValueMap();
for (auto it = valueMap.cbegin(); it != valueMap.cend(); ++it) {
const std::string& itemName = it->first;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment