@@ -26,6 +26,7 @@ var animation_name := ""
2626var animation_length : float = 0.5
2727## How often the animation is repeated. Only for Update events.
2828var animation_repeats : int = 1
29+ var repeat_forever : bool = false
2930## If true, the events waits for the animation to finish before the next event starts.
3031var animation_wait := false
3132
@@ -175,15 +176,17 @@ func _execute() -> void:
175176 var time_per_event : float = dialogic .Inputs .auto_skip .time_per_event
176177 var time_for_repetitions : float = time_per_event / animation_repeats
177178 final_animation_length = time_for_repetitions
178-
179+
179180 var animation := dialogic .Portraits .animate_character (
180181 character ,
181182 animation_name ,
182183 final_animation_length ,
183184 final_animation_repetitions ,
185+ false ,
186+ repeat_forever
184187 )
185188
186- if animation_wait :
189+ if animation_wait and ! repeat_forever :
187190 dialogic .current_state = DialogicGameHandler .States .ANIMATING
188191 await animation .finished
189192 dialogic .current_state = DialogicGameHandler .States .IDLE
@@ -315,6 +318,7 @@ func get_shortcode_parameters() -> Dictionary:
315318 "length" : {"property" : "animation_length" , "default" : 0.5 },
316319 "wait" : {"property" : "animation_wait" , "default" : false },
317320 "repeat" : {"property" : "animation_repeats" , "default" : 1 },
321+ "repeat_forever" : {"property" : "repeat_forever" , "default" : false },
318322
319323 "z_index" : {"property" : "z_index" , "default" : 0 },
320324 "mirrored" : {"property" : "mirrored" , "default" : false },
@@ -415,6 +419,8 @@ func build_event_editor() -> void:
415419 'should_show_animation_options() and !animation_name.is_empty()' )
416420 add_body_edit ('animation_repeats' , ValueType .NUMBER , {'left_text' :'Repeat:' , 'mode' :1 , "min" :1 },
417421 'should_show_animation_options() and !animation_name.is_empty() and action == %s )' % Actions .UPDATE )
422+ add_body_edit ('repeat_forever' , ValueType .BOOL , {'left_text' :'Repeat Forever:' },
423+ 'should_show_animation_options() and !animation_name.is_empty() and action == %s )' % Actions .UPDATE )
418424 add_body_line_break ()
419425 add_body_edit ('transform_time' , ValueType .NUMBER , {'left_text' :'Movement duration:' , "min" :0 , "tooltip" : "When changing the characters position, this is how fast it will happen." },
420426 "should_show_transform_options()" )
0 commit comments