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

@ -10,6 +10,8 @@
#include "gui/editor/inspector/group.h"
#include "T3D/gameBase/gameBase.h"
bool SubScene::smTransformChildren = false;
IMPLEMENT_CO_NETOBJECT_V1(SubScene);
S32 SubScene::mUnloadTimeoutMs = 5000;
@ -86,6 +88,10 @@ void SubScene::consoleInit()
Con::addVariable("$SubScene::UnloadTimeoutMS", TypeBool, &SubScene::mUnloadTimeoutMs, "The amount of time in milliseconds it takes for a SubScene to be unloaded if it's inactive.\n"
"@ingroup Editors\n");
Con::addVariable("$SubScene::transformChildren", TypeBool, &SubScene::smTransformChildren,
"@brief If true, then transform manipulations modify child objects. If false, only triggering bounds is manipulated\n\n"
"@ingroup Editors");
}
void SubScene::addObject(SimObject* object)
@ -163,6 +169,30 @@ void SubScene::inspectPostApply()
setMaskBits(-1);
}
void SubScene::setTransform(const MatrixF& mat)
{
if(SubScene::smTransformChildren)
{
Parent::setTransform(mat);
}
else
{
SceneObject::setTransform(mat);
}
}
void SubScene::setRenderTransform(const MatrixF& mat)
{
if (SubScene::smTransformChildren)
{
Parent::setRenderTransform(mat);
}
else
{
SceneObject::setRenderTransform(mat);
}
}
bool SubScene::evaluateCondition()
{
if (!mLoadIf.isEmpty())