diff --git a/Engine/source/gui/editor/guiInspector.cpp b/Engine/source/gui/editor/guiInspector.cpp index 86d33933c..48c4dcc94 100644 --- a/Engine/source/gui/editor/guiInspector.cpp +++ b/Engine/source/gui/editor/guiInspector.cpp @@ -232,6 +232,27 @@ GuiInspectorGroup* GuiInspector::findExistentGroup( StringTableEntry groupName ) return NULL; } +S32 GuiInspector::findExistentGroupIndex(StringTableEntry groupName) +{ + // If we have no groups, it couldn't possibly exist + if (mGroups.empty()) + return -1; + + // Attempt to find it in the group list + Vector::iterator i = mGroups.begin(); + + S32 index = 0; + for (; i != mGroups.end(); i++) + { + if (dStricmp((*i)->getGroupName(), groupName) == 0) + return index; + + index++; + } + + return -1; +} + //----------------------------------------------------------------------------- void GuiInspector::updateFieldValue( StringTableEntry fieldName, StringTableEntry arrayIdx ) diff --git a/Engine/source/gui/editor/guiInspector.h b/Engine/source/gui/editor/guiInspector.h index 7bf20f7e0..0d776ff59 100644 --- a/Engine/source/gui/editor/guiInspector.h +++ b/Engine/source/gui/editor/guiInspector.h @@ -111,6 +111,16 @@ public: mGroups.push_back(group); } + /// + /// Inserts a group into group list at a specific position + /// + /// + /// + void insertInspectorGroup(U32 insertIndex, GuiInspectorGroup* group) + { + mGroups.insert(insertIndex, group); + } + /// Deletes all GuiInspectorGroups void clearGroups(); @@ -118,6 +128,13 @@ public: /// Helper for inspectObject GuiInspectorGroup* findExistentGroup( StringTableEntry groupName ); + /// + /// Looks through the group list by name to find it's index + /// + /// + /// Returns the index position of the group in the group list as S32. -1 if groupName not found. + S32 findExistentGroupIndex(StringTableEntry groupName); + /// Should there be a GuiInspectorField associated with this fieldName, /// update it to reflect actual/current value of that field in the inspected object. /// Added to support UndoActions