From a66846a9b0daff4af8e0fdcbc22073463522165a Mon Sep 17 00:00:00 2001 From: Daze Date: Wed, 23 Oct 2024 16:21:54 +0000 Subject: [PATCH] Add type to block tooltips --- addons/block_code/ui/blocks/block/block.gd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/block_code/ui/blocks/block/block.gd b/addons/block_code/ui/blocks/block/block.gd index 700c5df4..38123c5c 100644 --- a/addons/block_code/ui/blocks/block/block.gd +++ b/addons/block_code/ui/blocks/block/block.gd @@ -214,7 +214,13 @@ func _to_string(): func _get_tooltip(at_position: Vector2) -> String: - return definition.description if definition else "" + if not definition: + return "" + + if definition.variant_type == Variant.Type.TYPE_NIL: + return definition.description + + return "{description}\n\nType: [b]{type}[/b]".format({"description": definition.description, "type": type_string(definition.variant_type)}) func _make_custom_tooltip(for_text) -> Control: