From 0e1f7e9f89e74ebf4b2dec04f26ffab13c32a237 Mon Sep 17 00:00:00 2001 From: Hristo Stamenov Date: Sun, 31 Jul 2022 11:07:48 +0300 Subject: Removed faulty function update after get_property_list. The function tried to rearrange properties but that lead to problems with duplication or deleted properties. Implemented the logic that that function did inside the get_property_list both for tool scripts and non-tool scripts. --- modules/gdscript/gdscript.cpp | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'modules/gdscript') diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index d752bef14f..dc6bfbb034 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -325,16 +325,23 @@ void GDScript::_get_script_property_list(List *r_list, bool p_incl for (int i = 0; i < msort.size(); i++) { props.push_front(sptr->member_info[msort[i].name]); } + +#ifdef TOOLS_ENABLED + r_list->push_back(sptr->get_class_category()); +#endif // TOOLS_ENABLED + + for (const PropertyInfo &E : props) { + r_list->push_back(E); + } + + props.clear(); + if (!p_include_base) { break; } sptr = sptr->_base; } - - for (const PropertyInfo &E : props) { - r_list->push_back(E); - } } void GDScript::get_script_property_list(List *r_list) const { @@ -434,10 +441,6 @@ void GDScript::set_source_code(const String &p_code) { #ifdef TOOLS_ENABLED void GDScript::_update_exports_values(HashMap &values, List &propnames) { - if (base_cache.is_valid()) { - base_cache->_update_exports_values(values, propnames); - } - for (const KeyValue &E : member_default_values_cache) { values[E.key] = E.value; } @@ -445,6 +448,10 @@ void GDScript::_update_exports_values(HashMap &values, List for (const PropertyInfo &E : members_cache) { propnames.push_back(E); } + + if (base_cache.is_valid()) { + base_cache->_update_exports_values(values, propnames); + } } void GDScript::_add_doc(const DocData::ClassDoc &p_inner_class) { @@ -703,6 +710,8 @@ bool GDScript::_update_exports(bool *r_err, bool p_recursive_call, PlaceHolderSc member_default_values_cache.clear(); _signals.clear(); + members_cache.push_back(get_class_category()); + for (int i = 0; i < c->members.size(); i++) { const GDScriptParser::ClassNode::Member &member = c->members[i]; @@ -728,6 +737,9 @@ bool GDScript::_update_exports(bool *r_err, bool p_recursive_call, PlaceHolderSc } _signals[member.signal->identifier->name] = parameters_names; } break; + case GDScriptParser::ClassNode::Member::GROUP: { + members_cache.push_back(member.annotation->export_info); + } break; default: break; // Nothing. } @@ -1510,11 +1522,17 @@ void GDScriptInstance::get_property_list(List *p_properties) const props.push_front(sptr->member_info[msort[i].name]); } - sptr = sptr->_base; - } +#ifdef TOOLS_ENABLED + p_properties->push_back(sptr->get_class_category()); +#endif // TOOLS_ENABLED + + for (const PropertyInfo &prop : props) { + p_properties->push_back(prop); + } + + props.clear(); - for (const PropertyInfo &E : props) { - p_properties->push_back(E); + sptr = sptr->_base; } } -- cgit v1.2.3