Fixes issue where Regenerate Bounds button for SceneGroup/SubScenes wasn't displaying by moving it to Editing inspector group

Added mode toggle for if changing the transform influences the child objects of a SubScene or not
Added onSelected/onUnselected callbacks for SimObjects to allow contextual behavior in the editor
Added functionality of programmatic/dynamic Tool Button Palettes
Added logic so when selecting SubScenes the world editor palette has new buttons for letting the move/rotate actions influence the child objects
This commit is contained in:
JeffR 2024-11-05 20:14:36 -06:00
parent 10d1aeca1f
commit e2d0cc1981
11 changed files with 318 additions and 25 deletions

View file

@ -101,6 +101,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");
IMPLEMENT_CALLBACK(SimObject, onSelected, void, (SimObject* obj), (obj), "Generic callback for when an object is selected");
IMPLEMENT_CALLBACK(SimObject, onUnselected, void, (SimObject* obj), (obj), "Generic callback for when an object is un-selected");
namespace Sim
{
@ -527,6 +529,14 @@ bool SimObject::save(const char *pcFileName, bool bOnlySelected, const char *pre
}
bool SimObject::saveAppend(const char* pcFileName, bool bOnlySelected, const char* preappend)
{
return true;
}
//-----------------------------------------------------------------------------
SimPersistID* SimObject::getOrCreatePersistentId()
@ -2207,11 +2217,13 @@ void SimObject::setSelected( bool sel )
{
mFlags.set( Selected );
_onSelected();
onSelected_callback(this);
}
else
{
mFlags.clear( Selected );
_onUnselected();
onUnselected_callback(this);
}
}

View file

@ -579,6 +579,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks
/// Save object as a TorqueScript File.
virtual bool save( const char* pcFilePath, bool bOnlySelected = false, const char *preappend = NULL );
virtual bool saveAppend(const char* pcFilePath, bool bOnlySelected = false, const char* preappend = NULL);
/// Check if a method exists in the objects current namespace.
virtual bool isMethod( const char* methodName );
@ -981,6 +982,8 @@ class SimObject: public ConsoleObject, public TamlCallbacks
DECLARE_CONOBJECT( SimObject );
DECLARE_CALLBACK(void, onInspectPostApply, (SimObject* obj));
DECLARE_CALLBACK(void, onSelected, (SimObject* obj));
DECLARE_CALLBACK(void, onUnselected, (SimObject* obj));
static SimObject* __findObject( const char* id ) { return Sim::findObject( id ); }
static const char* __getObjectId( ConsoleObject* object )