summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorFranklin Sobrinho <franklin_gs@hotmail.com>2015-11-27 21:11:20 -0300
committerFranklin Sobrinho <franklin_gs@hotmail.com>2015-11-27 21:11:20 -0300
commit1138103c6374bee84680bfe85ff794191365e33a (patch)
treee503f811cd9b2464a6090e227cd4c5f2cc25a757 /tools
parented4738fbed6d08e85bbf2b60b9dcad64bd4c8753 (diff)
Fix shader loading, making possible load .shd and .sgp from editor
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/property_editor.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 0fe3dee2ea..4ed3f3cbe0 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() );
}