Update FileDialog.hx

FileDialog.browse fixed for OPEN_FILE, OPEN_DIRECTORY. I changed formatting of the null check on SAVE to match the formatting in the file.
This commit is contained in:
Shahar Marcus
2022-08-30 10:08:45 +03:00
committed by Josh Tynjala
parent 770bf0e296
commit d5bac69ff7

View File

@@ -112,7 +112,10 @@ class FileDialog
var path = null;
#if hl
var bytes = NativeCFFI.lime_file_dialog_open_file(title, filter, defaultPath);
path = @:privateAccess String.fromUTF8(cast bytes);
if (bytes != null)
{
path = @:privateAccess String.fromUTF8(cast bytes);
}
#else
path = NativeCFFI.lime_file_dialog_open_file(title, filter, defaultPath);
#end
@@ -149,7 +152,10 @@ class FileDialog
var path = null;
#if hl
var bytes = NativeCFFI.lime_file_dialog_open_directory(title, filter, defaultPath);
path = @:privateAccess String.fromUTF8(cast bytes);
if (bytes != null)
{
path = @:privateAccess String.fromUTF8(cast bytes);
}
#else
path = NativeCFFI.lime_file_dialog_open_directory(title, filter, defaultPath);
#end
@@ -164,7 +170,10 @@ class FileDialog
var path = null;
#if hl
var bytes = NativeCFFI.lime_file_dialog_save_file(title, filter, defaultPath);
if (bytes != null) path = @:privateAccess String.fromUTF8(cast bytes);
if (bytes != null)
{
path = @:privateAccess String.fromUTF8(cast bytes);
}
#else
path = NativeCFFI.lime_file_dialog_save_file(title, filter, defaultPath);
#end