mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	C# Array<String> Export Support Enum(String)
This commit is contained in:
		
							parent
							
								
									ddfaf20f62
								
							
						
					
					
						commit
						58e742e2c0
					
				
					 1 changed files with 16 additions and 4 deletions
				
			
		|  | @ -2650,12 +2650,24 @@ int CSharpScript::_try_get_member_export_hint(IMonoClassMember *p_member, Manage | ||||||
| 
 | 
 | ||||||
| 		ERR_FAIL_COND_V_MSG(elem_variant_type == Variant::NIL, -1, "Unknown array element type."); | 		ERR_FAIL_COND_V_MSG(elem_variant_type == Variant::NIL, -1, "Unknown array element type."); | ||||||
| 
 | 
 | ||||||
| 		int hint_res = _try_get_member_export_hint(p_member, elem_type, elem_variant_type, /* allow_generics: */ false, elem_hint, elem_hint_string); | 		bool preset_hint = false; | ||||||
|  | 		if (elem_variant_type == Variant::STRING) { | ||||||
|  | 			MonoObject *attr = p_member->get_attribute(CACHED_CLASS(ExportAttribute)); | ||||||
|  | 			if (PropertyHint(CACHED_FIELD(ExportAttribute, hint)->get_int_value(attr)) == PROPERTY_HINT_ENUM) { | ||||||
|  | 				r_hint_string = itos(elem_variant_type) + "/" + itos(PROPERTY_HINT_ENUM) + ":" + CACHED_FIELD(ExportAttribute, hintString)->get_string_value(attr); | ||||||
|  | 				preset_hint = true; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 
 | 
 | ||||||
| 		ERR_FAIL_COND_V_MSG(hint_res == -1, -1, "Error while trying to determine information about the array element type."); | 		if (!preset_hint) { | ||||||
|  | 			int hint_res = _try_get_member_export_hint(p_member, elem_type, elem_variant_type, /* allow_generics: */ false, elem_hint, elem_hint_string); | ||||||
|  | 
 | ||||||
|  | 			ERR_FAIL_COND_V_MSG(hint_res == -1, -1, "Error while trying to determine information about the array element type."); | ||||||
|  | 
 | ||||||
|  | 			// Format: type/hint:hint_string
 | ||||||
|  | 			r_hint_string = itos(elem_variant_type) + "/" + itos(elem_hint) + ":" + elem_hint_string; | ||||||
|  | 		} | ||||||
| 
 | 
 | ||||||
| 		// Format: type/hint:hint_string
 |  | ||||||
| 		r_hint_string = itos(elem_variant_type) + "/" + itos(elem_hint) + ":" + elem_hint_string; |  | ||||||
| 		r_hint = PROPERTY_HINT_TYPE_STRING; | 		r_hint = PROPERTY_HINT_TYPE_STRING; | ||||||
| 
 | 
 | ||||||
| 	} else if (p_allow_generics && p_variant_type == Variant::DICTIONARY) { | 	} else if (p_allow_generics && p_variant_type == Variant::DICTIONARY) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Magian
						Magian