NativeDialogs
NativeDialogs copied to clipboard
Filter doesn't work on Windows 11 and Godot 4.3 Stable
- NativeDialogs v2.2.1
- Godot 4.3 Stable
var native_file_dialog := NativeFileDialog.new()
func _ready():
native_file_dialog.file_mode = NativeFileDialog.FILE_MODE_OPEN_FILE
native_file_dialog.add_filter("*.png, *.jpg")
native_file_dialog.file_selected.connect(_file_selected)
add_child(native_file_dialog)
func _on_open_button_pressed(): # my signal from Button
native_file_dialog.show()
func _file_selected(path: String):
print("path: ", path)
I didn't test on Windows 10.
I realized that description is not optional.
native_file_dialog.add_filter("*.png, *.jpg") # doesn't work
native_file_dialog.add_filter("*.png, *.jpg", "Images (*.png, *.jpg)") # work