Hooks the component fields back into the inspector so they are registered as proper fields of their types, as opposed to the regular string-only dynamic fields.

This commit is contained in:
Areloch 2016-06-02 22:40:29 -05:00
parent 2464b620ba
commit 89672ea0ab
8 changed files with 369 additions and 9 deletions

View file

@ -32,6 +32,7 @@
#ifdef TORQUE_EXPERIMENTAL_EC
#include "gui/editor/inspector/entityGroup.h"
#include "gui/editor/inspector/mountingGroup.h"
#include "gui/editor/inspector/componentGroup.h"
#endif
IMPLEMENT_CONOBJECT(GuiInspector);
@ -609,6 +610,17 @@ void GuiInspector::refresh()
addObject(mounting);
}
}
if (mTargets.first()->getClassRep()->isSubclassOf("Component"))
{
//Build the component field groups as the component describes it
Component* comp = dynamic_cast<Component*>(mTargets.first().getPointer());
GuiInspectorComponentGroup *compGroup = new GuiInspectorComponentGroup("Component Fields", this);
compGroup->registerObject();
mGroups.push_back(compGroup);
addObject(compGroup);
}
#endif
// Create the inspector groups for static fields.