Update of Particle Editor to standardize it up and utilize inspectors rather than adhoc guis

This commit is contained in:
JeffR 2025-12-21 16:39:19 -06:00
parent 1f5a4267ac
commit 12ebebff46
31 changed files with 5091 additions and 6095 deletions

View file

@ -781,6 +781,30 @@ void GuiInspectorGroup::hideInspectorField(StringTableEntry fieldName, bool setH
field->flag.clear(AbstractClassRep::FIELD_HideInInspectors);
}
void GuiInspectorGroup::replaceInspectorField(StringTableEntry fieldName, GuiInspectorField* replacementField)
{
for (U32 i = 0; i < mStack->size(); i++)
{
GuiInspectorField* field = dynamic_cast<GuiInspectorField*>(mStack->getObject(i));
if (field == nullptr)
continue;
if (field->getFieldName() == fieldName || field->getSpecialEditVariableName() == fieldName)
{
//ensure we match up to the internals
replacementField->mField = field->mField;
mStack->addObject(replacementField);
mStack->reOrder(replacementField, field);
mStack->removeObject(field);
return;
}
}
}
DefineEngineMethod(GuiInspectorGroup, createInspectorField, GuiInspectorField*, (), , "createInspectorField()")
{
return object->createInspectorField();
@ -828,6 +852,16 @@ DefineEngineMethod(GuiInspectorGroup, hideField, void, (const char* fieldName, b
object->hideInspectorField(StringTable->insert(fieldName), setHidden);
}
DefineEngineMethod(GuiInspectorGroup, replaceField, void, (const char* fieldName, GuiInspectorField* field), (nullAsType<GuiInspectorField*>()),
"Removes a Inspector field to this group of a given name.\n"
"@param fieldName The name of the field to be removed.")
{
if (dStrEqual(fieldName, ""))
return;
object->replaceInspectorField(StringTable->insert(fieldName), field);
}
DefineEngineMethod(GuiInspectorGroup, setForcedArrayIndex, void, (S32 arrayIndex), (-1),
"Sets the ForcedArrayIndex for the group. Used to force presentation of arrayed fields to only show a specific field index."
"@param arrayIndex The specific field index for arrayed fields to show. Use -1 or blank arg to go back to normal behavior.")

View file

@ -87,6 +87,7 @@ public:
void addInspectorField(GuiInspectorField* field);
void removeInspectorField(StringTableEntry name);
void hideInspectorField(StringTableEntry fieldName, bool setHidden);
void replaceInspectorField(StringTableEntry fieldName, GuiInspectorField* replacementField);
void setForcedArrayIndex(const S32& arrayIndex = -1)
{