Skip to content

Commit

Permalink
Small fix for portrait in animations
Browse files Browse the repository at this point in the history
  • Loading branch information
Jowan-Spooner committed Jun 24, 2024
1 parent 4e85235 commit 33e94a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addons/dialogic/Modules/Character/subsystem_containers.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ func add_container(position_id: String, position := "", size := "") -> DialogicN
if example_position:
var new_position := DialogicNode_PortraitContainer.new()
example_position.get_parent().add_child(new_position)
new_position.name = "Portrait_"+position_id.validate_node_name()
new_position.size = str_to_vector(size)
copy_container_setup(example_position, new_position)
new_position.container_ids = [position_id]
new_position.position = str_to_vector(position)-new_position._get_origin_position()
new_position.name = "Portrait_"+position_id.validate_node_name()
position_changed.emit({&'change':'added', &'container_node':new_position, &'position_id':position_id})
return new_position
return null
Expand Down
3 changes: 3 additions & 0 deletions addons/dialogic/Modules/Character/subsystem_portraits.gd
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ func _animate_node(node: Node, animation_path: String, length: float, repeats :=
## Moves the given portrait to the given container.
func _move_character(character_node: Node2D, transform:="", time := 0.0, easing:= Tween.EASE_IN_OUT, trans:= Tween.TRANS_SINE) -> void:
var tween := character_node.create_tween().set_ease(easing).set_trans(trans).set_parallel()
if time == 0:
tween = null
var container: DialogicNode_PortraitContainer = character_node.get_parent()
dialogic.PortraitContainers.move_container(container, transform, tween, time)

Expand Down Expand Up @@ -563,6 +565,7 @@ func remove_character(character: DialogicCharacter) -> void:

if is_instance_valid(character_node) and character_node is Node:
var container := character_node.get_parent()
container.get_parent().remove_child(container)
container.queue_free()
character_node.queue_free()
character_left.emit({'character': character})
Expand Down

0 comments on commit 33e94a0

Please sign in to comment.