From 354dde19087729fdaf6c5cd89319ae2e67a65b2f Mon Sep 17 00:00:00 2001 From: Daze Date: Fri, 20 Dec 2024 22:38:12 +0000 Subject: [PATCH] Condenses as vector2_xy and vector3_xyz blocks Condenses the existing vector2_x/y blocks and vector3_x/y/z blocks into singular blocks. This makes switching an axis easier and reduces redundancy in the block picker. --- addons/block_code/blocks/math/vector2_x.tres | 19 -------------- addons/block_code/blocks/math/vector2_xy.tres | 26 +++++++++++++++++++ addons/block_code/blocks/math/vector2_y.tres | 19 -------------- addons/block_code/blocks/math/vector3_x.tres | 19 -------------- .../block_code/blocks/math/vector3_xyz.tres | 26 +++++++++++++++++++ addons/block_code/blocks/math/vector3_y.tres | 19 -------------- addons/block_code/blocks/math/vector3_z.tres | 19 -------------- 7 files changed, 52 insertions(+), 95 deletions(-) delete mode 100644 addons/block_code/blocks/math/vector2_x.tres create mode 100644 addons/block_code/blocks/math/vector2_xy.tres delete mode 100644 addons/block_code/blocks/math/vector2_y.tres delete mode 100644 addons/block_code/blocks/math/vector3_x.tres create mode 100644 addons/block_code/blocks/math/vector3_xyz.tres delete mode 100644 addons/block_code/blocks/math/vector3_y.tres delete mode 100644 addons/block_code/blocks/math/vector3_z.tres diff --git a/addons/block_code/blocks/math/vector2_x.tres b/addons/block_code/blocks/math/vector2_x.tres deleted file mode 100644 index 7e5e3dfa..00000000 --- a/addons/block_code/blocks/math/vector2_x.tres +++ /dev/null @@ -1,19 +0,0 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://btsfimn63xhi2"] - -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_dvsrc"] - -[resource] -script = ExtResource("1_dvsrc") -name = &"vector2_x" -target_node_class = "" -description = "Gives the x of a [i]Vector2[/i]" -category = "Math" -type = 3 -variant_type = 3 -display_template = "x of {vector2: VECTOR2}" -code_template = "{vector2}.x" -defaults = { -"vector2": Vector2(0, 0) -} -signal_name = "" -scope = "" diff --git a/addons/block_code/blocks/math/vector2_xy.tres b/addons/block_code/blocks/math/vector2_xy.tres new file mode 100644 index 00000000..47fa7358 --- /dev/null +++ b/addons/block_code/blocks/math/vector2_xy.tres @@ -0,0 +1,26 @@ +[gd_resource type="Resource" load_steps=4 format=3 uid="uid://bpdjqy6oidfo4"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_p8v57"] +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="2_207xo"] + +[sub_resource type="Resource" id="Resource_ie4sg"] +script = ExtResource("1_p8v57") +selected = 0 +items = ["x", "y"] + +[resource] +script = ExtResource("2_207xo") +name = &"vector2_xy" +target_node_class = "" +description = "Gives the x or y of a [b]Vector2[/b]" +category = "Math" +type = 3 +variant_type = 3 +display_template = "{xy: NIL} of {vector2: VECTOR2}" +code_template = "{vector2}.{{xy}}" +defaults = { +"xy": SubResource("Resource_ie4sg") +} +signal_name = "" +scope = "" +is_advanced = false diff --git a/addons/block_code/blocks/math/vector2_y.tres b/addons/block_code/blocks/math/vector2_y.tres deleted file mode 100644 index 802f0b56..00000000 --- a/addons/block_code/blocks/math/vector2_y.tres +++ /dev/null @@ -1,19 +0,0 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://ccbrbp4lee3wt"] - -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_wuold"] - -[resource] -script = ExtResource("1_wuold") -name = &"vector2_y" -target_node_class = "" -description = "Gives the y of a [i]Vector2[/i]" -category = "Math" -type = 3 -variant_type = 3 -display_template = "y of {vector2: VECTOR2}" -code_template = "{vector2}.y" -defaults = { -"vector2": Vector2(0, 0) -} -signal_name = "" -scope = "" diff --git a/addons/block_code/blocks/math/vector3_x.tres b/addons/block_code/blocks/math/vector3_x.tres deleted file mode 100644 index 3a4f4c76..00000000 --- a/addons/block_code/blocks/math/vector3_x.tres +++ /dev/null @@ -1,19 +0,0 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cehtd3jqu5es2"] - -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_p3bft"] - -[resource] -script = ExtResource("1_p3bft") -name = &"vector3_x" -target_node_class = "" -description = "Gives the x of a [i]Vector3[/i]" -category = "Math" -type = 3 -variant_type = 3 -display_template = "x of {vector3: VECTOR3}" -code_template = "{vector3}.x" -defaults = { -"vector3": Vector3(0, 0, 0) -} -signal_name = "" -scope = "" diff --git a/addons/block_code/blocks/math/vector3_xyz.tres b/addons/block_code/blocks/math/vector3_xyz.tres new file mode 100644 index 00000000..a49c3a41 --- /dev/null +++ b/addons/block_code/blocks/math/vector3_xyz.tres @@ -0,0 +1,26 @@ +[gd_resource type="Resource" load_steps=4 format=3 uid="uid://s72tgtbci1ui"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_0wc0o"] +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="2_e6ohf"] + +[sub_resource type="Resource" id="Resource_ie4sg"] +script = ExtResource("1_0wc0o") +selected = 0 +items = ["x", "y", "z"] + +[resource] +script = ExtResource("2_e6ohf") +name = &"vector3_xyz" +target_node_class = "" +description = "Gives the x, y, or z of a [b]Vector3[/b]" +category = "Math" +type = 3 +variant_type = 3 +display_template = "{xyz: NIL} of {vector3: VECTOR3}" +code_template = "{vector3}.{{xyz}}" +defaults = { +"xyz": SubResource("Resource_ie4sg") +} +signal_name = "" +scope = "" +is_advanced = false diff --git a/addons/block_code/blocks/math/vector3_y.tres b/addons/block_code/blocks/math/vector3_y.tres deleted file mode 100644 index 31702319..00000000 --- a/addons/block_code/blocks/math/vector3_y.tres +++ /dev/null @@ -1,19 +0,0 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cehtd3jqu5es2"] - -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_p3bft"] - -[resource] -script = ExtResource("1_p3bft") -name = &"vector3_y" -target_node_class = "" -description = "Gives the y of a [i]Vector3[/i]" -category = "Math" -type = 3 -variant_type = 3 -display_template = "y of {vector3: VECTOR3}" -code_template = "{vector3}.y" -defaults = { -"vector3": Vector3(0, 0, 0) -} -signal_name = "" -scope = "" diff --git a/addons/block_code/blocks/math/vector3_z.tres b/addons/block_code/blocks/math/vector3_z.tres deleted file mode 100644 index b1b29b84..00000000 --- a/addons/block_code/blocks/math/vector3_z.tres +++ /dev/null @@ -1,19 +0,0 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cehtd3jqu5es2"] - -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_p3bft"] - -[resource] -script = ExtResource("1_p3bft") -name = &"vector3_z" -target_node_class = "" -description = "Gives the z of a [i]Vector3[/i]" -category = "Math" -type = 3 -variant_type = 3 -display_template = "z of {vector3: VECTOR3}" -code_template = "{vector3}.z" -defaults = { -"vector3": Vector3(0, 0, 0) -} -signal_name = "" -scope = ""