From b96d891e2b41c98aa84cfb932e9d3fcd924de810 Mon Sep 17 00:00:00 2001 From: Lubos Lenco Date: Sat, 3 Jul 2021 12:53:26 +0200 Subject: [PATCH] Cleanup --- Assets/plugins/dev/converter.js | 4 ++-- Assets/plugins/texture_breakdown.js | 2 +- Sources/arm/Project.hx | 2 +- Sources/arm/ui/UIFiles.hx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/plugins/dev/converter.js b/Assets/plugins/dev/converter.js index 87af84e1..c37d41cf 100644 --- a/Assets/plugins/dev/converter.js +++ b/Assets/plugins/dev/converter.js @@ -7,7 +7,7 @@ plugin.drawUI = function(ui) { if (ui.panel(h1, "Converter")) { ui.row([1/2, 1/2]); if (ui.button(".arm to .json")) { - arm.UIFiles.show("arm", false, function(path) { + arm.UIFiles.show("arm", false, true, function(path) { iron.Data.getBlob(path, function(b) { let parsed = iron.ArmPack.decode(b.bytes); let out = core.Bytes.ofString(core.Json.stringify(parsed, function(key, value) { @@ -33,7 +33,7 @@ plugin.drawUI = function(ui) { }); } if (ui.button(".json to .arm")) { - arm.UIFiles.show("json", false, function(path) { + arm.UIFiles.show("json", false, true, function(path) { iron.Data.getBlob(path, function(b) { let parsed = core.Json.parse(b.toString()); function iterate(d) { diff --git a/Assets/plugins/texture_breakdown.js b/Assets/plugins/texture_breakdown.js index 7f239cfd..c0f2f0bd 100644 --- a/Assets/plugins/texture_breakdown.js +++ b/Assets/plugins/texture_breakdown.js @@ -43,7 +43,7 @@ plugin.drawUI = function(ui) { } if (ui.button("Export")) { - arm.UIFiles.show("png", true, function(path) { + arm.UIFiles.show("png", true, false, function(path) { arm.App.notifyOnNextFrame(function() { var f = arm.UIFiles.filename; if (f === "") f = "untitled"; diff --git a/Sources/arm/Project.hx b/Sources/arm/Project.hx index 2599ffdd..f2a62eaa 100644 --- a/Sources/arm/Project.hx +++ b/Sources/arm/Project.hx @@ -116,7 +116,7 @@ class Project { } public static function projectSaveAs() { - UIFiles.show("arm", true,false, function(path: String) { + UIFiles.show("arm", true, false, function(path: String) { var f = UIFiles.filename; if (f == "") f = tr("untitled"); filepath = path + Path.sep + f; diff --git a/Sources/arm/ui/UIFiles.hx b/Sources/arm/ui/UIFiles.hx index 0ead8736..c447dd43 100644 --- a/Sources/arm/ui/UIFiles.hx +++ b/Sources/arm/ui/UIFiles.hx @@ -22,7 +22,7 @@ class UIFiles { static var showExtensions = false; static var offline = false; - public static function show(filters: String, isSave: Bool, openMultiple : Bool, filesDone: String->Void) { + public static function show(filters: String, isSave: Bool, openMultiple: Bool, filesDone: String->Void) { #if krom_android if (isSave) { @@ -44,7 +44,7 @@ class UIFiles { } else { var paths = Krom.openDialog(filters, "", openMultiple); - if (paths != null && paths.length > 0) { + if (paths != null) { for (path in paths) { while (path.indexOf(Path.sep + Path.sep) >= 0) path = path.replace(Path.sep + Path.sep, Path.sep); path = path.replace("\r", "");