1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

[Native File Dialog] Add support for adding custom options to the dialogs.

Add support for adding custom options (checkboxes and optionboxes) to the dialogs (both native and built-in).
This commit is contained in:
bruvzg
2023-10-13 12:37:46 +03:00
parent 74c32faa78
commit a8f521bcad
17 changed files with 1175 additions and 198 deletions

View File

@@ -532,6 +532,11 @@ Error DisplayServer::file_dialog_show(const String &p_title, const String &p_cur
return OK;
}
Error DisplayServer::file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback) {
WARN_PRINT("Native dialogs not supported by this display server.");
return OK;
}
int DisplayServer::keyboard_get_layout_count() const {
return 0;
}
@@ -804,6 +809,7 @@ void DisplayServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("dialog_input_text", "title", "description", "existing_text", "callback"), &DisplayServer::dialog_input_text);
ClassDB::bind_method(D_METHOD("file_dialog_show", "title", "current_directory", "filename", "show_hidden", "mode", "filters", "callback"), &DisplayServer::file_dialog_show);
ClassDB::bind_method(D_METHOD("file_dialog_with_options_show", "title", "current_directory", "root", "filename", "show_hidden", "mode", "filters", "options", "callback"), &DisplayServer::file_dialog_with_options_show);
ClassDB::bind_method(D_METHOD("keyboard_get_layout_count"), &DisplayServer::keyboard_get_layout_count);
ClassDB::bind_method(D_METHOD("keyboard_get_current_layout"), &DisplayServer::keyboard_get_current_layout);