extends Control

var current_button = ""

func ui_update_progress():
	get_node("main/progress").set_text("зона-" + str(global.current_zone_id) + " уровень-" + str(global.current_level_id))
	
func _on_options_button_pressed():
	get_node("main").hide()
	get_node("options").show()

func _on_exit_button_pressed():
	get_tree().quit()
	
func _on_cancel_button_pressed():
	get_node("main").show()
	get_node("options").hide()
	
func _on_cancel_button_2_pressed():
	get_node("main").show()
	get_node("about").hide()

func _on_about_button_pressed():
	get_node("main").hide()
	get_node("about").show()
	
func _on_music_volume_value_changed( value ):
	audio.change_music_volume(value)

func _on_sounds_volume_value_changed( value ):
	audio.get_node("sounds").set_default_volume(value)

func _on_new_game_button_pressed():
	global.start_new_game()

func _on_continue_button_pressed():
	global.continue_game()
	
func _ready():
	audio.play_music(load("res://audio/music/tiny_journey_menu.ogg"))
	ui_update_progress()

func _on_main_menu_enter_tree():
	get_tree().set_pause(false)

func _on_main_menu_exit_tree():
	audio.stop_music()
