mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Add grouping annotations for class properties in GDScript
This commit is contained in:
		
							parent
							
								
									b4644e2835
								
							
						
					
					
						commit
						f85bafaa11
					
				
					 8 changed files with 123 additions and 15 deletions
				
			
		|  | @ -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.
 | ||||
| 		} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yuri Sizov
						Yuri Sizov