mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
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:
parent
965fcf5996
commit
ad8f208bdb
17 changed files with 949 additions and 676 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue