How can I get around popup_hide() firing before confirmed() in the confirmationdialog?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jujumumu

I have a popup that confirms if a player wants to do his action. But I have a variable that stores what the player wants to do.

var action = null
#fires dialog and changes action variable
func _on_confirmation():
    #do action
    action = null
func _on_hide():
    action = null

The problem is that when a player accepts, the _on_hide() also fires along with the _on_confirmation(). But _on_hide fires first which means the action that I would be doing since the player accepts would be null. How can I get around this?

:bust_in_silhouette: Reply From: Thomas Karcher

Set dialog_hide_on_ok to false and hide the dialog manually by adding hide() to the end of _on_confirmation().