diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-11-17 14:56:54 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-17 14:56:54 -0300 |
commit | f810d369debfdf95cce7f41c48505137d8e53385 (patch) | |
tree | f519e15a419649e113f1166963f888fd71f340cd | |
parent | 64caa4733caa459f2dc2eb6eecf88053fa6a484b (diff) | |
parent | e90cfa6f821dfcc86184f86b0b6f2adb827dd768 (diff) |
Merge pull request #12987 from vnen/plugin-resource-save
Make resources edited by plugins be sent as reference
-rw-r--r-- | editor/editor_plugin.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 0bd677ca1b..d0655d7ef1 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -455,7 +455,11 @@ void EditorPlugin::make_visible(bool p_visible) { void EditorPlugin::edit(Object *p_object) { if (get_script_instance() && get_script_instance()->has_method("edit")) { - get_script_instance()->call("edit", p_object); + if (p_object->is_class("Resource")) { + get_script_instance()->call("edit", Ref<Resource>(Object::cast_to<Resource>(p_object))); + } else { + get_script_instance()->call("edit", p_object); + } } } |