|
@@ -1,13 +1,30 @@
|
|
|
|
+function AssetBrowser::editSoundAsset(%this, %assetDef)
|
|
|
|
+{
|
|
|
|
+ if (isObject($PreviewSoundSource))
|
|
|
|
+ sfxStop($PreviewSoundSource);
|
|
|
|
+ $PreviewSoundSource = %assetDef.playSound();
|
|
|
|
+}
|
|
|
|
+
|
|
function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
|
|
function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
|
|
{
|
|
{
|
|
%previewData.assetName = %assetDef.assetName;
|
|
%previewData.assetName = %assetDef.assetName;
|
|
%previewData.assetPath = %assetDef.soundFilePath;
|
|
%previewData.assetPath = %assetDef.soundFilePath;
|
|
- //%previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
|
|
|
|
|
|
|
|
if(%this.selectMode)
|
|
if(%this.selectMode)
|
|
|
|
+ {
|
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
|
|
|
+ }
|
|
else
|
|
else
|
|
|
|
+ {
|
|
|
|
+ if(EditorSettings.value("Assets/Browser/doubleClickAction", "Edit Asset") $= "Edit Asset")
|
|
|
|
+ {
|
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ %previewData.doubleClickCommand = "AssetBrowser.onSoundAssetEditorDropped( "@%assetDef@" );";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
%previewData.previewImage = "ToolsModule:soundIcon_image";
|
|
%previewData.previewImage = "ToolsModule:soundIcon_image";
|
|
|
|
|
|
@@ -52,7 +69,26 @@ function AssetBrowser::onSoundAssetEditorDropped(%this, %assetDef, %position)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-function AssetBrowser::editSoundAsset(%this, %assetDef)
|
|
|
|
|
|
+function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %position )
|
|
{
|
|
{
|
|
- %soundSource = %assetDef.playSound();
|
|
|
|
|
|
+ Canvas.popDialog(EditorDragAndDropLayer);
|
|
|
|
+
|
|
|
|
+ // Make sure this is a color swatch drag operation.
|
|
|
|
+ if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) )
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ %assetType = %payload.assetType;
|
|
|
|
+
|
|
|
|
+ if(%assetType $= "SoundAsset")
|
|
|
|
+{
|
|
|
|
+ %module = %payload.moduleName;
|
|
|
|
+ %asset = %payload.assetName;
|
|
|
|
+
|
|
|
|
+ %targetComponent = %this.targetObject;
|
|
|
|
+ %targetComponent.soundAsset = %module @ ":" @ %asset;
|
|
|
|
+
|
|
|
|
+ //Inspector.refresh();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ EWorldEditor.isDirty = true;
|
|
}
|
|
}
|