From 3a209ff61a35a10f6b810368144010b40fd535cd Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 20 Nov 2019 21:26:44 +0100 Subject: [PATCH] Show import options on mesh drop --- Sources/arm/Project.hx | 10 +++++++--- Sources/arm/io/ImportAsset.hx | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Sources/arm/Project.hx b/Sources/arm/Project.hx index 2816b9fb..1fb19130 100644 --- a/Sources/arm/Project.hx +++ b/Sources/arm/Project.hx @@ -238,6 +238,12 @@ class Project { } public static function importMesh() { + UIFiles.show(Path.meshFormats.join(","), false, function(path:String) { + importMeshBox(path); + }); + } + + public static function importMeshBox(path:String) { UIBox.showCustom(function(ui:Zui) { if (ui.tab(Id.handle(), "Import Mesh")) { @@ -254,9 +260,7 @@ class Project { if (ui.button("Import") || ui.isReturnDown) { UIBox.show = false; App.redrawUI(); - UIFiles.show(Path.meshFormats.join(","), false, function(path:String) { - ImportAsset.run(path); - }); + ImportMesh.run(path); } } }); diff --git a/Sources/arm/io/ImportAsset.hx b/Sources/arm/io/ImportAsset.hx index e6d5d927..42017426 100644 --- a/Sources/arm/io/ImportAsset.hx +++ b/Sources/arm/io/ImportAsset.hx @@ -23,7 +23,7 @@ class ImportAsset { public static function run(path:String, dropX = -1.0, dropY = -1.0) { // Mesh if (Path.isMesh(path)) { - ImportMesh.run(path); + Project.importMeshBox(path); } // Image else if (Path.isTexture(path)) {