mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-13 19:04:54 +01:00
19 lines
435 B
GDScript
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)
|