MCPcopy Create free account
hub / github.com/98teg/NativeDialogs / _process

Method _process

src/native_file_dialog.cpp:69–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void NativeFileDialog::_process(float delta) {
70 if (open_file && open_file->ready(0)) {
71 PackedStringArray result = PackedStringArray();
72 for (int i = 0; i < open_file->result().size(); i++) {
73 result.append(get_godot_path(open_file->result()[i]));
74 }
75
76 if (!result.is_empty()) {
77 if (mode == FILE_MODE_OPEN_FILE && result.size() == 1) {
78 emit_signal("file_selected", result[0]);
79 } else {
80 emit_signal("files_selected", result);
81 }
82 } else {
83 emit_signal("canceled");
84 }
85
86 hide();
87 } else if (save_file && save_file->ready(0)) {
88 String result = get_godot_path(save_file->result());
89
90 if (!result.is_empty()) {
91 emit_signal("file_selected", result);
92 } else {
93 emit_signal("canceled");
94 }
95
96 hide();
97 } else if (select_folder && select_folder->ready(0)) {
98 String result = get_godot_path(select_folder->result());
99
100 if (!result.is_empty()) {
101 emit_signal("dir_selected", get_godot_path(select_folder->result()));
102 } else {
103 emit_signal("canceled");
104 }
105
106 hide();
107 }
108}
109
110void NativeFileDialog::_exit_tree() {
111 hide();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected