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.
This commit is contained in:
parent
cfbdeeffec
commit
9865650b43
10 changed files with 241 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -182,6 +182,8 @@ public:
|
|||
bool get_property_default_value(const StringName& p_property,Variant& r_value) const;
|
||||
|
||||
virtual void get_method_list(List<MethodInfo> *p_list) const;
|
||||
virtual bool has_method(const StringName& p_method) const;
|
||||
virtual MethodInfo get_method_info(const StringName& p_method) const;
|
||||
|
||||
virtual ScriptLanguage *get_language() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue