Exit.gd 753 B

1234567891011121314151617181920212223242526272829303132333435
  1. extends Node
  2. var overlay_visible = false
  3. onready var parent = get_tree().get_root().find_node("Escape", true, false)
  4. func set_visible(state):
  5. if state:
  6. $Overlay.layer = 2
  7. $Overlay/Popup.popup_centered()
  8. else:
  9. $Overlay.layer = -2
  10. $Overlay/Popup.hide()
  11. func _ready():
  12. set_visible(false)
  13. func _on_YesButton_pressed():
  14. get_tree().quit(0)
  15. func _on_YesButton_mouse_entered():
  16. $Overlay/Popup/YesButton/selected.visible = true
  17. $Overlay/Popup/NoButton/selected.visible = false
  18. func _on_NoButton_pressed():
  19. set_visible(false)
  20. parent.set_visible(true)
  21. func _on_NoButton_mouse_entered():
  22. $Overlay/Popup/YesButton/selected.visible = false
  23. $Overlay/Popup/NoButton/selected.visible = true
  24. func _on_Background_pressed():
  25. set_visible(false)