]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Editor/Events/Fields/field_text_singleline.gd
Updated export config options
[wolf-seeking-sheep.git] / addons / dialogic / Editor / Events / Fields / field_text_singleline.gd
1 @tool
2 extends DialogicVisualEditorField
3
4 ## Event block field for a single line of text.
5
6
7 var placeholder := "":
8         set(value):
9                 placeholder = value
10                 self.placeholder_text = placeholder
11
12
13 #region MAIN METHODS
14 ################################################################################
15
16 func _ready() -> void:
17         self.text_changed.connect(_on_text_changed)
18
19
20 func _load_display_info(info:Dictionary) -> void:
21         self.placeholder = info.get('placeholder', '')
22
23
24 func _set_value(value:Variant) -> void:
25         self.text = str(value)
26
27
28 func _autofocus() -> void:
29         grab_focus()
30
31 #endregion
32
33
34 #region SIGNAL METHODS
35 ################################################################################
36
37 func _on_text_changed(value := "") -> void:
38         value_changed.emit(property_name, self.text)
39
40 #endregion