Skip to content

Commit

Permalink
Merge pull request #48 from endlessm/improve-placeholder-text
Browse files Browse the repository at this point in the history
Block placeholders: improve wording
  • Loading branch information
wjt authored Jun 19, 2024
2 parents 2772a46 + 51db98f commit b129a33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions addons/block_code/ui/picker/categories/category_factory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ static func get_general_categories() -> Array[BlockCategory]:
var control_list: Array[Block] = []

b = BLOCKS["control_block"].instantiate()
b.block_formats = ["if {cond: BOOL}"]
b.statements = ["if {cond}:"]
b.block_formats = ["if {condition: BOOL}"]
b.statements = ["if {condition}:"]
control_list.append(b)

b = BLOCKS["control_block"].instantiate()
b.block_formats = ["if {cond: BOOL}", "else"]
b.statements = ["if {cond}:", "else:"]
b.block_formats = ["if {condition: BOOL}", "else"]
b.statements = ["if {condition}:", "else:"]
control_list.append(b)

b = BLOCKS["control_block"].instantiate()
b.block_formats = ["repeat {num: INT}"]
b.statements = ["for i in {num}:"]
b.block_formats = ["repeat {number: INT}"]
b.statements = ["for i in {number}:"]
control_list.append(b)

b = BLOCKS["control_block"].instantiate()
b.block_formats = ["while {bool: BOOL}"]
b.statements = ["while {bool}:"]
b.block_formats = ["while {condition: BOOL}"]
b.statements = ["while {condition}:"]
control_list.append(b)

b = BLOCKS["statement_block"].instantiate()
Expand Down Expand Up @@ -226,7 +226,7 @@ static func get_general_categories() -> Array[BlockCategory]:
b = BLOCKS["parameter_block"].instantiate()
b.variant_type = TYPE_BOOL
b.block_format = "Not {bool: BOOL}"
b.statement = "(!{bool})"
b.statement = "(not {bool})"
logic_list.append(b)

var logic_category: BlockCategory = BlockCategory.new("Logic", logic_list, Color("42b8e3"))
Expand Down
10 changes: 5 additions & 5 deletions test_game/test_game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ path_child_pairs = []
[sub_resource type="Resource" id="Resource_tu70f"]
script = ExtResource("3_dpt5n")
block_class = &"ControlBlock"
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 2], ["position", Vector2(0, 0)], ["block_formats", ["if {cond: BOOL}"]], ["statements", ["if {cond}:"]], ["param_input_strings_array", [{
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 2], ["position", Vector2(0, 0)], ["block_formats", ["if {condition: BOOL}"]], ["statements", ["if {cond}:"]], ["param_input_strings_array", [{
"cond": ""
}]]]

Expand Down Expand Up @@ -210,7 +210,7 @@ path_child_pairs = []
[sub_resource type="Resource" id="Resource_qy43j"]
script = ExtResource("3_dpt5n")
block_class = &"ControlBlock"
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {cond: BOOL}", "else"]], ["statements", ["if {cond}:", "else:"]], ["param_input_strings_array", [{
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {condition: BOOL}", "else"]], ["statements", ["if {cond}:", "else:"]], ["param_input_strings_array", [{
"cond": ""
}, {}]]]

Expand Down Expand Up @@ -332,7 +332,7 @@ path_child_pairs = []
[sub_resource type="Resource" id="Resource_cta2p"]
script = ExtResource("3_dpt5n")
block_class = &"ControlBlock"
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {cond: BOOL}"]], ["statements", ["if {cond}:"]], ["param_input_strings_array", [{
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {condition: BOOL}"]], ["statements", ["if {cond}:"]], ["param_input_strings_array", [{
"cond": ""
}]]]

Expand Down Expand Up @@ -665,7 +665,7 @@ path_child_pairs = []
[sub_resource type="Resource" id="Resource_v6sl5"]
script = ExtResource("3_dpt5n")
block_class = &"ControlBlock"
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {cond: BOOL}", "else"]], ["statements", ["if {cond}:", "else:"]], ["param_input_strings_array", [{
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {condition: BOOL}", "else"]], ["statements", ["if {cond}:", "else:"]], ["param_input_strings_array", [{
"cond": ""
}, {}]]]

Expand Down Expand Up @@ -962,7 +962,7 @@ path_child_pairs = [[NodePath("VBoxContainer/TopMarginContainer/MarginContainer/
[sub_resource type="Resource" id="Resource_kqv2n"]
script = ExtResource("3_dpt5n")
block_class = &"ControlBlock"
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {cond: BOOL}"]], ["statements", ["if {cond}:"]], ["param_input_strings_array", [{
serialized_props = [["block_name", "control_block"], ["label", "Control Block"], ["color", Color(1, 0.678431, 0.462745, 1)], ["block_type", 1], ["position", Vector2(0, 0)], ["block_formats", ["if {condition: BOOL}"]], ["statements", ["if {cond}:"]], ["param_input_strings_array", [{
"cond": ""
}]]]

Expand Down

0 comments on commit b129a33

Please sign in to comment.