cosmic/scripts/menu/MainMenuButton.gd
2023-11-05 21:51:47 +03:00

47 lines
879 B
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

extends Button
@export var id = "Null"
@onready var сontroller = $"../.."
func _ready():
button_up.connect(_on_button_up)
change_name()
func _on_button_up():
match id:
"NewGame":
get_tree().change_scene_to_file("res://scenes/Space.tscn")
"CreateProfile":
Game.profile_create("1")
"LoadProfile":
Game.profile_load("1")
"ExitGame":
get_tree().quit()
func change_name():
visible = true
match id:
"NewGame":
text = "New Game"
"CreateProfile":
text = "Create Profile"
"LoadProfile":
text = "Load Profile"
"DeleteProfile":
text = "Delete Profile"
"ExitGame":
text = "Exit Game"
"Settings":
text = "Settings (WIP)"
"AudioSettings":
text = "Audio (WIP)"
"VideoSettings":
text = "Video (WIP)"
"Profiles":
text = "Profiles (WIP)"
"Back":
text = "Back"
"Null":
text = Game.gameversion
visible = false