pause_menu.gd 641 B

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