From e5fa5d6cb4b8fea4c92164214aa47d6dab942075 Mon Sep 17 00:00:00 2001 From: MathemanFlo Date: Wed, 9 Mar 2022 15:54:35 +0100 Subject: [PATCH] Show import button permanently --- Sources/arm/ui/UIHeader.hx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Sources/arm/ui/UIHeader.hx b/Sources/arm/ui/UIHeader.hx index bb196909..e7a42497 100644 --- a/Sources/arm/ui/UIHeader.hx +++ b/Sources/arm/ui/UIHeader.hx @@ -49,12 +49,21 @@ class UIHeader { if (Context.colorIdHandle.changed) Context.ddirty = 2; ui.image(Project.getImage(Project.assets[cid])); } - else if (ui.button(tr("Import"))) { + if (ui.button(tr("Import"))) { UIFiles.show(Path.textureFormats.join(","), false, true, function(path: String) { ImportAsset.run(path, -1.0, -1.0, true, false); + + Context.colorIdHandle.position = Project.assetNames.length - 1; + for (a in Project.assets) { + // Already imported + if (a.file == path) Context.colorIdHandle.position = Project.assets.indexOf(a); + } + Context.ddirty = 2; + Context.colorIdPicked = false; + UIToolbar.inst.toolbarHandle.redraws = 1; UIStatus.inst.statusHandle.redraws = 2; }); - } + } } else if (Context.tool == ToolPicker) { var baseRPicked = Math.round(Context.pickedColor.base.R * 10) / 10;