Implements misc fixes for the particle editor and particlesList inspector field

- Clicking the [...] button from the Particle Emitter tab now opens to the Particle tab *and* properly selects the particle data to be edited
- Selecting an emitter object in the map and opening the particle editor now selects the Particle Data to be edited
- Selecting a new Particle Data for a particles slot on a Particle Emitter in the editor now correctly updates the values and updates the field display
- Made it so if clicking [...] button on the ParticleEmitterData or other similar fields for objects, it will now open to the Particle editor instead of the Datablock editor
This commit is contained in:
JeffR 2026-04-19 02:18:05 -05:00
parent 12dddd07b5
commit defbaea2fe
7 changed files with 145 additions and 45 deletions

View file

@ -113,6 +113,19 @@ function ParticleEditorPlugin::onActivated( %this )
EditorGuiStatusBar.setInfo( "Particle editor." );
EditorGuiStatusBar.setSelection( "" );
// Try to start with the object selected in the world editor
%count = EWorldEditor.getSelectionSize();
for (%i = 0; %i < %count; %i++)
{
%obj = EWorldEditor.getSelectedObject(%i);
%datablock = ParticleEditor.getObjectParticleData(%obj);
if (%datablock !$= "" && isObject(%datablock))
{
ParticleEditor.open(%datablock);
break;
}
}
Parent::onActivated( %this );
}
@ -213,3 +226,12 @@ function ParticleEditor::registerParticleEdType(%this, %groupName, %typesList, %
PE_ParticleDataTypes.add(%groupName, %typesList TAB %editorName);
}
//------------------------------------------------------------------------------
function ParticleEditor::getObjectParticleData( %this, %obj )
{
%datablock = "";
if ( %obj.isMemberOfClass( "ParticleEmitterNode" ) )
%datablock = %obj.emitter;
return %datablock;
}