Change Asset Browser logic to utilize folder heirarchy instead of strict Asset Type filtration

Added navigation history to AB, as well as ability to navigate via forward and backward buttons and breadcrumb buttons
Added folder 'asset type', allowing you to create, rename, delete and move folders via the asset browser for better organization
Adjusted various behaviors to work with the address-driven navigation/organization of the AB
Expanded visibility options for the AB and integrated them into editor settings so they are retained
Added Search field for searching the folder structure, in addition to the existing preview tiles search
Adjusted drag-n-drop behavior of the platform code so it accepts dropping folders
Added ability to dump active PostEffects list to see what is currently running
Added ability to mark specific items in GuiTreeViewCtrl as hidden
Made reflection probe bounds boxes translucent rather than wireframe to improve editing visibility
Added expanded loose file references to LevelAsset for common companion files like decals and posteffect scrips
Added editor setting for Editor Layout Mode, allowing you to set the editor into 'Modern' layout.
Added editor settings to set default import config ruleset, and also ability to set auto-import. If both of these are set, then as long as the importing assets have no errors, they will auto-process and the user doesn't need to manually check and confirm them via the asset import window
This commit is contained in:
Areloch 2019-10-20 02:47:15 -05:00
parent e621e362f4
commit cba14c035f
33 changed files with 1633 additions and 800 deletions

View file

@ -85,6 +85,7 @@ function AssetBrowser::onBeginDropFiles( %this )
//prep the import control
Canvas.pushDialog(AssetImportCtrl);
AssetImportCtrl.setHidden(true);
ImportAssetTree.clear();
ImportAssetTree.insertItem(0, "Importing Assets");
AssetBrowser.unprocessedAssetsCount = 0;
@ -161,136 +162,39 @@ function AssetBrowser::onDropZipFile(%this, %filePath)
}
}
function AssetBrowser::onDropImageFile(%this, %filePath)
{
if(!%this.isVisible())
return;
// File Information madness
%fileName = %filePath;
%fileOnlyName = fileName( %fileName );
%fileBase = validateDatablockName(fileBase( %fileName ) @ "ImageMap");
// [neo, 5/17/2007 - #3117]
// Check if the file being dropped is already in data/images or a sub dir by checking if
// the file path up to length of check path is the same as check path.
%defaultPath = EditorSettings.value( "WorldEditor/defaultMaterialsPath" );
%checkPath = expandFilename( "^"@%defaultPath );
%fileOnlyPath = expandFileName( %filePath ); //filePath( expandFileName( %filePath ) );
%fileBasePath = getSubStr( %fileOnlyPath, 0, strlen( %checkPath ) );
if( %checkPath !$= %fileBasePath )
{
// No match so file is from outside images directory and we need to copy it in
%fileNewLocation = expandFilename("^"@%defaultPath) @ "/" @ fileBase( %fileName ) @ fileExt( %fileName );
// Move to final location
if( !pathCopy( %filePath, %fileNewLocation ) )
return;
}
else
{
// Already in images path somewhere so just link to it
%fileNewLocation = %filePath;
}
addResPath( filePath( %fileNewLocation ) );
%matName = fileBase( %fileName );
// Create Material
%imap = new Material(%matName)
{
mapTo = fileBase( %matName );
diffuseMap[0] = %defaultPath @ "/" @ fileBase( %fileName ) @ fileExt( %fileName );
};
//%imap.setName( %fileBase );
//%imap.imageName = %fileNewLocation;
//%imap.imageMode = "FULL";
//%imap.filterPad = false;
//%imap.compile();
%diffusecheck = %imap.diffuseMap[0];
// Bad Creation!
if( !isObject( %imap ) )
return;
%this.addDatablock( %fileBase, false );
}
function AssetBrowser::onDropSoundFile(%this, %filePath)
{
if(!%this.isVisible())
return;
// File Information madness
%fileName = %filePath;
%fileOnlyName = fileName( %fileName );
%fileBase = validateDatablockName(fileBase( %fileName ) @ "ImageMap");
// [neo, 5/17/2007 - #3117]
// Check if the file being dropped is already in data/images or a sub dir by checking if
// the file path up to length of check path is the same as check path.
%defaultPath = EditorSettings.value( "WorldEditor/defaultMaterialsPath" );
%checkPath = expandFilename( "^"@%defaultPath );
%fileOnlyPath = expandFileName( %filePath ); //filePath( expandFileName( %filePath ) );
%fileBasePath = getSubStr( %fileOnlyPath, 0, strlen( %checkPath ) );
if( %checkPath !$= %fileBasePath )
{
// No match so file is from outside images directory and we need to copy it in
%fileNewLocation = expandFilename("^"@%defaultPath) @ "/" @ fileBase( %fileName ) @ fileExt( %fileName );
// Move to final location
if( !pathCopy( %filePath, %fileNewLocation ) )
return;
}
else
{
// Already in images path somewhere so just link to it
%fileNewLocation = %filePath;
}
addResPath( filePath( %fileNewLocation ) );
%matName = fileBase( %fileName );
// Create Material
%imap = new Material(%matName)
{
mapTo = fileBase( %matName );
diffuseMap[0] = %defaultPath @ "/" @ fileBase( %fileName ) @ fileExt( %fileName );
};
//%imap.setName( %fileBase );
//%imap.imageName = %fileNewLocation;
//%imap.imageMode = "FULL";
//%imap.filterPad = false;
//%imap.compile();
%diffusecheck = %imap.diffuseMap[0];
// Bad Creation!
if( !isObject( %imap ) )
return;
%this.addDatablock( %fileBase, false );
}
function AssetBrowser::onEndDropFiles( %this )
{
if(!%this.isVisible())
return;
//we have assets to import, so go ahead and display the window for that now
AssetImportCtrl.setHidden(false);
ImportAssetWindow.visible = true;
//ImportAssetWindow.validateAssets();
ImportAssetWindow.refresh();
ImportAssetWindow.selectWindow();
%hasIssues = ImportAssetWindow.validateAssets();
//If we have a valid config file set and we've set to auto-import, and we have no
//issues for importing, then go ahead and run the import immediately, don't
//bother showing the window.
//If any of these conditions fail, we'll display the import window so it can be handled
//by the user
if(ImportAssetWindow.importConfigsList.count() != 0 &&
EditorSettings.value("Assets/AssetImporDefaultConfig") !$= "" &&
EditorSettings.value("Assets/AutoImport", false) == true
&& %hasIssues == false)
{
AssetImportCtrl.setHidden(true);
ImportAssetWindow.visible = false;
//Go ahead and check if we have any issues, and if not, run the import!
ImportAssetWindow.ImportAssets();
}
else
{
//we have assets to import, so go ahead and display the window for that now
AssetImportCtrl.setHidden(false);
ImportAssetWindow.visible = true;
ImportAssetWindow.selectWindow();
}
// Update object library
GuiFormManager::SendContentMessage($LBCreateSiderBar, %this, "refreshAll 1");
@ -503,9 +407,6 @@ function ImportAssetWindow::onWake(%this)
//Lets refresh our list
if(!ImportAssetWindow.isVisible())
return;
$AssetBrowser::importConfigsFile = "tools/assetBrowser/assetImportConfigs.xml";
$AssetBrowser::currentImportConfig = "";
if(!isObject(AssetImportSettings))
{
@ -526,7 +427,11 @@ function ImportAssetWindow::onWake(%this)
function ImportAssetWindow::reloadImportOptionConfigs(%this)
{
ImportAssetWindow.importConfigsList = new ArrayObject();
if(!isObject(ImportAssetWindow.importConfigsList))
ImportAssetWindow.importConfigsList = new ArrayObject();
else
ImportAssetWindow.importConfigsList.empty();
ImportAssetConfigList.clear();
%xmlDoc = new SimXMLDocument();
@ -1168,10 +1073,12 @@ function ImportAssetWindow::validateAssets(%this)
//Clear any status
%this.resetAssetsValidationStatus();
ImportAssetWindow.importIssues = false;
%id = ImportAssetTree.getChild(1);
%hasIssues = %this.validateAsset(%id);
if(%hasIssues)
if(ImportAssetWindow.importIssues == false)
return false;
else
return true;
@ -1179,6 +1086,7 @@ function ImportAssetWindow::validateAssets(%this)
function ImportAssetWindow::validateAsset(%this, %id)
{
%moduleName = ImportAssetModuleList.getText();
while (%id > 0)
@ -1229,21 +1137,17 @@ function ImportAssetWindow::validateAsset(%this, %id)
{
%foundCollision = true;
%assetItem.status = "Warning";
%assetItem.status = "error";
%assetItem.statusType = "DuplicateAsset";
%assetItem.statusInfo = "Duplicate asset names found with the target module!\nAsset \"" @
%assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" has a matching name.\nPlease rename it and try again!";
//Clean up our queries
%assetQuery.delete();
break;
}
}
if(%foundCollision == true)
{
%hasIssues = true;
//yup, a collision, prompt for the change and bail out
/*MessageBoxOK( "Error!", "Duplicate asset names found with the target module!\nAsset \"" @
%assetItemA.assetName @ "\" of type \"" @ %assetItemA.assetType @ "\" has a matching name.\nPlease rename it and try again!");*/
@ -1259,7 +1163,6 @@ function ImportAssetWindow::validateAsset(%this, %id)
//Check if we were given a file path(so not generated) but somehow isn't a valid file
if(%assetItem.filePath !$= "" && !%assetItem.generatedAsset && !isFile(%assetItem.filePath))
{
%hasIssues = true;
%assetItem.status = "error";
%assetItem.statusType = "MissingFile";
%assetItem.statusInfo = "Unable to find file to be imported. Please select asset file.";
@ -1273,6 +1176,9 @@ function ImportAssetWindow::validateAsset(%this, %id)
}
}
if(%assetItem.status $= "error")
ImportAssetWindow.importIssues = true;
if(ImportAssetTree.isParentItem(%id))
{
%childItem = ImportAssetTree.getChild(%id);

View file

@ -9,7 +9,9 @@ function ImportAssetConfigList::onSelect( %this, %id, %text )
ImportAssetWindow.activeImportConfigIndex = %id;
ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id);
AssetBrowser.reloadImportingFiles();
//If we were trying to import anything, refresh it with the new config
if( AssetBrowser.importingFilesArray.count() != 0)
AssetBrowser.reloadImportingFiles();
}
function setupImportConfigSettingsList()
@ -428,8 +430,9 @@ function ImportOptionsConfigList::changeEditorSetting(%this, %varName, %value)
if(%oldValue !$= %value)
{
%id = %this.getSelectedRow();
%this.setSelectedRow(%id);
%scollPos = ImportAssetConfigEditorScroll.getScrollPosition();
ImportAssetConfigEditorWindow.populateConfigList(ImportAssetWindow.activeImportConfig);
ImportAssetConfigEditorScroll.setScrollPosition(%scollPos.x, %scollPos.y);
}
}

View file

@ -76,7 +76,7 @@ function AssetBrowser::duplicateComponentAsset(%this, %assetId)
}
function AssetBrowser::renameGameObjectAsset(%this, %assetDef, %newAssetId, %originalName, %newName)
function AssetBrowser::renameComponentAsset(%this, %assetDef, %newAssetId, %originalName, %newName)
{
%assetPath = AssetDatabase.getAssetFilePath(%newAssetId);

View file

@ -5,9 +5,11 @@ function AssetBrowser::createGUIAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%tamlpath = %modulePath @ "/GUIs/" @ %assetName @ ".asset.taml";
%guipath = %modulePath @ "/GUIs/" @ %assetName @ ".gui";
%scriptPath = %modulePath @ "/GUIs/" @ %assetName @ ".cs";
%assetPath = AssetBrowser.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%guipath = %assetPath @ %assetName @ ".gui";
%scriptPath = %assetPath @ %assetName @ ".cs";
%asset = new GUIAsset()
{

View file

@ -117,7 +117,7 @@ function AssetBrowser::importImageAsset(%this, %assetItem)
%assetImportSuccessful = false;
%assetId = %moduleName@":"@%assetName;
%assetPath = "data/" @ %moduleName @ "/Images";
%assetPath = AssetBrowser.currentAddress @ "/";
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
%newAsset = new ImageAsset()

View file

@ -5,14 +5,20 @@ function AssetBrowser::createLevelAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%tamlpath = %modulePath @ "/levels/" @ %assetName @ ".asset.taml";
%levelPath = %modulePath @ "/levels/" @ %assetName @ ".mis";
%assetPath = AssetBrowser.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%levelPath = %assetPath @ %assetName @ ".mis";
%asset = new LevelAsset()
{
AssetName = %assetName;
versionId = 1;
LevelFile = %assetName @ ".mis";
DecalsFile = %assetName @ ".mis.decals";
PostFXPresetFile = %assetName @ ".postfxpreset.cs";
ForestFile = %assetName @ ".forest";
NavmeshFile = %assetName @ ".nav";
LevelName = AssetBrowser.newAssetSettings.levelName;
AssetDescription = AssetBrowser.newAssetSettings.description;
PreviewImage = AssetBrowser.newAssetSettings.levelPreviewImage;
@ -24,6 +30,10 @@ function AssetBrowser::createLevelAsset(%this)
{
echo("Unable to copy template level file!");
}
//Generate the associated files
DecalManagerSave( %assetPath @ %asset.DecalsFile );
PostFXManager::savePresetHandler( %assetPath @ %asset.PostFXPresetFile );
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);

View file

@ -278,10 +278,10 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
%assetImportSuccessful = false;
%assetId = %moduleName@":"@%assetName;
%assetPath = "data/" @ %moduleName @ "/materials";
%tamlpath = %assetPath @ "/" @ %assetName @ ".asset.taml";
%sgfPath = %assetPath @ "/" @ %assetName @ ".sgf";
%scriptPath = %assetPath @ "/" @ %assetName @ ".cs";
%assetPath = AssetBrowser.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%sgfPath = %assetPath @ %assetName @ ".sgf";
%scriptPath = %assetPath @ %assetName @ ".cs";
%newAsset = new MaterialAsset()
{

View file

@ -3,10 +3,12 @@ function AssetBrowser::createScriptAsset(%this)
%moduleName = AssetBrowser.newAssetSettings.moduleName;
%modulePath = "data/" @ %moduleName;
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetName = AssetBrowser.newAssetSettings.assetName;
%tamlpath = %modulePath @ "/scripts/" @ %assetName @ ".asset.taml";
%scriptPath = %modulePath @ "/scripts/" @ %assetName @ ".cs";
%assetPath = AssetBrowser.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%scriptPath = %assetPath @ %assetName @ ".cs";
%asset = new ScriptAsset()
{

View file

@ -5,8 +5,10 @@ function AssetBrowser::createShapeAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%tamlpath = %modulePath @ "/shapes/" @ %assetName @ ".asset.taml";
%shapeFilePath = %modulePath @ "/shapes/" @ %assetName @ ".dae";
%assetPath = AssetBrowser.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%shapeFilePath = %assetPath @ %assetName @ ".dae";
%asset = new ShapeAsset()
{

View file

@ -76,7 +76,7 @@ function AssetBrowser::refreshAsset(%this, %assetId)
function AssetBrowser::renameAsset(%this)
{
//Find out what type it is
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
//%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
%curFirstResponder = AssetBrowser.getFirstResponder();
@ -92,36 +92,56 @@ function AssetBrowser::performRenameAsset(%this, %originalAssetName, %newName)
//if the name is different to the asset's original name, rename it!
if(%originalAssetName !$= %newName)
{
%moduleName = AssetBrowser.selectedModule;
//do a rename!
%success = AssetDatabase.renameDeclaredAsset(%moduleName @ ":" @ %originalAssetName, %moduleName @ ":" @ %newName);
if(%success)
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a success.");
else
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a failure.");
if(%success)
if(EditAssetPopup.assetType !$= "Folder")
{
%newAssetId = %moduleName @ ":" @ %newName;
%assetPath = AssetDatabase.getAssetFilePath(%newAssetId);
%moduleName = AssetBrowser.selectedModule;
//Rename any associated files as well
%assetDef = AssetDatabase.acquireAsset(%newAssetId);
%assetType = %assetDef.getClassName();
//do a rename!
%success = AssetDatabase.renameDeclaredAsset(%moduleName @ ":" @ %originalAssetName, %moduleName @ ":" @ %newName);
//rename the file to match
%path = filePath(%assetPath);
if(%success)
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a success.");
else
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a failure.");
//Do the rename command
%buildCommand = %this @ ".rename" @ %assetType @ "(" @ %assetDef @ "," @ %newAssetId @ ");";
eval(%buildCommand);
if(%success)
{
%newAssetId = %moduleName @ ":" @ %newName;
%assetPath = AssetDatabase.getAssetFilePath(%newAssetId);
//Rename any associated files as well
%assetDef = AssetDatabase.acquireAsset(%newAssetId);
%assetType = %assetDef.getClassName();
//rename the file to match
%path = filePath(%assetPath);
//Do the rename command
%buildCommand = %this @ ".rename" @ %assetType @ "(" @ %assetDef @ "," @ %newAssetId @ ");";
eval(%buildCommand);
}
}
else
{
%buildCommand = %this @ ".renameFolder(\"" @ EditAssetPopup.assetId @ "\",\"" @ %newName @ "\");";
eval(%buildCommand);
}
}
//Make sure everything is refreshed
AssetBrowser.loadFilters();
//Update the selection to immediately jump to the new asset
AssetBrowser-->filterTree.clearSelection();
%ModuleItem = AssetBrowser-->filterTree.findItemByName(%moduleName);
%assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%ModuleItem, %assetType);
AssetBrowser-->filterTree.selectItem(%assetTypeId);
%selectedItem = AssetBrowser-->filterTree.getSelectedItem();
AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem);
AssetBrowser-->filterTree.buildVisibleTree();
}
function AssetNameField::onReturn(%this)
@ -132,6 +152,26 @@ function AssetNameField::onReturn(%this)
AssetBrowser.performRenameAsset(%this.originalAssetName, %this.getText());
}
//------------------------------------------------------------
function AssetBrowser::moveAsset(%this, %destination)
{
if(EditAssetPopup.assetType $= "Folder")
{
//Do any cleanup required given the type
if(%this.isMethod("moveFolder"))
eval(%this @ ".moveFolder("@EditAssetPopup.assetId@",\""@%destination@"\");");
}
else
{
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType);
//Do any cleanup required given the type
if(%this.isMethod("move"@%assetType))
eval(%this @ ".move"@%assetType@"("@%assetDef@");");
}
}
//------------------------------------------------------------
function AssetBrowser::duplicateAsset(%this, %targetModule)
@ -157,10 +197,10 @@ function AssetBrowser::duplicateAsset(%this, %targetModule)
function AssetBrowser::deleteAsset(%this)
{
//Find out what type it is
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
%assetType = %assetDef.getClassName();
//%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
//%assetType = %assetDef.getClassName();
MessageBoxOKCancel("Warning!", "This will delete the selected asset and the files associated to it, do you wish to continue?",
MessageBoxOKCancel("Warning!", "This will delete the selected content and the files associated to it, do you wish to continue?",
"AssetBrowser.confirmDeleteAsset();", "");
}
@ -169,14 +209,23 @@ function AssetBrowser::confirmDeleteAsset(%this)
%currentSelectedItem = AssetBrowserFilterTree.getSelectedItem();
%currentItemParent = AssetBrowserFilterTree.getParentItem(%currentSelectedItem);
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetId);
//Do any cleanup required given the type
if(%this.isMethod("delete"@%assetType))
eval(%this @ ".delete"@%assetType@"("@%assetDef@");");
AssetDatabase.deleteAsset(EditAssetPopup.assetId, false);
if(EditAssetPopup.assetType $= "Folder")
{
//Do any cleanup required given the type
if(%this.isMethod("deleteFolder"))
eval(%this @ ".deleteFolder(\""@EditAssetPopup.assetId@"\");");
}
else
{
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType);
//Do any cleanup required given the type
if(%this.isMethod("delete"@%assetType))
eval(%this @ ".delete"@%assetType@"("@%assetDef@");");
AssetDatabase.deleteAsset(EditAssetPopup.assetId, false);
}
%this.loadFilters();

View file

@ -191,6 +191,18 @@ function CreateNewAsset()
%callbackCommand = "" @ AssetBrowser_newAsset.callbackFunc @ "(\"" @ %moduleName @ ":" @ %assetName @ "\");";
eval(%callbackCommand);
}
//Update the selection to immediately jump to the new asset
AssetBrowser-->filterTree.clearSelection();
%ModuleItem = AssetBrowser-->filterTree.findItemByName(%moduleName);
%assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%ModuleItem, %assetType);
AssetBrowser-->filterTree.selectItem(%assetTypeId);
%selectedItem = AssetBrowser-->filterTree.getSelectedItem();
AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem);
AssetBrowser-->filterTree.buildVisibleTree();
}
function ParentComponentList::onWake(%this)

View file

@ -55,15 +55,31 @@ function AssetBrowser::buildPopupMenus(%this)
item[ 5 ] = "-";
Item[ 6 ] = "Duplicate Asset" TAB "" TAB "AssetBrowser.duplicateAsset();";
item[ 7 ] = "-";
item[ 8 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();";
item[ 9 ] = "-";
item[ 10 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();";
//item[ 8 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();";
//item[ 9 ] = "-";
item[ 8 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();";
jumpFileName = "";
jumpLineNumber = "";
};
}
if( !isObject( EditFolderPopup ) )
{
new PopupMenu( EditFolderPopup )
{
superClass = "MenuBuilder";
class = "EditorWorldMenu";
//isPopup = true;
item[ 0 ] = "Rename Folder" TAB "" TAB "AssetBrowser.renameAsset();";
item[ 1 ] = "-";
Item[ 2 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();";
item[ 3 ] = "-";
item[ 4 ] = "Delete Folder" TAB "" TAB "AssetBrowser.deleteAsset();";
};
}
if( !isObject( AddNewComponentAssetPopup ) )
{
new PopupMenu( AddNewComponentAssetPopup )
@ -148,15 +164,17 @@ function AssetBrowser::buildPopupMenus(%this)
superClass = "MenuBuilder";
class = "EditorWorldMenu";
item[0] = "Create Code Asset" TAB AddNewScriptAssetPopup;
item[0] = "Create Folder" TAB "" TAB "AssetBrowser.CreateNewFolder();";
item[1] = "-";
item[2] = "Create Art Asset" TAB AddNewArtAssetPopup;
item[2] = "Create Code Asset" TAB AddNewScriptAssetPopup;
item[3] = "-";
item[4] = "Create Level" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewLevelAsset(\"NewLevel\", AssetBrowser.selectedModule);";
item[4] = "Create Art Asset" TAB AddNewArtAssetPopup;
item[5] = "-";
item[6] = "Create C++ Asset" TAB AddNewCppAssetPopup;
item[6] = "Create Level" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewLevelAsset(\"NewLevel\", AssetBrowser.selectedModule);";
item[7] = "-";
item[8] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();";
item[8] = "Create C++ Asset" TAB AddNewCppAssetPopup;
item[9] = "-";
item[10] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();";
};
}
@ -198,6 +216,38 @@ function AssetBrowser::buildPopupMenus(%this)
};
}
//Asset Preview size presets
if( !isObject( AssetPreviewSizePopup ) )
{
new PopupMenu( AssetPreviewSizePopup )
{
superClass = "MenuBuilder";
class = "EditorWorldMenu";
item[ 0 ] = "Small" TAB "" TAB "AssetBrowser.setPreviewSize(\"Small\");";
item[ 1 ] = "Medium" TAB "" TAB "AssetBrowser.setPreviewSize(\"Medium\");";
Item[ 2 ] = "Large" TAB "" TAB "AssetBrowser.setPreviewSize(\"Large\");";
};
AssetPreviewSizePopup.checkItem(0, true);
}
if( !isObject( AssetTypeListPopup ) )
{
new PopupMenu( AssetTypeListPopup )
{
superClass = "MenuBuilder";
class = "EditorWorldMenu";
//isPopup = true;
};
/*for(%i=0; %i < AssetFilterTypeList.Count(); %i++)
{
%assetTypeName = AssetFilterTypeList.getKey(%i);
AssetTypeListPopup.insertItem(%i, %assetTypeName, "", "AssetBrowser.toggleAssetTypeFilter(" @ %i @ ");");
}*/
}
//Browser visibility menu
if( !isObject( BrowserVisibilityPopup ) )
{
@ -208,13 +258,26 @@ function AssetBrowser::buildPopupMenus(%this)
//isPopup = true;
item[ 0 ] = "Toggle Show Core Modules" TAB "" TAB "AssetBrowser.viewCoreModulesFilter();";
item[ 1 ] = "Toggle Only Show Modules with Assets" TAB "" TAB "AssetBrowser.viewPopulatedModulesFilter();";
Item[ 2 ] = "-";
item[ 3 ] = "Show Assets as list" TAB "" TAB "AssetBrowser.viewListFilter();";
Item[ 4 ] = "Show Assets with tags" TAB "" TAB "AssetBrowser.viewTagsFilter();";
item[ 1 ] = "Toggle Show Tools Modules" TAB "" TAB "AssetBrowser.viewToolsModulesFilter();";
item[ 2 ] = "Toggle Only Show Modules with Assets" TAB "" TAB "AssetBrowser.viewPopulatedModulesFilter();";
Item[ 3 ] = "-";
item[ 4 ] = "Show Folders" TAB "" TAB "AssetBrowser.toggleShowingFolders();";
item[ 5 ] = "Show Empty Folders" TAB "" TAB "AssetBrowser.toggleShowingEmptyFolders();";
item[ 6 ] = "-";
item[ 7 ] = "Filter by Asset Type" TAB AssetTypeListPopup;
item[ 8 ] = "-";
item[ 9 ] = "Enable Auto-refresh" TAB "" TAB "AssetBrowser.toggleAutorefresh();";
Item[ 10 ] = "-";
Item[ 11 ] = "Asset Preview Size" TAB AssetPreviewSizePopup;
};
BrowserVisibilityPopup.enableItem(5, false);
BrowserVisibilityPopup.enableItem(7, false);
BrowserVisibilityPopup.enableItem(9, false);
}
//
//Import Legacy menus
if( !isObject( ImportAssetsPopup ) )
{
@ -266,6 +329,7 @@ function AssetBrowser::buildPopupMenus(%this)
};
}
}
function AddNewScriptAssetPopupMenu::onSelectItem(%this, %id, %text)