Skip to content

Switch block labels to natural language #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[resource]
script = ExtResource("1_5qal7")
name = &"add_node_to_group"
target_node_class = ""
description = "Add the node into the group"
category = "Communication | Groups"
type = 2
variant_type = 0
display_template = "Add {node: OBJECT} to group {group: STRING}"
display_template = "add {node: OBJECT} to group {group: STRING}"
code_template = "{node}.add_to_group({group})"
defaults = {}
signal_name = ""
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/communication/add_to_group.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Add this node into the group"
category = "Communication | Groups"
type = 2
variant_type = 0
display_template = "Add to group {group: STRING}"
display_template = "add to group {group: STRING}"
code_template = "add_to_group({group})"
defaults = {}
signal_name = ""
Expand Down
4 changes: 2 additions & 2 deletions addons/block_code/blocks/communication/area2d_on_entered.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description = ""
category = "Communication | Methods"
type = 1
variant_type = 0
display_template = "On [body: OBJECT] entered"
code_template = "func _on_body_entered(body: Node2D):
display_template = "when this node collides with [something: OBJECT]"
code_template = "func _on_body_entered(something: Node2D):
"
defaults = {}
signal_name = "body_entered"
Expand Down
4 changes: 2 additions & 2 deletions addons/block_code/blocks/communication/area2d_on_exited.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description = ""
category = "Communication | Methods"
type = 1
variant_type = 0
display_template = "On [body: OBJECT] exited"
code_template = "func _on_body_exited(body: Node2D):
display_template = "when this node stops colliding with [something: OBJECT]"
code_template = "func _on_body_exited(something: Node2D):
"
defaults = {}
signal_name = "body_exited"
Expand Down
8 changes: 5 additions & 3 deletions addons/block_code/blocks/communication/call_method_group.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
[resource]
script = ExtResource("1_mlm68")
name = &"call_method_group"
target_node_class = ""
description = "Calls the method/function on each member of the given group"
category = "Communication | Methods"
type = 2
variant_type = 0
display_template = "Call method {method_name: STRING} in group {group: STRING}"
display_template = "call method {method_name: STRING} in group {group: STRING}"
code_template = "get_tree().call_group({group}, {method_name})"
description = "Calls the method/function on each member of the given group"
category = "Communication | Methods"
defaults = {}
signal_name = ""
scope = ""
3 changes: 2 additions & 1 deletion addons/block_code/blocks/communication/call_method_node.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[resource]
script = ExtResource("1_pg363")
name = &"call_method_node"
target_node_class = ""
description = "Calls the method/function of the given node"
category = "Communication | Methods"
type = 2
variant_type = 0
display_template = "Call method {method_name: STRING} in node {node: OBJECT}"
display_template = "call method {method_name: STRING} in node {node: OBJECT}"
code_template = "{node}.call({method_name})"
defaults = {}
signal_name = ""
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/communication/define_method.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Define a method/function with following statements"
category = "Communication | Methods"
type = 1
variant_type = 0
display_template = "Define method {method_name: STRING_NAME}"
display_template = "define method {method_name: STRING_NAME}"
code_template = "func {method_name}():"
defaults = {}
signal_name = ""
Expand Down
4 changes: 3 additions & 1 deletion addons/block_code/blocks/communication/is_in_group.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
[resource]
script = ExtResource("1_tjyq5")
name = &"is_in_group"
target_node_class = ""
description = "Is this node in the group"
category = "Communication | Groups"
type = 3
variant_type = 1
display_template = "Is in group {group: STRING}"
display_template = "is in group {group: STRING}"
code_template = "is_in_group({group})"
defaults = {}
signal_name = ""
scope = ""
4 changes: 3 additions & 1 deletion addons/block_code/blocks/communication/is_node_in_group.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
[resource]
script = ExtResource("1_5krrs")
name = &"is_node_in_group"
target_node_class = ""
description = "Is the node in the group"
category = "Communication | Groups"
type = 3
variant_type = 1
display_template = "Is {node: OBJECT} in group {group: STRING}"
display_template = "{node: OBJECT} is in group {group: STRING}"
code_template = "{node}.is_in_group({group})"
defaults = {}
signal_name = ""
scope = ""
8 changes: 5 additions & 3 deletions addons/block_code/blocks/communication/remove_from_group.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
[resource]
script = ExtResource("1_cdwef")
name = &"remove_from_group"
target_node_class = ""
description = "Remove this node from the group"
category = "Communication | Groups"
type = 2
variant_type = 0
display_template = "Remove from group {group: STRING}"
display_template = "remove from group {group: STRING}"
code_template = "remove_from_group({group})"
description = "Remove this node from the group"
category = "Communication | Groups"
defaults = {}
signal_name = ""
scope = ""
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
[resource]
script = ExtResource("1_pec24")
name = &"remove_node_from_group"
target_node_class = ""
description = "Remove the node from the group"
category = "Communication | Groups"
type = 2
variant_type = 0
display_template = "Remove {node: OBJECT} from group {group: STRING}"
display_template = "remove {node: OBJECT} from group {group: STRING}"
code_template = "{node}.remove_from_group({group})"
description = "Remove the node from the group"
category = "Communication | Groups"
defaults = {}
signal_name = ""
scope = ""
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description = ""
category = "Communication | Methods"
type = 1
variant_type = 0
display_template = "On [body: OBJECT] entered"
code_template = "func _on_body_entered(body: Node2D):
display_template = "when this node collides with [something: OBJECT]"
code_template = "func _on_body_entered(something: Node2D):
"
defaults = {}
signal_name = "body_entered"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description = ""
category = "Communication | Methods"
type = 1
variant_type = 0
display_template = "On [body: OBJECT] exited"
code_template = "func _on_body_exited(body: Node2D):
display_template = "when this node stops colliding with [something: OBJECT]"
code_template = "func _on_body_exited(something: Node2D):
"
defaults = {}
signal_name = "body_exited"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Check if an animation is currently playing."
category = "Graphics | Animation"
type = 3
variant_type = 1
display_template = "Is playing"
display_template = "is playing"
code_template = "is_playing()"
defaults = {}
signal_name = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Pause the currently playing animation."
category = "Graphics | Animation"
type = 2
variant_type = 0
display_template = "Pause"
display_template = "pause"
code_template = "pause()"
defaults = {}
signal_name = ""
Expand Down
6 changes: 3 additions & 3 deletions addons/block_code/blocks/graphics/animationplayer_play.tres
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ items = []
[sub_resource type="Resource" id="Resource_vnp2w"]
script = ExtResource("1_xu43h")
selected = 0
items = ["ahead", "backwards"]
items = ["forward", "backwards"]

[resource]
script = ExtResource("1_emeuv")
Expand All @@ -22,8 +22,8 @@ description = "Play the animation."
category = "Graphics | Animation"
type = 2
variant_type = 0
display_template = "Play {animation: STRING} {direction: NIL}"
code_template = "if {direction} == \"ahead\":
display_template = "play {animation: STRING} {direction: NIL}"
code_template = "if {direction} == \"forward\":
play({animation})
else:
play_backwards({animation})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Stop the currently playing animation."
category = "Graphics | Animation"
type = 2
variant_type = 0
display_template = "Stop"
display_template = "stop"
code_template = "stop()"
defaults = {}
signal_name = ""
Expand Down
3 changes: 2 additions & 1 deletion addons/block_code/blocks/graphics/viewport_center.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[resource]
script = ExtResource("1_rc1so")
name = &"viewport_center"
target_node_class = ""
description = "Coordinates of the middle of the viewable screen when playing."
category = "Graphics | Viewport"
type = 3
variant_type = 5
display_template = "Viewport Center"
display_template = "viewport center"
code_template = "(func (): var transform: Transform2D = get_viewport_transform(); var scale: Vector2 = transform.get_scale(); return -transform.origin / scale + get_viewport_rect().size / scale / 2).call()"
defaults = {}
signal_name = ""
Expand Down
3 changes: 2 additions & 1 deletion addons/block_code/blocks/graphics/viewport_height.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[resource]
script = ExtResource("1_1debb")
name = &"viewport_height"
target_node_class = ""
description = "How tall the viewable screen is when playing."
category = "Graphics | Viewport"
type = 3
variant_type = 3
display_template = "Viewport Height"
display_template = "viewport height"
code_template = "(func (): var transform: Transform2D = get_viewport_transform(); var scale: Vector2 = transform.get_scale(); return -transform.origin.y / scale.y + get_viewport_rect().size.y / scale.y).call()"
defaults = {}
signal_name = ""
Expand Down
3 changes: 2 additions & 1 deletion addons/block_code/blocks/graphics/viewport_width.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[resource]
script = ExtResource("1_ll4rh")
name = &"viewport_width"
target_node_class = ""
description = "How wide the viewable screen is when playing."
category = "Graphics | Viewport"
type = 3
variant_type = 3
display_template = "Viewport Width"
display_template = "viewport width"
code_template = "(func (): var transform: Transform2D = get_viewport_transform(); var scale: Vector2 = transform.get_scale(); return -transform.origin.x / scale.x + get_viewport_rect().size.x / scale.x).call()"
defaults = {}
signal_name = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "True if the character is on the floor."
category = "Physics | Velocity"
type = 3
variant_type = 1
display_template = "Is on floor"
display_template = "is on floor"
code_template = "is_on_floor()"
defaults = {}
signal_name = ""
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/input/characterbody2d_move.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Move the character up, down, left, and right with the keyboard us
category = "Input"
type = 2
variant_type = 0
display_template = "Move with keys {up: STRING} {down: STRING} {left: STRING} {right: STRING} with speed {speed: VECTOR2}"
display_template = "move with keys {up: STRING} {down: STRING} {left: STRING} {right: STRING} at speed {speed: VECTOR2}"
code_template = "var dir = Vector2()
dir.x += float(Input.is_key_pressed(OS.find_keycode_from_string({right})))
dir.x -= float(Input.is_key_pressed(OS.find_keycode_from_string({left})))
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/input/is_input_actioned.tres
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description = "True if the specified input action has been pressed or released."
category = "Input"
type = 3
variant_type = 1
display_template = "Is action {action_name: STRING_NAME} {action: NIL}"
display_template = "action {action_name: STRING_NAME} is {action: NIL}"
code_template = "Input.is_action_{{action}}('{{action_name}}')"
defaults = {
"action": SubResource("Resource_ai5in")
Expand Down
16 changes: 0 additions & 16 deletions addons/block_code/blocks/lifecycle/physics_process.tres

This file was deleted.

3 changes: 2 additions & 1 deletion addons/block_code/blocks/lifecycle/process.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[resource]
script = ExtResource("1_pmina")
name = &"process"
target_node_class = ""
description = "Attached blocks will be executed during the processing step of the main loop"
category = "Lifecycle"
type = 1
variant_type = 0
display_template = "On Process"
display_template = "every frame"
code_template = "func _process(delta):"
defaults = {}
signal_name = ""
Expand Down
8 changes: 5 additions & 3 deletions addons/block_code/blocks/lifecycle/queue_free.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
[resource]
script = ExtResource("1_75fle")
name = &"queue_free"
target_node_class = ""
description = "Queues this node to be deleted at the end of the current frame"
category = "Lifecycle"
type = 2
variant_type = 0
display_template = "Queue Free"
display_template = "remove"
code_template = "queue_free()"
description = "Queues this node to be deleted at the end of the current frame"
category = "Lifecycle"
defaults = {}
signal_name = ""
scope = ""
3 changes: 2 additions & 1 deletion addons/block_code/blocks/lifecycle/ready.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[resource]
script = ExtResource("1_vk0xk")
name = &"ready"
target_node_class = ""
description = "Attached blocks will be executed once when the node is \"ready\""
category = "Lifecycle"
type = 1
variant_type = 0
display_template = "On Ready"
display_template = "when starting"
code_template = "func _ready():"
defaults = {}
signal_name = ""
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/log/breakpoint.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Pause execution and show the current line of code in the debugger
category = "Log"
type = 2
variant_type = 0
display_template = "Breakpoint"
display_template = "breakpoint"
code_template = "breakpoint"
defaults = {}
signal_name = ""
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/log/print.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Print the text to output"
category = "Log"
type = 2
variant_type = 0
display_template = "Print {text: STRING}"
display_template = "log text {text: STRING}"
code_template = "print({text})"
defaults = {
"text": "Hello"
Expand Down
8 changes: 5 additions & 3 deletions addons/block_code/blocks/logic/else.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
[resource]
script = ExtResource("1_x816c")
name = &"else"
target_node_class = ""
description = ""
category = "Logic | Conditionals"
type = 4
variant_type = 0
display_template = "Else"
display_template = "else"
code_template = "else:"
description = ""
category = "Logic | Conditionals"
defaults = {}
signal_name = ""
scope = ""
Loading