pause_menu.gd 541 B

1234567891011121314151617181920212223242526272829303132
  1. extends Control
  2. func reprendre() -> void:
  3. hide()
  4. get_tree().set_pause(false)
  5. func _unhandled_input(event: InputEvent) -> void:
  6. if event.is_action_released("ui_pause"):
  7. if get_tree().is_paused():
  8. reprendre()
  9. else:
  10. get_tree().set_pause(true)
  11. show()
  12. func _quand_bouton_reprendre_est_presse():
  13. reprendre()
  14. func _quand_bouton_retour_titre_est_presse():
  15. reprendre()
  16. get_tree().reload_current_scene()
  17. func _quand_bouton_quitter_est_presse():
  18. get_tree().quit()
  19. func _on_visibility_changed():
  20. %Reprendre.grab_focus()