extends Control
@onready var continue_game_button: Button = $VBoxContainer/VBoxContainer/ContinueGameButton

func _ready() -> void:
	continue_game_button.visible = Globals.previous_run_exists

func _on_new_game_button_pressed() -> void:
	Globals.reset_for_new_game()
	if Globals.skip_cutscenes:
		SceneChanger.change_scene_to(Utils.GAME_SCENES.GAME)
	else:
		SceneChanger.change_scene_to(Utils.GAME_SCENES.INTRO_CUTSCENE)
	SignalBus.start_game_or_respawn.emit()  # for music

func _on_exit_game_button_pressed() -> void:
	get_tree().quit()

func _on_settings_button_pressed() -> void:
	GUI.show_submenu(self, Utils.SETTINGS_MENU)

func _on_skip_to_game_button_pressed() -> void:
	SceneChanger.change_scene_to(Utils.GAME_SCENES.GAME)
	SignalBus.start_game_or_respawn.emit()  # for music

func _on_continue_game_button_pressed() -> void:
	if Globals.is_in_boss_room:
		Globals.current_time = Utils.TIME.PRESENT
	SceneChanger.change_scene_to(Utils.GAME_SCENES.GAME)
	SignalBus.start_game_or_respawn.emit()  # for music

func _on_credits_button_pressed() -> void:
	GUI.show_submenu(self, Utils.CREDITS)
