From fae9b17be81eeaa29b15ca4e8877e514166210f3 Mon Sep 17 00:00:00 2001 From: Areloch Date: Thu, 1 Feb 2018 01:51:51 -0600 Subject: [PATCH] Corrects the clearFields function of the variableInspector and enables the callback field support. --- Engine/source/gui/editor/inspector/variableField.h | 1 + Engine/source/gui/editor/inspector/variableGroup.cpp | 3 +++ Engine/source/gui/editor/inspector/variableInspector.cpp | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Engine/source/gui/editor/inspector/variableField.h b/Engine/source/gui/editor/inspector/variableField.h index 39ba2e2b8..8bb382a58 100644 --- a/Engine/source/gui/editor/inspector/variableField.h +++ b/Engine/source/gui/editor/inspector/variableField.h @@ -57,6 +57,7 @@ public: protected: StringTableEntry mVariableName; + StringTableEntry mSetCallbackName; SimObject* mOwnerObject; }; diff --git a/Engine/source/gui/editor/inspector/variableGroup.cpp b/Engine/source/gui/editor/inspector/variableGroup.cpp index 2d03f7483..83e4f3c32 100644 --- a/Engine/source/gui/editor/inspector/variableGroup.cpp +++ b/Engine/source/gui/editor/inspector/variableGroup.cpp @@ -151,6 +151,9 @@ bool GuiInspectorVariableGroup::inspectGroup() fieldGui->setInspectorField(NULL, mFields[i]->mFieldLabel); fieldGui->setDocs(mFields[i]->mFieldDescription); + if(mFields[i]->mSetCallbackName != StringTable->EmptyString()) + fieldGui->setSpecialEditCallbackName(mFields[i]->mSetCallbackName); + /*if (mFields[i]->mSetCallbackName != StringTable->EmptyString()) { fieldGui->on.notify() diff --git a/Engine/source/gui/editor/inspector/variableInspector.cpp b/Engine/source/gui/editor/inspector/variableInspector.cpp index edfaf2ed1..115e48b83 100644 --- a/Engine/source/gui/editor/inspector/variableInspector.cpp +++ b/Engine/source/gui/editor/inspector/variableInspector.cpp @@ -195,8 +195,10 @@ void GuiVariableInspector::addCallbackField(const char* name, const char* label, void GuiVariableInspector::clearFields() { + mGroups.clear(); mFields.clear(); - clearGroups(); + clear(); + update(); }