|
@@ -36,7 +36,9 @@
|
|
#include "gui/editor/editorFunctions.h"
|
|
#include "gui/editor/editorFunctions.h"
|
|
#endif
|
|
#endif
|
|
#include "console/engineAPI.h"
|
|
#include "console/engineAPI.h"
|
|
|
|
+#ifdef TORQUE_EXPERIMENTAL_EC
|
|
#include "T3D/Entity.h"
|
|
#include "T3D/Entity.h"
|
|
|
|
+#endif
|
|
|
|
|
|
IMPLEMENT_CONOBJECT(GuiTreeViewCtrl);
|
|
IMPLEMENT_CONOBJECT(GuiTreeViewCtrl);
|
|
|
|
|
|
@@ -645,6 +647,7 @@ void GuiTreeViewCtrl::Item::getTooltipText(U32 bufLen, char *buf)
|
|
|
|
|
|
bool GuiTreeViewCtrl::Item::isParent() const
|
|
bool GuiTreeViewCtrl::Item::isParent() const
|
|
{
|
|
{
|
|
|
|
+#ifdef TORQUE_EXPERIMENTAL_EC
|
|
//We might have a special case with entities
|
|
//We might have a special case with entities
|
|
//So if our entity either has children, or has some component with the EditorInspect interface, we return true
|
|
//So if our entity either has children, or has some component with the EditorInspect interface, we return true
|
|
if (mInspectorInfo.mObject)
|
|
if (mInspectorInfo.mObject)
|
|
@@ -656,6 +659,7 @@ bool GuiTreeViewCtrl::Item::isParent() const
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
if(mState.test(VirtualParent))
|
|
if(mState.test(VirtualParent))
|
|
{
|
|
{
|
|
@@ -3786,6 +3790,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
|
|
if( !item->isInspectorData() && item->mState.test(Item::VirtualParent) )
|
|
if( !item->isInspectorData() && item->mState.test(Item::VirtualParent) )
|
|
onVirtualParentExpand(item);
|
|
onVirtualParentExpand(item);
|
|
|
|
|
|
|
|
+#ifdef TORQUE_EXPERIMENTAL_EC
|
|
//Slightly hacky, but I'm not sure of a better setup until we get major update to the editors
|
|
//Slightly hacky, but I'm not sure of a better setup until we get major update to the editors
|
|
//We check if our object is an entity, and if it is, we call a 'onInspect' function.
|
|
//We check if our object is an entity, and if it is, we call a 'onInspect' function.
|
|
//This function is pretty much a special notifier to the entity so if it has any behaviors that do special
|
|
//This function is pretty much a special notifier to the entity so if it has any behaviors that do special
|
|
@@ -3802,6 +3807,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
|
|
e->onEndInspect();
|
|
e->onEndInspect();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
mFlags.set( RebuildVisible );
|
|
mFlags.set( RebuildVisible );
|
|
scrollVisible(item);
|
|
scrollVisible(item);
|
|
@@ -4539,10 +4545,12 @@ bool GuiTreeViewCtrl::objectSearch( const SimObject *object, Item **item )
|
|
if ( !pItem )
|
|
if ( !pItem )
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
+#ifdef TORQUE_EXPERIMENTAL_EC
|
|
//A bit hackish, but we make a special exception here for items that are named 'Components', as they're merely
|
|
//A bit hackish, but we make a special exception here for items that are named 'Components', as they're merely
|
|
//virtual parents to act as a container to an Entity's components
|
|
//virtual parents to act as a container to an Entity's components
|
|
if (pItem->mScriptInfo.mText == StringTable->insert("Components"))
|
|
if (pItem->mScriptInfo.mText == StringTable->insert("Components"))
|
|
continue;
|
|
continue;
|
|
|
|
+#endif
|
|
|
|
|
|
SimObject *pObj = pItem->getObject();
|
|
SimObject *pObj = pItem->getObject();
|
|
|
|
|
|
@@ -4607,10 +4615,11 @@ bool GuiTreeViewCtrl::onVirtualParentBuild(Item *item, bool bForceFullUpdate)
|
|
|
|
|
|
// Go through our items and purge those that have disappeared from
|
|
// Go through our items and purge those that have disappeared from
|
|
// the set.
|
|
// the set.
|
|
-
|
|
|
|
|
|
+#ifdef TORQUE_EXPERIMENTAL_EC
|
|
//Entities will be a special case here, if we're an entity, skip this step
|
|
//Entities will be a special case here, if we're an entity, skip this step
|
|
if (dynamic_cast<Entity*>(srcObj))
|
|
if (dynamic_cast<Entity*>(srcObj))
|
|
return true;
|
|
return true;
|
|
|
|
+#endif
|
|
|
|
|
|
for( Item* ptr = item->mChild; ptr != NULL; )
|
|
for( Item* ptr = item->mChild; ptr != NULL; )
|
|
{
|
|
{
|