victory_menu.gd 614 B

123456789101112131415161718192021222324252627282930313233
  1. extends VSplitContainer
  2. func _ready() -> void:
  3. set_process_input(false) # Otherwise pause is disabled
  4. func _input(event: InputEvent) -> void:
  5. if event.is_action_released("ui_pause"):
  6. # Prevent title screen to be paused
  7. get_viewport().set_input_as_handled()
  8. func _on_title_button_pressed():
  9. get_tree().reload_current_scene()
  10. func _on_quit_button_pressed():
  11. get_tree().quit()
  12. func _on_visibility_changed() -> void:
  13. if !is_inside_tree():
  14. return
  15. set_process_input(true)
  16. %TitleButton.grab_focus()
  17. func _on_space_reached(message: String = ""):
  18. if message:
  19. %Message.set_text(message)
  20. show()