Torque3D/Templates/BaseGame/game/tools/assetBrowser/scripts/setAssetTarget.tscript
Areloch 5892ff7428 Adds handling for drag-and-drop import of files even if asset browser is not open. If world or gui editor are the active controls, then it will injest the incoming files and prompt what their destination module and path will be via a new popup window. After clicking OK, import continues into that destination.
Cleaned up commented lines from drag-and-drop functions.
Fixed issue where material icon on buttons in the object creator windows wouldn't display.
Fixed issue where it wasn't correctly binding cloud textures for BasicClouds object or ripple/foam/depth textures for water objects when newly created
Fixed issue where when double-clicking on a datablock type in the datablock editor, wasn't correctly going through the module selection process, making an invalid destination.
Added handling for Trigger object creation via TriggerData class
Standardized double-click handling of datablock entries in AB to respect double click action mode, and properly either open the datablock editor to the given datablock, or spawn it.
Made Create New Datablock prompt window indicate the destination module to be clearer where it's going if force-prompt of module setting is off.
2021-09-12 05:32:30 -05:00

43 lines
1.2 KiB
Plaintext

function AssetBrowser_setAssetTarget::showDialog(%this, %callback)
{
AssetBrowser_setAssetTarget.callback = %callback;
Canvas.pushDialog(AssetBrowser_setAssetTarget);
}
function AssetBrowser_setAssetTarget::onWake(%this)
{
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
if(%targetModule $= "")
%targetModule = EditorSettings.value("Assets/New/defaultModule", "");
AssetBrowser_setAssetTarget-->moduleList.setText(%targetModule);
%moduleDef = ModuleDatabase.findModule(%targetModule);
%targetPath = AssetBrowser.dirHandler.currentAddress;
if(!startsWith(%targetPath, %moduleDef.ModulePath))
{
%targetPath = %moduleDef.ModulePath;
}
AssetBrowser_setAssetTarget-->targetPath.text = %targetPath;
}
function AssetBrowser_setAssetTargetWindow::onClose(%this)
{
Canvas.popDialog(AssetBrowser_setAssetTarget);
}
function setAssetTargetUpdatePath(%targetPath)
{
AssetBrowser_setAssetTarget-->targetPath.text = %targetPath;
}
function setAssetTarget()
{
AssetBrowser.dirHandler.currentAddress = AssetBrowser_setAssetTarget-->targetPath.text;
eval(AssetBrowser_setAssetTarget.callback);
Canvas.popDialog(AssetBrowser_setAssetTarget);
}