From 01955e2b3d53c7db7df5fa6cd34bc224dd67d699 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 5 Nov 2020 11:59:08 +0100 Subject: [PATCH] Native file browser only missing on android now --- Sources/arm/Config.hx | 5 ----- Sources/arm/ConfigFormat.hx | 1 - Sources/arm/ui/BoxPreferences.hx | 4 ---- Sources/arm/ui/UIFiles.hx | 13 ++++++++----- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Sources/arm/Config.hx b/Sources/arm/Config.hx index 4d412c5d..a992c7c3 100644 --- a/Sources/arm/Config.hx +++ b/Sources/arm/Config.hx @@ -102,11 +102,6 @@ class Config { raw.camera_speed = 1.0; raw.invert_zoom_direction = false; raw.displace_strength = 0.0; - #if krom_android - raw.native_file_browser = false; - #else - raw.native_file_browser = true; - #end raw.show_asset_names = false; raw.node_preview = true; raw.workspace = 0; diff --git a/Sources/arm/ConfigFormat.hx b/Sources/arm/ConfigFormat.hx index 2319cb91..32420170 100644 --- a/Sources/arm/ConfigFormat.hx +++ b/Sources/arm/ConfigFormat.hx @@ -45,7 +45,6 @@ typedef TConfig = { @:optional var camera_speed: Null; @:optional var invert_zoom_direction: Null; @:optional var displace_strength: Null; - @:optional var native_file_browser: Null; @:optional var show_asset_names: Null; @:optional var layout: Array; @:optional var workspace: Null; diff --git a/Sources/arm/ui/BoxPreferences.hx b/Sources/arm/ui/BoxPreferences.hx index dcbb7cf0..2aca40d8 100644 --- a/Sources/arm/ui/BoxPreferences.hx +++ b/Sources/arm/ui/BoxPreferences.hx @@ -60,10 +60,6 @@ class BoxPreferences { Config.raw.invert_zoom_direction = ui.check(Id.handle({selected: Config.raw.invert_zoom_direction}), tr("Invert Zoom Direction")); - #if (!krom_android && !krom_ios) - Config.raw.native_file_browser = ui.check(Id.handle({selected: Config.raw.native_file_browser}), tr("Native File Browser")); - #end - Config.raw.node_preview = ui.check(Id.handle({selected: Config.raw.node_preview}), tr("Show Node Preview")); #if arm_debug diff --git a/Sources/arm/ui/UIFiles.hx b/Sources/arm/ui/UIFiles.hx index a9ea37b2..c9c38aae 100644 --- a/Sources/arm/ui/UIFiles.hx +++ b/Sources/arm/ui/UIFiles.hx @@ -21,11 +21,11 @@ class UIFiles { static var showExtensions = true; public static function show(filters: String, isSave: Bool, filesDone: String->Void) { - if (!Config.raw.native_file_browser) { - if (path == null) path = defaultPath; - showCustom(filters, isSave, filesDone); - return; - } + + #if krom_android + if (path == null) path = defaultPath; + showCustom(filters, isSave, filesDone); + #else path = isSave ? Krom.saveDialog(filters, "") : Krom.openDialog(filters, ""); if (path != null) { @@ -36,8 +36,10 @@ class UIFiles { filesDone(path); } releaseKeys(); + #end } + #if krom_android @:access(zui.Zui) static function showCustom(filters: String, isSave: Bool, filesDone: String->Void) { var known = false; @@ -59,6 +61,7 @@ class UIFiles { } }, 600, 500); } + #end static function releaseKeys() { // File dialog may prevent firing key up events