diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-08-23 19:29:07 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-08-23 19:29:07 -0300 |
commit | ad8f208bdbcd9d3334c4d57d2e5554dfdb3a36d0 (patch) | |
tree | 7724895bd5694ac68e121e35b7f89824e9b61906 /modules/gdscript/gd_script.cpp | |
parent | 965fcf5996c734507fe548331597097e06b69ce2 (diff) | |
download | redot-engine-ad8f208bdbcd9d3334c4d57d2e5554dfdb3a36d0.tar.gz |
Proper function/property selection in visual script editing for property.
This one has an ordered list, built-in description, search, etc.
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
-rw-r--r-- | modules/gdscript/gd_script.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 144fbe2626..13fbfb6ec0 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -267,6 +267,41 @@ void GDScript::get_script_method_list(List<MethodInfo> *p_list) const { } } +void GDScript::get_script_property_list(List<PropertyInfo> *p_list) const { + + const GDScript *sptr=this; + List<PropertyInfo> props; + + while(sptr) { + + Vector<_GDScriptMemberSort> msort; + for(Map<StringName,PropertyInfo>::Element *E=sptr->member_info.front();E;E=E->next()) { + + _GDScriptMemberSort ms; + ERR_CONTINUE(!sptr->member_indices.has(E->key())); + ms.index=sptr->member_indices[E->key()].index; + ms.name=E->key(); + msort.push_back(ms); + + } + + msort.sort(); + msort.invert(); + for(int i=0;i<msort.size();i++) { + + props.push_front(sptr->member_info[msort[i].name]); + + } + + sptr = sptr->_base; + } + + for (List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { + p_list->push_back(E->get()); + } + +} + bool GDScript::has_method(const StringName& p_method) const { return member_functions.has(p_method); |