Skip to content

Commit

Permalink
Uses built-in function instead
Browse files Browse the repository at this point in the history
  • Loading branch information
DoomTas3r authored Oct 23, 2024
1 parent 6efc3c5 commit 02c92f3
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions addons/block_code/ui/blocks/block/block.gd
Original file line number Diff line number Diff line change
Expand Up @@ -214,39 +214,10 @@ func _to_string():


func _get_tooltip(at_position: Vector2) -> String:
var variant_as_string: String

if definition:
if definition.variant_type == Variant.Type.TYPE_NIL:
return definition.description
elif definition.variant_type == Variant.Type.TYPE_BOOL:
variant_as_string = "Boolean"
elif definition.variant_type == Variant.Type.TYPE_INT:
variant_as_string = "Integer"
elif definition.variant_type == Variant.Type.TYPE_FLOAT:
variant_as_string = "Float"
elif definition.variant_type == Variant.Type.TYPE_STRING:
variant_as_string = "String"
elif definition.variant_type == Variant.Type.TYPE_VECTOR2:
variant_as_string = "Vector2"
elif definition.variant_type == Variant.Type.TYPE_COLOR:
variant_as_string = "Color"
elif definition.variant_type == Variant.Type.TYPE_NODE_PATH:
variant_as_string = "NodePath"
elif definition.variant_type == Variant.Type.TYPE_OBJECT:
variant_as_string = "Object"
elif definition.variant_type == Variant.Type.TYPE_CALLABLE:
variant_as_string = "Callable"
elif definition.variant_type == Variant.Type.TYPE_SIGNAL:
variant_as_string = "Signal"
elif definition.variant_type == Variant.Type.TYPE_DICTIONARY:
variant_as_string = "Dictionary"
elif definition.variant_type == Variant.Type.TYPE_ARRAY:
variant_as_string = "Array"
else:
variant_as_string = "Undefined"

return definition.description + "\n\nType: [b]" + variant_as_string + "[/b]"
return definition.description + "\n\nType: [b]" + type_string(definition.variant_type) + "[/b]"
return ""


Expand Down

0 comments on commit 02c92f3

Please sign in to comment.