Torque3D/Templates/BaseGame/game/tools/assetBrowser/scripts/selectPath.cs
Areloch b1e3706dd6 Removed unneeded deletion of asset definition in various asset deconstructors - was causing crash on shutdown when a new asset was made
Added ability to check if popup menu is currently Visible
Removed unwanted path debug/testing code from tsShapeConstructor
Made a number of default postFX's names more consistent and set up asset definitions for them. Began adding hooks to PostFX editor as well
Refactored Asset Import window with new layout, revamped import behavior to work with new layout concept and easier editing of import 'session'
Updated Asset Browser to utilize a common 'DirectoryHandler' object to standardize/centralize all folder navigation behavior for the asset tool ecosystem
Added new window to select path for assets
Refactored import config editor to be easier to utilize
Added field in editor settings to edit import configs without needing to first try and import assets
Updated a number of asset types' scripts to handle address-based system
Began standardizing a number of 'actions' for the asset browser, including drag-n-drop, renaming, deleting, moving, etc.
Made refreshing behavior of AB more consistent
When making new in AB folder, it will automatically navigate to the new folder
When making a new folder, prompts the folder name via new popup window
Refactored PostFX editor to use newer layout with side list for easier use
2019-12-03 00:09:18 -06:00

47 lines
1.3 KiB
C#

function SelectAssetPath::onWake(%this)
{
}
//SelectAssetPath.showDialog();
function SelectAssetPath::showDialog(%this, %startingPath, %callback)
{
if(!isObject(%this.dirHandler))
%this.dirHandler = makedirectoryHandler(SelectAssetPath-->folderTree, "Core,Tools,cache,shaderCache", "");
SelectAssetPath-->folderTree.clear();
SelectAssetPath-->folderTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
":tools/classIcons/SimSet:tools/classIcons/SimSet");
%this.dirHandler.currentPath = %startingPath;
%this.callback = %callback;
%dataItem = SelectAssetPath-->folderTree.insertItem(0, "Data");
%this.dirHandler.loadFolders("Data", %dataItem);
Canvas.pushDialog(SelectAssetPath);
}
function selectAssetPathTree::onSelect(%this, %itemId)
{
if(%itemId == 1)
//can't select root
return;
SelectAssetPath.selectedTreeItem = %itemId;
}
function SelectAssetPath::selectPath(%this)
{
//do callback
%selectedId = %this.selectedTreeItem;
%selectedPath = %this-->folderTree.getItemValue(%selectedId) @ "/" @ %this-->folderTree.getItemText(%selectedId);
if(%this.callback !$= "")
{
eval( "" @ %this.callback @ "(\"" @ %selectedPath @ "\");");
}
Canvas.popDialog(SelectAssetPath);
}