diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-02-01 20:41:05 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-02-01 20:41:05 -0300 |
commit | b3aebcf6dfa72dcb4a151b7b17c52ecd0ec5d6f7 (patch) | |
tree | f04f40d4489b3b32713171a9faa39add0f5bd72e /core/io | |
parent | 2cd2ca7bbc892eccc635b1c4aea80c956c9b92dc (diff) |
CSV translation import plugin
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource_import.cpp | 13 | ||||
-rw-r--r-- | core/io/resource_import.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp index 18fd8d25e7..d0799cdbe6 100644 --- a/core/io/resource_import.cpp +++ b/core/io/resource_import.cpp @@ -109,7 +109,11 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String& p_ Set<String> found; for (Set< Ref<ResourceImporter> >::Element *E=importers.front();E;E=E->next()) { - if (!ClassDB::is_parent_class(E->get()->get_resource_type(),p_type)) + String res_type = E->get()->get_resource_type(); + if (res_type==String()) + continue; + + if (!ClassDB::is_parent_class(res_type,p_type)) continue; List<String> local_exts; @@ -138,8 +142,11 @@ bool ResourceFormatImporter::can_be_imported(const String& p_path) const { bool ResourceFormatImporter::handles_type(const String& p_type) const { for (Set< Ref<ResourceImporter> >::Element *E=importers.front();E;E=E->next()) { - print_line("handles "+p_type+" base is "+E->get()->get_resource_type()); - if (ClassDB::is_parent_class(E->get()->get_resource_type(),p_type)) + + String res_type = E->get()->get_resource_type(); + if (res_type==String()) + continue; + if (ClassDB::is_parent_class(res_type,p_type)) return true; } diff --git a/core/io/resource_import.h b/core/io/resource_import.h index d54308b6ed..939cecfbd9 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -69,7 +69,7 @@ public: virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const=0; - virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants)=0; + virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL)=0; }; |