This commit is contained in:
Lubos Lenco
2021-07-03 12:53:26 +02:00
parent 93a78f9a02
commit b96d891e2b
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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) {
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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", "");