From 73b81a82467b98817f05803cacce04774ca12e18 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 28 Jan 2018 15:12:02 -0600 Subject: [PATCH] Small fixes to the inspector, and added the ability for the variableInspector to process command and filename field types. --- Engine/source/gui/editor/guiInspector.cpp | 8 ++++++-- Engine/source/gui/editor/inspector/variableInspector.cpp | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Engine/source/gui/editor/guiInspector.cpp b/Engine/source/gui/editor/guiInspector.cpp index 63e112c9e..4551d03e8 100644 --- a/Engine/source/gui/editor/guiInspector.cpp +++ b/Engine/source/gui/editor/guiInspector.cpp @@ -54,7 +54,8 @@ GuiInspector::GuiInspector() mOverDivider( false ), mMovingDivider( false ), mHLField( NULL ), - mShowCustomFields( true ) + mShowCustomFields( true ), + mComponentGroupTargetId(-1) { mPadding = 1; } @@ -620,7 +621,10 @@ void GuiInspector::refresh() else compName = comp->getComponentName(); - GuiInspectorGroup *compGroup = new GuiInspectorComponentGroup(compName, this, comp); + StringBuilder captionString; + captionString.format("%s [%i]", compName.c_str(), comp->getId()); + + GuiInspectorGroup *compGroup = new GuiInspectorComponentGroup(captionString.data(), this, comp); if (compGroup != NULL) { compGroup->registerObject(); diff --git a/Engine/source/gui/editor/inspector/variableInspector.cpp b/Engine/source/gui/editor/inspector/variableInspector.cpp index 6e673bc34..edfaf2ed1 100644 --- a/Engine/source/gui/editor/inspector/variableInspector.cpp +++ b/Engine/source/gui/editor/inspector/variableInspector.cpp @@ -167,6 +167,10 @@ void GuiVariableInspector::addField(const char* name, const char* label, const c fieldTypeMask = TypeColorF; else if (newField.mFieldTypeName == StringTable->insert("ease")) fieldTypeMask = TypeEaseF; + else if (newField.mFieldTypeName == StringTable->insert("command")) + fieldTypeMask = TypeCommand; + else if (newField.mFieldTypeName == StringTable->insert("filename")) + fieldTypeMask = TypeStringFilename; else fieldTypeMask = -1; @@ -192,6 +196,7 @@ void GuiVariableInspector::addCallbackField(const char* name, const char* label, void GuiVariableInspector::clearFields() { mFields.clear(); + clearGroups(); update(); }