35 lines
1.1 KiB
GDScript
35 lines
1.1 KiB
GDScript
extends Node
|
|
|
|
@export var game_scene : Resource
|
|
@export var settings_scene : Resource
|
|
@export var default_focus : 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)
|
|
default_focus.grab_focus()
|
|
pass
|
|
|
|
func _on_play_button_pressed():
|
|
load(game_scene.resource_path)
|
|
get_tree().change_scene_to_file(game_scene.resource_path)
|
|
pass
|
|
|
|
func _on_settings_button_pressed():
|
|
var settings_scene_instance = load(settings_scene.resource_path).instantiate()
|
|
settings_scene_instance.on_back = Callable(func(): default_focus.grab_focus())
|
|
get_tree().current_scene.add_child(settings_scene_instance)
|
|
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
|