No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainMenu.gd 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. extends Control
  2. var MAIN_MENU_MUSIC = "res://music/menu_principal.ogg"
  3. onready var exit_button = $MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton
  4. onready var continue_button = $MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/ContinueButton
  5. var save_available := false
  6. func _ready():
  7. BackgroundMusic.crossfade_to(MAIN_MENU_MUSIC, -10, 1)
  8. if OS.get_name() == "HTML5":
  9. exit_button.hide()
  10. save_available = not Dialogic.get_current_timeline().empty()
  11. if not save_available:
  12. continue_button.hide()
  13. func load_main_game():
  14. Transit.change_scene("res://scenes/Main.tscn", 0.5)
  15. func load_credits():
  16. Transit.change_scene("res://scenes/Credits.tscn", 0.2)
  17. func _on_NewGameButton_pressed():
  18. Dialogic.reset_saves()
  19. load_main_game()
  20. func _on_ContinueButton_pressed():
  21. load_main_game()
  22. func _on_ExitButton_pressed():
  23. Transit.change_scene("res://scenes/ExitScene.tscn", 0.2)
  24. func _on_CreditsButton_pressed():
  25. load_credits()