@@ -14,40 +14,12 @@ extends DialogicEvent
1414## If true the wait can be skipped with user input
1515@export var skippable := false
1616
17- var _tween : Tween
18-
1917
2018#region EXECUTE
2119## ##############################################################################
2220
2321func _execute () -> void :
24- var final_wait_time := time
25-
26- if dialogic .Inputs .auto_skip .enabled :
27- var time_per_event : float = dialogic .Inputs .auto_skip .time_per_event
28- final_wait_time = min (time , time_per_event )
29-
30- dialogic .current_state = dialogic .States .WAITING
31-
32- if hide_text and dialogic .has_subsystem ("Text" ):
33- dialogic .Text .update_dialog_text ('' , true )
34- dialogic .Text .hide_textbox ()
35-
36- _tween = dialogic .get_tree ().create_tween ()
37- if DialogicUtil .is_physics_timer ():
38- _tween .set_process_mode (Tween .TWEEN_PROCESS_PHYSICS )
39- _tween .tween_callback (_on_finish ).set_delay (final_wait_time )
40-
41- if skippable :
42- dialogic .Inputs .dialogic_action .connect (_on_finish )
43-
44-
45- func _on_finish () -> void :
46- if is_instance_valid (_tween ):
47- _tween .kill ()
48-
49- if skippable :
50- dialogic .Inputs .dialogic_action .disconnect (_on_finish )
22+ await dialogic .Wait .update_wait (time , hide_text , skippable )
5123
5224 if dialogic .Animations .is_animating ():
5325 dialogic .Animations .stop_animation ()
0 commit comments