Skip to content

Commit b1aa499

Browse files
authored
Merge pull request #134 from endlessm/block-add-to-string
Add _to_string for Block
2 parents 2bbe016 + 446ee74 commit b1aa499

File tree

1 file changed

+4
-0
lines changed
  • addons/block_code/ui/blocks/block

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ func get_serialized_props() -> Array:
6969
return serialize_props(["block_name", "label", "color", "block_type", "position", "scope"])
7070

7171

72+
func _to_string():
73+
return "<{block_class}:{block_name}#{rid}>".format({"block_name": block_name, "block_class": get_block_class(), "rid": get_instance_id()})
74+
75+
7276
func serialize_props(prop_names: Array) -> Array:
7377
var pairs := []
7478
for p in prop_names:

0 commit comments

Comments
 (0)