aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorJuan Linietsky2016-08-02 19:11:05 -0300
committerJuan Linietsky2016-08-02 19:11:05 -0300
commitad313097ebcb2a0c02c956fdf74a6610c3f7c9a8 (patch)
tree2c02ecaaa80bfdcf01e4061f27b808e748cdc580 /modules/gdscript
parent221cb58382ae34d4f91d9923fd979a328feabace (diff)
downloadgodot-ad313097ebcb2a0c02c956fdf74a6610c3f7c9a8.tar.gz
godot-ad313097ebcb2a0c02c956fdf74a6610c3f7c9a8.tar.zst
godot-ad313097ebcb2a0c02c956fdf74a6610c3f7c9a8.zip
WIP visual scripting, not working yet but you can check out stuff
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_script.cpp17
-rw-r--r--modules/gdscript/gd_script.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index d1946e2a6..cc46d91a2 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -249,6 +249,23 @@ void GDScript::_update_placeholder(PlaceHolderScriptInstance *p_placeholder) {
}*/
#endif
+
+void GDScript::get_method_list(List<MethodInfo> *p_list) const {
+
+ for (const Map<StringName,GDFunction*>::Element *E=member_functions.front();E;E=E->next()) {
+ 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="var";
+ p_list->push_back(mi);
+ }
+}
bool GDScript::get_property_default_value(const StringName& p_property, Variant &r_value) const {
#ifdef TOOLS_ENABLED
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index f0b6b7103..41c5c32e4 100644
--- a/modules/gdscript/gd_script.h
+++ b/modules/gdscript/gd_script.h
@@ -181,6 +181,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 ScriptLanguage *get_language() const;
GDScript();