mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
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:
parent
efffabae06
commit
d952722811
7 changed files with 205 additions and 35 deletions
|
|
@ -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 = "";
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue