diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 6cf6fd029..912b74e6d 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -57,6 +57,8 @@ SimObjectId SimObject::smForcedId = 0; bool SimObject::preventNameChanging = false; +IMPLEMENT_CALLBACK(SimObject, onInspectPostApply, void, (SimObject* obj), (obj), "Generic callback for when an object is edited"); + namespace Sim { // Defined in simManager.cpp @@ -2237,6 +2239,7 @@ void SimObject::inspectPreApply() void SimObject::inspectPostApply() { + onInspectPostApply_callback(this); } //----------------------------------------------------------------------------- diff --git a/Engine/source/console/simObject.h b/Engine/source/console/simObject.h index beda61739..102689b41 100644 --- a/Engine/source/console/simObject.h +++ b/Engine/source/console/simObject.h @@ -965,6 +965,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks virtual void getConsoleMethodData(const char * fname, S32 routingId, S32 * type, S32 * minArgs, S32 * maxArgs, void ** callback, const char ** usage) {} DECLARE_CONOBJECT( SimObject ); + DECLARE_CALLBACK(void, onInspectPostApply, (SimObject* obj)); static SimObject* __findObject( const char* id ) { return Sim::findObject( id ); } static const char* __getObjectId( ConsoleObject* object ) diff --git a/Engine/source/scene/sceneObject.cpp b/Engine/source/scene/sceneObject.cpp index 0238d6528..10443cf18 100644 --- a/Engine/source/scene/sceneObject.cpp +++ b/Engine/source/scene/sceneObject.cpp @@ -93,7 +93,6 @@ ConsoleDocClass( SceneObject, "@ingroup gameObjects\n" ); -IMPLEMENT_CALLBACK(SceneObject, onInspectPostApply, void, (SceneObject* obj), (obj),"Generic callback for when an object is edited"); #ifdef TORQUE_TOOLS extern bool gEditingMission; #endif @@ -387,7 +386,6 @@ void SceneObject::inspectPostApply() { if( isServerObject() ) setMaskBits( MountedMask ); - onInspectPostApply_callback(this); Parent::inspectPostApply(); } diff --git a/Engine/source/scene/sceneObject.h b/Engine/source/scene/sceneObject.h index ef44982cf..36c8e1cad 100644 --- a/Engine/source/scene/sceneObject.h +++ b/Engine/source/scene/sceneObject.h @@ -798,7 +798,6 @@ class SceneObject : public NetObject, private SceneContainer::Link, public Proce static bool _setGameObject(void* object, const char* index, const char* data); DECLARE_CONOBJECT( SceneObject ); - DECLARE_CALLBACK(void, onInspectPostApply, (SceneObject* obj)); private: SceneObject( const SceneObject& ); ///< @deprecated disallowed diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs index 2a4853e62..08b65c716 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs @@ -489,4 +489,10 @@ function foCollaps (%this, %tab){ case "container2": %tab.visible = "0"; } -} \ No newline at end of file +} + +function simGroup::onInspectPostApply(%this) +{ + %this.callOnChildren("setHidden",%this.hidden); + %this.callOnChildren("setLocked",%this.locked); +}