Proper function/property selection in visual script editing for property.

This one has an ordered list, built-in description, search, etc.
This commit is contained in:
Juan Linietsky 2016-08-23 19:29:07 -03:00
parent 965fcf5996
commit ad8f208bdb
17 changed files with 949 additions and 676 deletions

View file

@ -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);