diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-12-12 17:36:52 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-12-12 17:36:52 -0300 |
commit | 97fe073f33e7efa417e424e6f146435596ee9864 (patch) | |
tree | ca0942a0c2eab379950cfa2db2d14203eb6d67f7 /tools/editor | |
parent | 6316f8941c5371ecb861041c23c2ae04abf236d5 (diff) | |
parent | 1138103c6374bee84680bfe85ff794191365e33a (diff) |
Merge pull request #2933 from TheHX/pr-shader-loader
Fix shader loading, making possible load .shd and .sgp from editor
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/property_editor.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 0a06d78255..9fb623022b 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -89,13 +89,23 @@ void CustomPropertyEditor::_menu_option(int p_which) { case OBJ_MENU_LOAD: { file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - List<String> extensions; String type=(hint==PROPERTY_HINT_RESOURCE_TYPE)?hint_text:String(); - ResourceLoader::get_recognized_extensions_for_type(type,&extensions); - file->clear_filters(); + List<String> extensions; + for (int i=0;i<type.get_slice_count(",");i++) { + + ResourceLoader::get_recognized_extensions_for_type(type.get_slice(",",i),&extensions); + } + + Set<String> valid_extensions; for (List<String>::Element *E=extensions.front();E;E=E->next()) { + valid_extensions.insert(E->get()); + } + + file->clear_filters(); + for (Set<String>::Element *E=valid_extensions.front();E;E=E->next()) { + file->add_filter("*."+E->get()+" ; "+E->get().to_upper() ); } |