From 3be33929ec828d30972aac42333608a495e6d95d Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 18 Jul 2020 03:01:42 -0500 Subject: [PATCH] Fixes an issue where it wouldn't correctly set the targetModuleId and targetPath when doing a drag and drop import of assets in the AB. --- .../tools/assetBrowser/scripts/assetImport.cs | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs index 4203072d7..e05e0d980 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs @@ -82,6 +82,9 @@ function ImportAssetWindow::onWake(%this) AssetImportTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId; ImportAssetConfigList.setSelected(0); + %this.importer.targetPath = AssetImportTargetAddress.getText(); + %this.importer.targetModuleId = AssetImportTargetModule.getText(); + ImportActivityLog.empty(); %this.refresh(); @@ -707,6 +710,8 @@ function ImportAssetWindow::doRefresh(%this) } %this.dirty = false; + + AssetBrowser.refresh(); } function ImportAssetWindow::refreshAssetItem(%this, %assetItem, %parentTreeIdx) @@ -965,20 +970,24 @@ function ImportAssetWindow::addMaterialMap(%this, %map) function ImportAssetWindow::ImportAssets(%this) { //get the selected module data - %moduleName = AssetImportTargetModule.getText(); - - %module = ModuleDatabase.findModule(%moduleName, 1); - - if(!isObject(%module)) + if(%this.importer.targetModuleId $= "") { - MessageBoxOK( "Error!", "No module selected. You must select or create a module for the assets to be added to."); - return; + %moduleName = AssetImportTargetModule.getText(); + + %module = ModuleDatabase.findModule(%moduleName, 1); + + if(!isObject(%module)) + { + MessageBoxOK( "Error!", "No module selected. You must select or create a module for the assets to be added to."); + return; + } + + Canvas.pushDialog( EditorLoadingGui ); + Canvas.repaint(); + + %this.importer.targetModuleId = %moduleName; } - Canvas.pushDialog( EditorLoadingGui ); - Canvas.repaint(); - - %this.importer.targetModuleId = %moduleName; %this.importer.targetPath = AssetImportTargetAddress.getText(); %this.importer.importAssets();