Merge pull request #982 from Areloch/OnInspectEditorLogic

Adds logic and handling for Inspected SimObjects to be able to injectnew InspectorGroups and InspectorFields when being inspected for editing.
This commit is contained in:
Brian Roberts 2023-03-04 20:07:25 -06:00 committed by GitHub
commit 59ed9ee7b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 154 additions and 2 deletions

View file

@ -40,6 +40,7 @@
#include "core/stream/fileStream.h"
#include "core/fileObject.h"
#include "persistence/taml/tamlCustom.h"
#include "gui/editor/guiInspector.h"
#include "sim/netObject.h"
#include "cinterface/cinterface.h"
@ -2334,7 +2335,13 @@ String SimObject::_getLogMessage(const char* fmt, va_list args) const
// MARK: ---- API ----
//-----------------------------------------------------------------------------
void SimObject::onInspect(GuiInspector* inspector)
{
if (isMethod("onInspect"))
Con::executef(this, "onInspect", inspector);
}
//-----------------------------------------------------------------------------
DefineEngineMethod( SimObject, dumpGroupHierarchy, void, (),,
"Dump the hierarchy of this object up to RootGroup to the console." )
{

View file

@ -653,7 +653,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks
virtual void onEditorDisable(){};
/// Called when the object is inspected via a GuiInspector control
virtual void onInspect(GuiInspector*) {};
virtual void onInspect(GuiInspector*);
/// @}