Updates the field types used in the editor to utilize the GuiPopUpMenuCtrlEx to make them support categories and be able to search filter them

Updates the dataBlock field type to properly present categorized listings
Expands the datablock Field to have an edit and add buttons on the field to make the workflow simpler
Adds utility functions to GuiPopUpMenuCtrlEx to control indentation, categories and searchability
Expands datablock editor functionality to be able to create a datablock of a type to pre-set the inheritFrom param of the process early(used for the add new button on DB fields to carry-through the current DB to the creation process of a derivative)
This commit is contained in:
Areloch 2024-02-03 16:10:28 -06:00
parent efffabae06
commit d952722811
7 changed files with 205 additions and 35 deletions

View file

@ -629,10 +629,21 @@ function DatablockEditorPlugin::deleteDatablock( %this )
}
//---------------------------------------------------------------------------------------------
function DatablockEditorPlugin::createNewDatablockOfType(%this, %class, %inheritFrom)
{
$DATABLOCK_EDITOR_NEWDB_CLASS = %class;
$DATABLOCK_EDITOR_NEWDB_INHERITFROM = %inheritFrom;
%this.pickDatablockPath();
}
function DatablockEditorPlugin::createDatablock(%this)
{
%class = DatablockEditorTypeTree.getItemText(DatablockEditorTypeTree.getSelectedItem());
if($DATABLOCK_EDITOR_NEWDB_CLASS $= "")
%class = DatablockEditorTypeTree.getItemText(DatablockEditorTypeTree.getSelectedItem());
else
%class = $DATABLOCK_EDITOR_NEWDB_CLASS;
if( %class !$= "" )
{
// Need to prompt for a name.
@ -659,6 +670,12 @@ function DatablockEditorPlugin::createDatablock(%this)
%list.add( %datablock.getName(), %i + 1 );
}
if($DATABLOCK_EDITOR_NEWDB_INHERITFROM !$= "")
{
%inheritFromListId = %list.findText($DATABLOCK_EDITOR_NEWDB_INHERITFROM);
%list.setSelected(%inheritFromListId);
}
// Set up state of client-side checkbox.
%clientSideCheckBox = DatablockEditorCreatePrompt-->ClientSideCheckBox;
@ -717,7 +734,11 @@ function DatablockEditorPlugin::createPromptNameCheck(%this, %path)
function DatablockEditorPlugin::createDatablockFinish( %this, %name, %copySource )
{
%class = DatablockEditorTypeTree.getItemText(DatablockEditorTypeTree.getSelectedItem());
if($DATABLOCK_EDITOR_NEWDB_CLASS $= "")
%class = DatablockEditorTypeTree.getItemText(DatablockEditorTypeTree.getSelectedItem());
else
%class = $DATABLOCK_EDITOR_NEWDB_CLASS;
if( %class !$= "" )
{
%action = %this.createUndo( ActionCreateDatablock, "Create New Datablock" );
@ -742,6 +763,8 @@ function DatablockEditorPlugin::createDatablockFinish( %this, %name, %copySource
%action.redo();
}
$DATABLOCK_EDITOR_NEWDB_CLASS = "";
}
//---------------------------------------------------------------------------------------------