mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #78254 from dalexeev/gds-fix-property-group-name-conflict
GDScript: Fix conflict between property and group names
This commit is contained in:
commit
efbff1369a
4 changed files with 29 additions and 4 deletions
|
@ -2710,20 +2710,21 @@ Error GDScriptCompiler::_populate_class_members(GDScript *p_script, const GDScri
|
|||
|
||||
case GDScriptParser::ClassNode::Member::GROUP: {
|
||||
const GDScriptParser::AnnotationNode *annotation = member.annotation;
|
||||
StringName name = annotation->export_info.name;
|
||||
// Avoid name conflict. See GH-78252.
|
||||
StringName name = vformat("@group_%d_%s", p_script->members.size(), annotation->export_info.name);
|
||||
|
||||
// This is not a normal member, but we need this to keep indices in order.
|
||||
GDScript::MemberInfo minfo;
|
||||
minfo.index = p_script->member_indices.size();
|
||||
|
||||
PropertyInfo prop_info;
|
||||
prop_info.name = name;
|
||||
prop_info.name = annotation->export_info.name;
|
||||
prop_info.usage = annotation->export_info.usage;
|
||||
prop_info.hint_string = annotation->export_info.hint_string;
|
||||
|
||||
p_script->member_info[name] = prop_info;
|
||||
p_script->member_indices[name] = minfo;
|
||||
p_script->members.insert(name);
|
||||
p_script->members.insert(Variant());
|
||||
} break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue