Skip to content

Commit 7ac2a2b

Browse files
authored
Merge pull request #287 from DoomTas3r/type-in-tooltip
Include type in tooltip
2 parents 0d90c15 + a66846a commit 7ac2a2b

File tree

1 file changed

+7
-1
lines changed
  • addons/block_code/ui/blocks/block

1 file changed

+7
-1
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ func _to_string():
214214

215215

216216
func _get_tooltip(at_position: Vector2) -> String:
217-
return definition.description if definition else ""
217+
if not definition:
218+
return ""
219+
220+
if definition.variant_type == Variant.Type.TYPE_NIL:
221+
return definition.description
222+
223+
return "{description}\n\nType: [b]{type}[/b]".format({"description": definition.description, "type": type_string(definition.variant_type)})
218224

219225

220226
func _make_custom_tooltip(for_text) -> Control:

0 commit comments

Comments
 (0)