This repository has been archived on 2024-07-02. You can view files and clone it, but cannot push or open issues or pull requests.
HoppyEaster/Scripts/MainMenuManager.gd
2023-04-09 18:34:49 +05:30

34 lines
1.1 KiB
GDScript

extends Node
@export var game_scene_path : String = "res://Scenes/PlayerMovement.tscn"
@export var options_scene_path : String = "res://Scenes/SettingsMenu.tscn"
@export var button_to_focus_on_start : TextureButton
# Engine Callbackss
func _ready():
GlobalSettings.set_display_mode(Save.game_data.display_mode)
GlobalSettings.toggle_vsync(Save.game_data.vsync_on)
GlobalSettings.set_resolution(Save.game_data.current_resolution_index)
GlobalSettings.update_master_volume(Save.game_data.master_volume)
GlobalSettings.update_music_volume(Save.game_data.music_volume)
GlobalSettings.update_sfx_volume(Save.game_data.sfx_volume)
button_to_focus_on_start.grab_focus()
pass
func _on_play_button_pressed():
get_tree().change_scene_to_file(game_scene_path)
pass
func _on_settings_button_pressed():
var options_scene = load(options_scene_path).instantiate()
get_tree().current_scene.add_child(options_scene)
pass
func _on_about_button_pressed():
OS.shell_open("https://git.euph.dev/GameDev/HoppyEaster")
pass
func _on_quit_button_pressed():
get_tree().quit()
pass