]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Editor/Events/Fields/dictionary_part.gd
Initial Godot project with Dialogic 2.0-Alpha-17
[wolf-seeking-sheep.git] / addons / dialogic / Editor / Events / Fields / dictionary_part.gd
1 @tool
2 extends PanelContainer
3
4 ## Event block field part for the Dictionary field.
5
6 signal value_changed()
7
8
9 func set_key(value:String) -> void:
10         %Key.text = str(value)
11
12
13 func get_key() -> String:
14         return %Key.text
15
16
17 func set_value(value:Variant) -> void:
18         %FlexValue.set_value(value)
19
20
21 func get_value() -> Variant:
22         return %FlexValue.current_value
23
24
25 func _ready() -> void:
26         %Delete.icon = get_theme_icon("Remove", "EditorIcons")
27
28
29 func focus_key() -> void:
30         %Key.grab_focus()
31
32
33 func _on_key_text_changed(new_text: String) -> void:
34         value_changed.emit()
35
36
37 func _on_flex_value_value_changed() -> void:
38         value_changed.emit()
39
40
41 func _on_delete_pressed() -> void:
42         queue_free()
43         value_changed.emit()
44