diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-31 18:57:03 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-08-31 18:57:44 -0300 |
commit | d39e79e7ec8e010c251d9df3ece7cb7675a2c7a5 (patch) | |
tree | 1348dd251d9dc6977b57b078369a2575e8805ab3 /scene | |
parent | 909c1fd120b58155e4f7b78d60b19a9f13528e07 (diff) |
Fix issues regarding reload of resources in imported scenes. Closes #10017
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/scene_format_text.cpp | 5 | ||||
-rw-r--r-- | scene/resources/scene_format_text.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index fea5c11dec..14e2ef83f8 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -891,7 +891,7 @@ String ResourceInteractiveLoaderText::recognize(FileAccess *p_f) { ///////////////////// -Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const String &p_path, Error *r_error) { +Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const String &p_path, const String &p_original_path, Error *r_error) { if (r_error) *r_error = ERR_CANT_OPEN; @@ -905,7 +905,8 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const } Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText); - ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path); + String path = p_original_path != "" ? p_original_path : p_path; + ria->local_path = ProjectSettings::get_singleton()->localize_path(path); ria->res_path = ria->local_path; //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) ); ria->open(f); diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h index 193bcf7112..a72a62037c 100644 --- a/scene/resources/scene_format_text.h +++ b/scene/resources/scene_format_text.h @@ -108,7 +108,7 @@ public: class ResourceFormatLoaderText : public ResourceFormatLoader { public: - virtual Ref<ResourceInteractiveLoader> load_interactive(const String &p_path, Error *r_error = NULL); + virtual Ref<ResourceInteractiveLoader> load_interactive(const String &p_path, const String &p_original_path = "", Error *r_error = NULL); virtual void get_recognized_extensions_for_type(const String &p_type, List<String> *p_extensions) const; virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; |