oh-my-git/file_browser_item.gd
2020-10-23 13:07:16 +02:00

19 lines
435 B
GDScript

extends Control
signal clicked(what)
export var label: String setget _set_label
onready var label_node = $VBoxContainer/Label
func _ready():
_set_label(label)
func _set_label(new_label):
label = new_label
if label_node:
label_node.text = helpers.abbreviate(new_label, 30)
func _gui_input(event):
if event is InputEventMouseButton and event.is_pressed() and event.button_index == BUTTON_LEFT:
emit_signal("clicked", self)