Torque3D/Templates/BaseGame/game/tools/assetBrowser/scripts/selectModule.tscript
Areloch ec85e9021c Misc Quality of Life and Bug fixes
Added handling for if preview images on image assets fails to generate, will fallback to using the full image
Added handling for double clicking or drag-n-dropping terrain assets to create them
Improved handling of field labels in variable inspector by making the stringtable be case sensitive.
Added editor settings for handling of asset double click behavior. Can now select between Edit Asset and Spawn Asset. Support is asset type dependent.
Added editor setting for auto-importing loose files when navigating to a folder. If on and the user has flagged to also enable auto-import generally, will auto import all unaffiliated loose files in as assets.
Added editor setting for default module to use when creating new assets. Updated various tooling logic so when creating a new material, if this and the 'Always Prompt Module Target' setting is off, it will fill in the target module and target asset path info based on the default module.
Fixed issue with editors that use managedData scripts where if the path didn't exist, the script file wouldn't be made.
Fixed display issue in terrain editor where if you clear the detail map, the normal/macro/orm maps would disable, but not also clear.
Fixed handling of cleared maps in terrain editor so it no longer fills empty maps in with the no image image.
Fixed handling of creating new material where it would fill in the diffuse with a no texture image as the default.
Fixed issue where canceling out of creating a module would still prompt to create the common default folders.
Fixed issue where the Select Module window couldn't be closed via the cancel or x buttons.
Based on feedback, reduced default size of the Text Pad window.
Fixed issue where the Drop At menu list wouldn't correctly display which item was marked after it was changed.
Fixed spawning shape asset handling so it uses whatever the editor's Drop At setting is.
Improved themeing of regular bitmap buttons in the editor.
Based on feedback, flipped layout of Target Module and Target Path in the Create New Asset window.
Improved handling of setting up the Target Path for when creating new assets. If a path is not set, and the user has a Default Module, it will default the path to that module.
2021-08-28 18:51:27 -05:00

41 lines
1.2 KiB
Plaintext

function AssetBrowser_SelectModule::showDialog(%this, %callback)
{
AssetBrowser_SelectModule.callback = %callback;
Canvas.pushDialog(AssetBrowser_SelectModule);
}
function AssetBrowser_SelectModule::onWake(%this)
{
AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
%defaultModule = EditorSettings.value("Assets/New/defaultModule", "");
if(%defaultModule !$= "" &&
EditorSettings.value("Assets/New/alwaysPromptModuleTarget", false) == false)
{
Canvas.popDialog(AssetBrowser_SelectModule);
eval(%this.callback @ "(" @ %defaultModule @ ");");
}
}
function AssetBrowser_SelectModule::moduleSelected(%this)
{
Canvas.popDialog(AssetBrowser_SelectModule);
%module = AssetBrowser_SelectModuleWindow-->ModuleList.getText();
echo("Module Selected: " @ %module);
if(%this.callback !$= "")
eval(%this.callback @ "(" @ %module @ ");");
else
error("AssetBrowser_SelectModule - Invalid callback");
}
function SelectModule_NewAssetModuleBtn::onClick(%this)
{
AssetBrowser.CreateNewModule("AssetBrowser_selectModule.newModuleAdded();");
}
function AssetBrowser_selectModule::newModuleAdded(%this)
{
AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
}