From 9865650b43c2a924f5e3ed4ffdaac56c87328756 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 8 Aug 2016 01:21:22 -0300 Subject: 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. --- tools/editor/property_editor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools') 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(); 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(res).get_ref_ptr(); emit_signal("variant_changed"); -- cgit v1.2.3