Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: manuq <[email protected]>
  • Loading branch information
dylanmccall and manuq authored Jun 18, 2024
1 parent 8dfa35c commit 6c2ef3a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions addons/block_code/ui/picker/categories/category_factory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static func get_general_categories() -> Array[BlockCategory]:

b = BLOCKS["parameter_block"].instantiate()
b.block_type = Types.BlockType.STRING
b.block_format = "Get String {var: STRING} from {object: NODE}"
b.statement = "{object}.VAR_DICT[{var}]"
b.block_format = "Get String {var: STRING} from {node: NODE}"
b.statement = "{node}.VAR_DICT[{var}]"
variable_list.append(b)

b = BLOCKS["statement_block"].instantiate()
Expand All @@ -182,18 +182,18 @@ static func get_general_categories() -> Array[BlockCategory]:

b = BLOCKS["parameter_block"].instantiate()
b.block_type = Types.BlockType.INT
b.block_format = "Get Int {var: INT} from {object: NODE}"
b.statement = "{object}.VAR_DICT[{var}]"
b.block_format = "Get Int {var: INT} from {node: NODE}"
b.statement = "{node}.VAR_DICT[{var}]"
variable_list.append(b)

var variable_category: BlockCategory = BlockCategory.new("Variables", variable_list, Color("4f975d"))

# Objects & Types
# Nodes & Types
var type_list: Array[Block] = []

b = BLOCKS["parameter_block"].instantiate()
b.block_type = Types.BlockType.NODE
b.block_format = "This object"
b.block_format = "This node"
b.statement = "self"
type_list.append(b)

Expand Down Expand Up @@ -229,16 +229,16 @@ static func get_general_categories() -> Array[BlockCategory]:

b = BLOCKS["parameter_block"].instantiate()
b.block_type = Types.BlockType.VARIANT
b.block_format = "Get property {key: STRING} from {object: NODE}"
b.statement = "{object}.get({key})"
b.block_format = "Get property {key: STRING} from {node: NODE}"
b.statement = "{node}.get({key})"
type_list.append(b)

b = BLOCKS["statement_block"].instantiate()
b.block_format = "Set property {key: STRING} in {object: NODE} to {value: VARIANT}"
b.statement = "{object}.set({key}, {value})"
b.block_format = "Set property {key: STRING} in {node: NODE} to {value: VARIANT}"
b.statement = "{node}.set({key}, {value})"
type_list.append(b)

var type_category: BlockCategory = BlockCategory.new("Objects & Types", type_list, Color("c12f8e"))
var type_category: BlockCategory = BlockCategory.new("Nodes & Types", type_list, Color("c12f8e"))

# Math
var math_list: Array[Block] = []
Expand Down
8 changes: 4 additions & 4 deletions test_game/test_game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ path_child_pairs = []
[sub_resource type="Resource" id="Resource_ol1n5"]
script = ExtResource("3_dpt5n")
block_class = &"ParameterBlock"
serialized_props = [["block_name", "parameter_block"], ["label", "Param"], ["color", Color(0.756863, 0.184314, 0.556863, 1)], ["block_type", 3], ["position", Vector2(0, 0)], ["block_format", "Get property {key: STRING} from {object: NODE}"], ["statement", "{object}.get({key})"], ["param_input_strings", {
serialized_props = [["block_name", "parameter_block"], ["label", "Param"], ["color", Color(0.756863, 0.184314, 0.556863, 1)], ["block_type", 3], ["position", Vector2(0, 0)], ["block_format", "Get property {key: STRING} from {node: NODE}"], ["statement", "{node}.get({key})"], ["param_input_strings", {
"key": "visible",
"object": ""
"node": ""
}]]

[sub_resource type="Resource" id="Resource_u88ch"]
Expand Down Expand Up @@ -383,8 +383,8 @@ path_child_pairs = []
[sub_resource type="Resource" id="Resource_hsjj8"]
script = ExtResource("3_dpt5n")
block_class = &"ParameterBlock"
serialized_props = [["block_name", "parameter_block"], ["label", "Param"], ["color", Color(0.309804, 0.592157, 0.364706, 1)], ["block_type", 4], ["position", Vector2(0, 0)], ["block_format", "Get String {var: STRING} from {object: NODE}"], ["statement", "{object}.VAR_DICT[{var}]"], ["param_input_strings", {
"object": "",
serialized_props = [["block_name", "parameter_block"], ["label", "Param"], ["color", Color(0.309804, 0.592157, 0.364706, 1)], ["block_type", 4], ["position", Vector2(0, 0)], ["block_format", "Get String {var: STRING} from {node: NODE}"], ["statement", "{node}.VAR_DICT[{var}]"], ["param_input_strings", {
"node": "",
"var": "hat"
}]]

Expand Down

0 comments on commit 6c2ef3a

Please sign in to comment.