Updates most of the handling of asset types to follow a more standardized type-registration system.

This streamlines much of the code and makes it easier to find and follow how different asset, object and file types are handled by the asset browser
Also clears out various bits of cruft and old commented blocks of code
This commit is contained in:
JeffR 2024-09-28 16:09:56 -05:00
parent 00e5482733
commit 3442aceb0f
39 changed files with 1920 additions and 3537 deletions

View file

@ -119,11 +119,7 @@ function AssetBrowser::setupCreateNewAsset(%this, %assetType, %moduleName, %call
NewAssetPropertiesInspector.addCallbackField("description", "Description", "Command", "Description of the new asset", "", "", "updateNewAssetField", %this.newAssetSettings);
NewAssetPropertiesInspector.endGroup();
if(%this.isMethod("setupCreateNew"@%assetType))
{
%command = %this @ ".setupCreateNew"@%assetType @"();";
eval(%command);
}
%this.callAssetTypeFunc(%assetType, "setupCreateNew");
}
function NewAssetPropertiesInspector::updateNewAssetField(%this)
@ -253,7 +249,7 @@ function CreateNewAsset()
return;
}
%assetFilePath = eval(AssetBrowser @ ".create"@%assetType@"();");
%assetFilePath = AssetBrowser.callAssetTypeFunc(%assetType, "onCreateNew");
Canvas.popDialog(AssetBrowser_newAsset);