Skip to content

Davey: fails to properly display types with meta inheritance #1313

@FaultyPine

Description

@FaultyPine
struct Base
{
    int x;
};
struct Derived : public Base
{
   char y;
};
entt::meta_factory<Base>{}.data<&Base::x>("x");
entt::meta_factory<Derived>{}.base<Base>();

when calling davey on a registry with that Derived component, i would expect it to display both the x and y when displaying a Derived. But it only checks the .data() meta members on Derived, which is an empty list. It should check both the members of Derived, and also "recurse" down any base classes.
I.E. here:

if(const auto obj = type.from_void(storage.value(entt)); obj) {
    present_element<Entity>(obj, [&ctx, from, to](const char *name, const Entity other) {
        if(ImGui::TreeNode(name, "%s: %d [%d/%d]", name, to_integral(other), to_entity(other), to_version(other))) {
            present_entity<Entity>(ctx, other, from, to);
            ImGui::TreePop();
        }
    });
}

If type has a .base(), it should call present_element on that first.

Metadata

Metadata

Assignees

Labels

enhancementaccepted requests, sooner or later I'll do itsolvedavailable upstream or in a branch

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions