@@ -37,6 +37,11 @@ var _drag_start: Vector2 = Vector2.INF
3737@onready var _vector2_input := % Vector2Input
3838@onready var _x_line_edit := % XLineEdit
3939@onready var _y_line_edit := % YLineEdit
40+ # Vector3
41+ @onready var _vector3_input := % Vector3Input
42+ @onready var _v3_x_line_edit := % V3XLineEdit
43+ @onready var _v3_y_line_edit := % V3YLineEdit
44+ @onready var _v3_z_line_edit := % V3ZLineEdit
4045# Bool
4146@onready var _bool_input := % BoolInput
4247@onready var _bool_input_option := % BoolInputOption
@@ -46,6 +51,9 @@ var _drag_start: Vector2 = Vector2.INF
4651 _line_edit : "" ,
4752 _x_line_edit : "" ,
4853 _y_line_edit : "" ,
54+ _v3_x_line_edit : "" ,
55+ _v3_y_line_edit : "" ,
56+ _v3_z_line_edit : "" ,
4957}
5058
5159
@@ -73,6 +81,10 @@ func set_raw_input(raw_input: Variant):
7381 # Rounding because floats are doubles by default but Vector2s have single components
7482 _x_line_edit .text = ("%.4f " % raw_input .x ).rstrip ("0" ).rstrip ("." ) if raw_input != null else ""
7583 _y_line_edit .text = ("%.4f " % raw_input .y ).rstrip ("0" ).rstrip ("." ) if raw_input != null else ""
84+ TYPE_VECTOR3 :
85+ _v3_x_line_edit .text = ("%.4f " % raw_input .x ).rstrip ("0" ).rstrip ("." ) if raw_input != null else ""
86+ _v3_y_line_edit .text = ("%.4f " % raw_input .y ).rstrip ("0" ).rstrip ("." ) if raw_input != null else ""
87+ _v3_z_line_edit .text = ("%.4f " % raw_input .z ).rstrip ("0" ).rstrip ("." ) if raw_input != null else ""
7688 TYPE_BOOL :
7789 _bool_input_option .select (1 if raw_input else 0 )
7890 TYPE_NIL :
@@ -83,6 +95,9 @@ func set_raw_input(raw_input: Variant):
8395 _last_submitted_text [_line_edit ] = _line_edit .text
8496 _last_submitted_text [_x_line_edit ] = _x_line_edit .text
8597 _last_submitted_text [_y_line_edit ] = _y_line_edit .text
98+ _last_submitted_text [_v3_x_line_edit ] = _v3_x_line_edit .text
99+ _last_submitted_text [_v3_y_line_edit ] = _v3_y_line_edit .text
100+ _last_submitted_text [_v3_z_line_edit ] = _v3_z_line_edit .text
86101
87102
88103## Gets the value, which could be one of a variety of types depending on
@@ -102,6 +117,8 @@ func get_raw_input() -> Variant:
102117 return _color_input .color
103118 TYPE_VECTOR2 :
104119 return Vector2 (float (_x_line_edit .text ), float (_y_line_edit .text ))
120+ TYPE_VECTOR3 :
121+ return Vector3 (float (_v3_x_line_edit .text ), float (_v3_y_line_edit .text ), float (_v3_z_line_edit .text ))
105122 TYPE_BOOL :
106123 return bool (_bool_input_option .selected )
107124 TYPE_INT :
@@ -203,6 +220,30 @@ func _on_y_line_edit_focus_exited():
203220 _validate_and_submit_edit_text (_y_line_edit , TYPE_FLOAT )
204221
205222
223+ func _on_v3_x_line_edit_text_submitted (_new_text ):
224+ _validate_and_submit_edit_text (_v3_x_line_edit , TYPE_FLOAT )
225+
226+
227+ func _on_v3_x_line_edit_focus_exited ():
228+ _validate_and_submit_edit_text (_v3_x_line_edit , TYPE_FLOAT )
229+
230+
231+ func _on_v3_y_line_edit_text_submitted (_new_text ):
232+ _validate_and_submit_edit_text (_v3_y_line_edit , TYPE_FLOAT )
233+
234+
235+ func _on_v3_y_line_edit_focus_exited ():
236+ _validate_and_submit_edit_text (_v3_y_line_edit , TYPE_FLOAT )
237+
238+
239+ func _on_v3_z_line_edit_text_submitted (_new_text ):
240+ _validate_and_submit_edit_text (_v3_z_line_edit , TYPE_FLOAT )
241+
242+
243+ func _on_v3_z_line_edit_focus_exited ():
244+ _validate_and_submit_edit_text (_v3_z_line_edit , TYPE_FLOAT )
245+
246+
206247func _update_visible_input ():
207248 if snap_point .has_snapped_block ():
208249 _switch_input (null )
@@ -214,6 +255,8 @@ func _update_visible_input():
214255 _switch_input (_color_input )
215256 TYPE_VECTOR2 :
216257 _switch_input (_vector2_input )
258+ TYPE_VECTOR3 :
259+ _switch_input (_vector3_input )
217260 TYPE_BOOL :
218261 _switch_input (_bool_input )
219262 _ :
0 commit comments