]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Editor/Events/Fields/field_vector2.gd
Squashed commit of the following:
[wolf-seeking-sheep.git] / addons / dialogic / Editor / Events / Fields / field_vector2.gd
1 @tool
2 extends DialogicVisualEditorFieldVector
3 ## Event block field for a Vector2.
4
5 var current_value := Vector2()
6
7
8 func _set_value(value: Variant) -> void:
9         current_value = value
10         super(value)
11
12
13 func get_value() -> Vector2:
14         return current_value
15
16
17 func _on_sub_value_changed(sub_component: String, value: float) -> void:
18         match sub_component:
19                 'X': current_value.x = value
20                 'Y': current_value.y = value
21         _on_value_changed(current_value)
22
23
24 func _update_sub_component_text(value: Variant) -> void:
25         $X._on_value_text_submitted(str(value.x), true)
26         $Y._on_value_text_submitted(str(value.y), true)