]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Modules/Text/node_name_label.gd
Initial Godot project with Dialogic 2.0-Alpha-17
[wolf-seeking-sheep.git] / addons / dialogic / Modules / Text / node_name_label.gd
1 @icon("node_name_label_icon.svg")
2 extends Label
3
4 class_name DialogicNode_NameLabel
5
6 # If true, the label will be hidden if no character speaks.
7 @export var hide_when_empty := true
8 @export var name_label_root: Node = self
9 @export var use_character_color := true
10
11 func _ready() -> void:
12         add_to_group('dialogic_name_label')
13         if hide_when_empty:
14                 name_label_root.visible = false
15         text = ""
16
17
18 func _set(property, what):
19         if property == 'text' and typeof(what) == TYPE_STRING:
20                 text = what
21                 if hide_when_empty:
22                         name_label_root.visible = !what.is_empty()
23                 else:
24                         name_label_root.show()
25                 return true