You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add grouping annotations for class properties in GDScript
This commit is contained in:
@@ -2452,6 +2452,25 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar
|
||||
}
|
||||
#endif
|
||||
} break;
|
||||
|
||||
case GDScriptParser::ClassNode::Member::GROUP: {
|
||||
const GDScriptParser::AnnotationNode *annotation = member.annotation;
|
||||
StringName name = 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.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);
|
||||
} break;
|
||||
|
||||
default:
|
||||
break; // Nothing to do here.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user