From d39e79e7ec8e010c251d9df3ece7cb7675a2c7a5 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 31 Aug 2017 18:57:03 -0300 Subject: Fix issues regarding reload of resources in imported scenes. Closes #10017 --- scene/resources/scene_format_text.cpp | 5 +++-- scene/resources/scene_format_text.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'scene/resources') 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 ResourceFormatLoaderText::load_interactive(const String &p_path, Error *r_error) { +Ref 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 ResourceFormatLoaderText::load_interactive(const } Ref 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 load_interactive(const String &p_path, Error *r_error = NULL); + virtual Ref 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 *p_extensions) const; virtual void get_recognized_extensions(List *p_extensions) const; virtual bool handles_type(const String &p_type) const; -- cgit v1.2.3