Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anima Fixes #1639

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified addons/dialogic/Localization/dialogic.de.translation
Binary file not shown.
Binary file modified addons/dialogic/Localization/dialogic.en.translation
Binary file not shown.
Binary file modified addons/dialogic/Localization/dialogic.es.translation
Binary file not shown.
Binary file modified addons/dialogic/Localization/dialogic.fr.translation
Binary file not shown.
Binary file modified addons/dialogic/Localization/dialogic.zh_CN.translation
Binary file not shown.
6 changes: 5 additions & 1 deletion addons/dialogic/Nodes/Anima/DialogicAnimaPropertiesHelper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ static func get_rotation(node: Node):

static func set_2D_pivot(node: Node, pivot: int) -> void:
var size: Vector2 = get_size(node)


# If node does not contain offset, just pivot from origin.
if node.get('offset') == null:
return

match pivot:
PIVOT.TOP_CENTER:
if node is Control:
Expand Down
14 changes: 11 additions & 3 deletions addons/dialogic/Nodes/DialogNode.gd
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,10 @@ func event_handler(event: Dictionary):
## PLEASE UPDATE THIS! BUT HOW?
emit_signal("event_start", "action", event)
set_state(state.WAITING)

#Animations safe for custom portraits with no animation-wait
var safeAnimations = ['1-fade_in.gd', '[No Animation]']

if event['character'] == '':# No character found on the event. Skip.
_load_next_event()
else:
Expand Down Expand Up @@ -714,7 +718,7 @@ func event_handler(event: Dictionary):
$Portraits.move_child(p, get_portrait_z_index_point(event.get('z_index', 0)))
p.z_index = event.get('z_index', 0)

if event.get('animation_wait', false):
if (p.get('custom_instance') != null or event.get('animation_wait', false)) and !(event.get('animation', '[No Animation]') in safeAnimations):
yield(p, 'animation_finished')


Expand All @@ -731,7 +735,7 @@ func event_handler(event: Dictionary):
if is_instance_valid(p) and p.character_data['file'] == event['character']:
event = insert_animation_data(event, 'leave', 'fade_out_down.gd')
p.animate(event.get('animation', 'instant_out.gd'), event.get('animation_length', 1), 1, true)
if event.get('animation_wait', false):
if (p.get('custom_instance') != null or event.get('animation_wait', false)) and event.get('animation', 'instant_out.gd') != "instant_out.gd":
yield(p, 'animation_finished')

# UPDATE MODE -------------------------------------------
Expand Down Expand Up @@ -759,9 +763,13 @@ func event_handler(event: Dictionary):
$Portraits.move_child(portrait, get_portrait_z_index_point(event.get('z_index', 0)))
portrait.z_index = event.get('z_index', 0)

# Covers edge case of changing timeline with custom portraits causing infinite yields
if event.get('animation') == '[Default]':
event = insert_animation_data(event, 'join', 'fade_in_up.gd')

portrait.animate(event.get('animation', '[No Animation]'), event.get('animation_length', 1), event.get('animation_repeat', 1))

if event.get('animation_wait', false) and event.get('animation', '[No Animation]') != "[No Animation]":
if portrait.get('custom_instance') != null or (event.get('animation_wait', false) and event.get('animation', '[No Animation]') != "[No Animation]"):
yield(portrait, 'animation_finished')
set_state(state.READY)
_load_next_event()
Expand Down