diff options
| author | Juan Linietsky | 2016-08-08 01:21:22 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-08-08 01:21:22 -0300 |
| commit | 9865650b43c2a924f5e3ed4ffdaac56c87328756 (patch) | |
| tree | f32bb974d4ea39076d830f07ad163da8cae42b68 /modules/gdscript/gd_script.cpp | |
| parent | cfbdeeffec74f9c8c8d7ddac9b31eb32c85ddf89 (diff) | |
| download | godot-9865650b43c2a924f5e3ed4ffdaac56c87328756.tar.gz godot-9865650b43c2a924f5e3ed4ffdaac56c87328756.tar.zst godot-9865650b43c2a924f5e3ed4ffdaac56c87328756.zip | |
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 'modules/gdscript/gd_script.cpp')
| -rw-r--r-- | modules/gdscript/gd_script.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index cc46d91a2..2f5c7956d 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -262,10 +262,37 @@ void GDScript::get_method_list(List<MethodInfo> *p_list) const { mi.arguments.push_back(arg); } - mi.return_val.name="var"; + mi.return_val.name="Variant"; p_list->push_back(mi); } } + +bool GDScript::has_method(const StringName& p_method) const { + + return member_functions.has(p_method); +} + +MethodInfo GDScript::get_method_info(const StringName& p_method) const { + + const Map<StringName,GDFunction*>::Element *E=member_functions.find(p_method); + if (!E) + return MethodInfo(); + + MethodInfo mi; + mi.name=E->key(); + for(int i=0;i<E->get()->get_argument_count();i++) { + PropertyInfo arg; + arg.type=Variant::NIL; //variant + arg.name=E->get()->get_argument_name(i); + mi.arguments.push_back(arg); + } + + mi.return_val.name="Variant"; + return mi; + +} + + bool GDScript::get_property_default_value(const StringName& p_property, Variant &r_value) const { #ifdef TOOLS_ENABLED @@ -1239,6 +1266,8 @@ void GDInstance::call_multilevel_reversed(const StringName& p_method,const Varia } } + + void GDInstance::notification(int p_notification) { //notification is not virutal, it gets called at ALL levels just like in C. |
