Skip to content

Commit e0af918

Browse files
committed
Block types: Rename EXECUTE to STATEMENT
For matching the block scene name.
1 parent 2dac558 commit e0af918

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

addons/block_code/blocks_catalog.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static func setup():
1818
block_definition.category = "Lifecycle"
1919
_catalog[&"ready_block"] = block_definition
2020

21-
block_definition = BlockDefinition.new(&"print", Types.BlockType.EXECUTE)
21+
block_definition = BlockDefinition.new(&"print", Types.BlockType.STATEMENT)
2222
block_definition.label_template = "print {text: STRING}"
2323
block_definition.code_template = "print({text})"
2424
block_definition.defaults = {"text": "Hello"}

addons/block_code/simple_nodes/simple_character/simple_character.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static func get_custom_blocks() -> Array[Block]:
118118
# Movement
119119
b = CategoryFactory.BLOCKS["statement_block"].instantiate()
120120
b.block_name = "simplecharacter_move"
121-
b.block_type = Types.BlockType.EXECUTE
121+
b.block_type = Types.BlockType.STATEMENT
122122
b.block_format = "Move with {player: OPTION} buttons as {kind: OPTION}"
123123
# TODO: delta here is assumed to be the parameter name of
124124
# the _process or _physics_process method:

addons/block_code/simple_nodes/simple_scoring/simple_scoring.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ static func get_custom_blocks() -> Array[Block]:
7070
for player in _POSITIONS_FOR_PLAYER:
7171
b = CategoryFactory.BLOCKS["statement_block"].instantiate()
7272
b.block_name = "simplescoring_set_score"
73-
b.block_type = Types.BlockType.EXECUTE
73+
b.block_type = Types.BlockType.STATEMENT
7474
b.block_format = "Set player %s score to {score: INT}" % player
7575
b.statement = "score_%s = {score}" % _POSITIONS_FOR_PLAYER[player]
7676
b.category = "Info | Score"
7777
block_list.append(b)
7878

7979
b = CategoryFactory.BLOCKS["statement_block"].instantiate()
8080
b.block_name = "simplescoring_change_score"
81-
b.block_type = Types.BlockType.EXECUTE
81+
b.block_type = Types.BlockType.STATEMENT
8282
b.block_format = "Change player %s score by {score: INT}" % player
8383
b.statement = "score_%s += {score}" % _POSITIONS_FOR_PLAYER[player]
8484
b.category = "Info | Score"

addons/block_code/types/types.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extends Node
33
enum BlockType {
44
NONE,
55
ENTRY,
6-
EXECUTE,
6+
STATEMENT,
77
VALUE,
88
CONTROL,
99
}

addons/block_code/ui/blocks/block/block.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ signal modified
1919
@export var color: Color = Color(1., 1., 1.)
2020

2121
## Type of block to check if can be attached to snap point
22-
@export var block_type: Types.BlockType = Types.BlockType.EXECUTE
22+
@export var block_type: Types.BlockType = Types.BlockType.STATEMENT
2323

2424
## Category to add the block to
2525
@export var category: String

addons/block_code/ui/blocks/statement_block/statement_block.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var param_input_strings: Dictionary # Only loaded from serialized
1919
func _ready():
2020
super()
2121

22-
if block_type != Types.BlockType.EXECUTE:
22+
if block_type != Types.BlockType.STATEMENT:
2323
_background.show_top = false
2424
_background.color = color
2525

addons/block_code/ui/blocks/utilities/snap_point/snap_point.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extends MarginContainer
44

55
const Types = preload("res://addons/block_code/types/types.gd")
66

7-
@export var block_type: Types.BlockType = Types.BlockType.EXECUTE
7+
@export var block_type: Types.BlockType = Types.BlockType.STATEMENT
88

99
@export var snapped_block: Block:
1010
get:

addons/block_code/ui/picker/categories/category_factory.gd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ static func get_general_blocks() -> Array[Block]:
460460
#region Sounds
461461
b = BLOCKS["statement_block"].instantiate()
462462
b.block_name = "load_sound"
463-
b.block_type = Types.BlockType.EXECUTE
463+
b.block_type = Types.BlockType.STATEMENT
464464
b.block_format = "Load file {file_path: STRING} as sound {name: STRING}"
465465
b.statement = (
466466
"""
@@ -477,7 +477,7 @@ static func get_general_blocks() -> Array[Block]:
477477

478478
b = BLOCKS["statement_block"].instantiate()
479479
b.block_name = "play_sound"
480-
b.block_type = Types.BlockType.EXECUTE
480+
b.block_type = Types.BlockType.STATEMENT
481481
b.block_format = "Play the sound {name: STRING} with Volume dB {db: FLOAT} and Pitch Scale {pitch: FLOAT}"
482482
b.statement = (
483483
"""
@@ -495,7 +495,7 @@ static func get_general_blocks() -> Array[Block]:
495495

496496
b = BLOCKS["statement_block"].instantiate()
497497
b.block_name = "pause_continue_sound"
498-
b.block_type = Types.BlockType.EXECUTE
498+
b.block_type = Types.BlockType.STATEMENT
499499
b.block_format = "{pause: OPTION} the sound {name: STRING}"
500500
b.statement = (
501501
"""
@@ -514,7 +514,7 @@ static func get_general_blocks() -> Array[Block]:
514514

515515
b = BLOCKS["statement_block"].instantiate()
516516
b.block_name = "stop_sound"
517-
b.block_type = Types.BlockType.EXECUTE
517+
b.block_type = Types.BlockType.STATEMENT
518518
b.block_format = "Stop the sound {name: STRING}"
519519
b.statement = (
520520
"""
@@ -793,7 +793,7 @@ static func get_built_in_blocks(_class_name: String) -> Array[Block]:
793793
"CharacterBody2D":
794794
var b = BLOCKS["statement_block"].instantiate()
795795
b.block_name = "characterbody2d_move"
796-
b.block_type = Types.BlockType.EXECUTE
796+
b.block_type = Types.BlockType.STATEMENT
797797
b.block_format = "Move with keys {up: STRING} {down: STRING} {left: STRING} {right: STRING} with speed {speed: VECTOR2}"
798798
b.statement = (
799799
"var dir = Vector2()\n"
@@ -816,7 +816,7 @@ static func get_built_in_blocks(_class_name: String) -> Array[Block]:
816816

817817
b = BLOCKS["statement_block"].instantiate()
818818
b.block_name = "characterbody2d_move_and_slide"
819-
b.block_type = Types.BlockType.EXECUTE
819+
b.block_type = Types.BlockType.STATEMENT
820820
b.block_format = "Move and slide"
821821
b.statement = "move_and_slide()"
822822
b.category = "Physics | Velocity"
@@ -882,7 +882,7 @@ static func get_variable_blocks(variables: Array[VariableResource]):
882882

883883
b = BLOCKS["statement_block"].instantiate()
884884
b.block_name = "set_var_%s" % variable.var_name
885-
b.block_type = Types.BlockType.EXECUTE
885+
b.block_type = Types.BlockType.STATEMENT
886886
b.block_format = "Set %s to {value: %s}" % [variable.var_name, type_string]
887887
b.statement = "%s = {value}" % [variable.var_name]
888888
b.color = BUILTIN_PROPS["Variables"].color

addons/block_code/ui/util.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Types = preload("res://addons/block_code/types/types.gd")
66

77
const SCENE_PER_TYPE = {
88
Types.BlockType.ENTRY: preload("res://addons/block_code/ui/blocks/entry_block/entry_block.tscn"),
9-
Types.BlockType.EXECUTE: preload("res://addons/block_code/ui/blocks/statement_block/statement_block.tscn"),
9+
Types.BlockType.STATEMENT: preload("res://addons/block_code/ui/blocks/statement_block/statement_block.tscn"),
1010
}
1111

1212

0 commit comments

Comments
 (0)