summaryrefslogtreecommitdiff
path: root/editor/script_editor_debugger.cpp
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-10-28 18:18:43 +0100
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-10-28 18:32:00 +0100
commit3a26a0eaa76e5da6c27187dfe42d815276c58f94 (patch)
treed1581f5d7895d09a006c71a19ac932c2e6de5dd8 /editor/script_editor_debugger.cpp
parent7d710a745e3eecbde482349fff78f0a4e14f6371 (diff)
Fixed remote inspector for tool scripts
Fixes #29506
Diffstat (limited to 'editor/script_editor_debugger.cpp')
-rw-r--r--editor/script_editor_debugger.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index ccee38422c..c1899b2bde 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -611,8 +611,16 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
}
var = ResourceLoader::load(path);
- if (pinfo.hint_string == "Script")
- debugObj->set_script(var);
+ if (pinfo.hint_string == "Script") {
+ if (debugObj->get_script() != var) {
+ debugObj->set_script(RefPtr());
+ Ref<Script> script(var);
+ if (!script.is_null()) {
+ ScriptInstance *script_instance = script->placeholder_instance_create(debugObj);
+ debugObj->set_script_and_instance(var, script_instance);
+ }
+ }
+ }
} else if (var.get_type() == Variant::OBJECT) {
if (((Object *)var)->is_class("EncodedObjectAsID")) {
var = Object::cast_to<EncodedObjectAsID>(var)->get_object_id();