Replies: 1 comment 1 reply
|
Queue-freeing the balloon only removes the UI node. It does not cancel an already running The example balloon calls I would handle this as a dialogue-session cancellation problem, not just a balloon cleanup problem:
For example, in your balloon: var cancelled := false
func cancel_dialogue() -> void:
cancelled = true
queue_free()
func _exit_tree() -> void:
cancelled = true
func start(with_dialogue_resource: DialogueResource = null, cue: String = "", extra_game_states: Array = []) -> void:
temporary_game_states = [self] + extra_game_states
if is_instance_valid(with_dialogue_resource):
dialogue_resource = with_dialogue_resource
dialogue_line = await dialogue_resource.get_next_dialogue_line(cue, temporary_game_states)
if cancelled or not is_inside_tree():
return
show()
func next(next_id: String) -> void:
if cancelled or not is_inside_tree():
return
dialogue_line = await dialogue_resource.get_next_dialogue_line(next_id, temporary_game_states)
if cancelled or not is_inside_tree():
returnThen call For the specific The important rule is: any If that explains why line 38 still runs after the menu switch, please mark this as answered so others know to cancel the dialogue session, not only free the balloon. |

Queue-freeing the balloon only removes the UI node. It does not cancel an already running
DialogueManager.get_next_dialogue_line()call.The example balloon calls
dialogue_resource.get_next_dialogue_line(...)fromstart()andnext(), and that method steps through mutation lines until it reaches printable dialogue or the end. The docs also say mutations are run while requesting the next line, and awaited mutations pause until they resolve. So if your line 34 mutation is still awaitingTransitions.show_cutscene_text(...), the manager can resume afterward and continue to the nextdo play_phone()even though the old balloon has been freed.I would handle this as a dialogue-session cancellatio…