summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-23 19:15:23 +0200
committerGitHub <noreply@github.com>2019-10-23 19:15:23 +0200
commit9008cc486e28553ff8ea07639245efedcf545be2 (patch)
tree811b341d3f427e65ff3291aaca6c0ec8d0e091a1 /editor
parent2d6cf9cc5650318be486f6a7b1f8ad5c74122419 (diff)
parent94a50839feb8d3702eddfae6226b1b82baa34650 (diff)
Merge pull request #33014 from nekomatata/remote-load-sub-resource
Fixed variables with built-in resource in remote inspector
Diffstat (limited to 'editor')
-rw-r--r--editor/script_editor_debugger.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 89d275a90b..ccee38422c 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -597,7 +597,19 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
if (var.is_zero()) {
var = RES();
} else if (var.get_type() == Variant::STRING) {
- var = ResourceLoader::load(var);
+ String path = var;
+ if (path.find("::") != -1) {
+ // built-in resource
+ String base_path = path.get_slice("::", 0);
+ if (ResourceLoader::get_resource_type(base_path) == "PackedScene") {
+ if (!EditorNode::get_singleton()->is_scene_open(base_path)) {
+ EditorNode::get_singleton()->load_scene(base_path);
+ }
+ } else {
+ EditorNode::get_singleton()->load_resource(base_path);
+ }
+ }
+ var = ResourceLoader::load(path);
if (pinfo.hint_string == "Script")
debugObj->set_script(var);