2023-10-18 10:43:37 +00:00
|
|
|
extends RichTextLabel
|
|
|
|
|
2023-12-20 08:00:55 +00:00
|
|
|
@onready var helper_text_node = self
|
2023-10-18 10:43:37 +00:00
|
|
|
|
|
|
|
func _ready():
|
2023-12-20 08:00:55 +00:00
|
|
|
# Connect the signal that gets fired on every focus change
|
|
|
|
get_viewport().connect("gui_focus_changed", _on_focus_changed)
|
|
|
|
|
|
|
|
func _on_focus_changed(selected_element:Control) -> void:
|
|
|
|
if selected_element != null and selected_element.has_meta("description"):
|
|
|
|
helper_text_node.text = selected_element.get_meta("description")
|
2023-10-18 10:43:37 +00:00
|
|
|
else:
|
2023-12-20 08:00:55 +00:00
|
|
|
helper_text_node.text = "Hey, there's no description"
|