mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 21:51:22 +00:00 
			
		
		
		
	GDScript: Add abstract methods
Co-authored-by: ryanabx <ryanbrue@hotmail.com>
This commit is contained in:
		
							parent
							
								
									8f87e60307
								
							
						
					
					
						commit
						a7cf2069d5
					
				
					 27 changed files with 399 additions and 94 deletions
				
			
		|  | @ -2254,6 +2254,7 @@ GDScriptFunction *GDScriptCompiler::_parse_function(Error &r_error, GDScript *p_ | |||
| 	codegen.function_node = p_func; | ||||
| 
 | ||||
| 	StringName func_name; | ||||
| 	bool is_abstract = false; | ||||
| 	bool is_static = false; | ||||
| 	Variant rpc_config; | ||||
| 	GDScriptDataType return_type; | ||||
|  | @ -2267,6 +2268,7 @@ GDScriptFunction *GDScriptCompiler::_parse_function(Error &r_error, GDScript *p_ | |||
| 		} else { | ||||
| 			func_name = "<anonymous lambda>"; | ||||
| 		} | ||||
| 		is_abstract = p_func->is_abstract; | ||||
| 		is_static = p_func->is_static; | ||||
| 		rpc_config = p_func->rpc_config; | ||||
| 		return_type = _gdtype_from_datatype(p_func->get_datatype(), p_script); | ||||
|  | @ -2283,6 +2285,9 @@ GDScriptFunction *GDScriptCompiler::_parse_function(Error &r_error, GDScript *p_ | |||
| 	codegen.function_name = func_name; | ||||
| 	method_info.name = func_name; | ||||
| 	codegen.is_static = is_static; | ||||
| 	if (is_abstract) { | ||||
| 		method_info.flags |= METHOD_FLAG_VIRTUAL_REQUIRED; | ||||
| 	} | ||||
| 	if (is_static) { | ||||
| 		method_info.flags |= METHOD_FLAG_STATIC; | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Danil Alexeev
						Danil Alexeev