summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-08-08 01:21:22 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-08-08 01:21:22 -0300
commit9865650b43c2a924f5e3ed4ffdaac56c87328756 (patch)
treef32bb974d4ea39076d830f07ad163da8cae42b68 /tools
parentcfbdeeffec74f9c8c8d7ddac9b31eb32c85ddf89 (diff)
Added a simpler way to do sub-functions in both visual and gdscript with the subcall node.
With this, visual script is almost done (missing registering custom nodes from addon). All this is probably pretty broken, too and needs a lot of testing.
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/property_editor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index f66cdd7cae..0518018e5a 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -211,6 +211,10 @@ void CustomPropertyEditor::_menu_option(int p_which) {
ERR_BREAK( !obj );
Resource *res=obj->cast_to<Resource>();
ERR_BREAK( !res );
+ if (owner && hint==PROPERTY_HINT_RESOURCE_TYPE && hint_text=="Script") {
+ //make visual script the right type
+ res->call("set_instance_base_type",owner->get_type());
+ }
v=Ref<Resource>(res).get_ref_ptr();
emit_signal("variant_changed");