mirror of
https://github.com/godotengine/regression-test-project.git
synced 2026-01-06 02:10:13 +03:00
Merge pull request #71 from godotengine/vector4
Add support for testing Vector4 arguments
This commit is contained in:
@@ -299,6 +299,8 @@ func check_if_is_allowed(method_data: Dictionary) -> bool:
|
||||
|| t == TYPE_VECTOR3
|
||||
|| t == TYPE_VECTOR3I
|
||||
|| t == TYPE_PACKED_VECTOR3_ARRAY
|
||||
|| t == TYPE_VECTOR4
|
||||
|| t == TYPE_VECTOR4I
|
||||
):
|
||||
print("----------------------------------------------------------- TODO - MISSING TYPE, ADD SUPPORT IT") # Add assert here to get info which type is missing
|
||||
return false
|
||||
|
||||
@@ -77,6 +77,10 @@ func parse_and_return_objects(method_data: Dictionary, name_of_class: String, de
|
||||
arguments_array.push_back(PackedVector3Array([]))
|
||||
elif type == TYPE_CALLABLE:
|
||||
arguments_array.push_back(Callable(BoxMesh.new(), "Rar"))
|
||||
elif type == TYPE_VECTOR4:
|
||||
arguments_array.push_back(ValueCreator.get_vector4())
|
||||
elif type == TYPE_VECTOR4I:
|
||||
arguments_array.push_back(ValueCreator.get_vector4i())
|
||||
else:
|
||||
assert(false) # Missed some types, add it
|
||||
|
||||
@@ -297,6 +301,26 @@ func return_gdscript_code_which_run_this_object(data) -> String:
|
||||
return_string += ", "
|
||||
return_string += return_gdscript_code_which_run_this_object(data.z)
|
||||
return_string += ")"
|
||||
elif type == TYPE_VECTOR4:
|
||||
return_string = "Vector4("
|
||||
return_string += return_gdscript_code_which_run_this_object(data.x)
|
||||
return_string += ", "
|
||||
return_string += return_gdscript_code_which_run_this_object(data.y)
|
||||
return_string += ", "
|
||||
return_string += return_gdscript_code_which_run_this_object(data.z)
|
||||
return_string += ", "
|
||||
return_string += return_gdscript_code_which_run_this_object(data.w)
|
||||
return_string += ")"
|
||||
elif type == TYPE_VECTOR4I:
|
||||
return_string = "Vector4i("
|
||||
return_string += return_gdscript_code_which_run_this_object(data.x)
|
||||
return_string += ", "
|
||||
return_string += return_gdscript_code_which_run_this_object(data.y)
|
||||
return_string += ", "
|
||||
return_string += return_gdscript_code_which_run_this_object(data.z)
|
||||
return_string += ", "
|
||||
return_string += return_gdscript_code_which_run_this_object(data.w)
|
||||
return_string += ")"
|
||||
elif type == TYPE_STRING_NAME:
|
||||
return_string = "StringName("
|
||||
return_string += return_gdscript_code_which_run_this_object(str(data))
|
||||
|
||||
@@ -49,6 +49,12 @@ func get_vector3() -> Vector3:
|
||||
func get_vector3i() -> Vector3i:
|
||||
return Vector3i(get_int(), get_int(), get_int())
|
||||
|
||||
func get_vector4() -> Vector4:
|
||||
return Vector4(get_float(), get_float(), get_float(), get_float())
|
||||
|
||||
|
||||
func get_vector4i() -> Vector4i:
|
||||
return Vector4i(get_int(), get_int(), get_int(), get_int())
|
||||
|
||||
func get_aabb() -> AABB:
|
||||
return AABB(get_vector3(), get_vector3())
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
[node name="Start" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( "1" )
|
||||
script = ExtResource("1")
|
||||
|
||||
@@ -11,8 +11,8 @@ config_version=5
|
||||
[application]
|
||||
|
||||
run/main_scene="res://Start.tscn"
|
||||
config/icon="res://icon.png"
|
||||
config/features=PackedStringArray("4.0")
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user