44 lines
1.4 KiB
GDScript
44 lines
1.4 KiB
GDScript
extends Node
|
|
|
|
export (PackedScene) var settings = load("res://scenes/UI/settings/Settings.tscn")
|
|
export (PackedScene) var scenes = load("res://scenes/UI/choose_scenes/ChooseScene.tscn")
|
|
|
|
onready var current_scene = "title"
|
|
|
|
func _ready():
|
|
_translation()
|
|
$MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/CenterContainer/TextureRect.grab_focus()
|
|
_apply_scene("Title")
|
|
|
|
## PRIVATE
|
|
func _translation():
|
|
$MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonPuzzle/Label.text = tr("MAIN_BUTTON_PUZZLES")
|
|
$MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonSetting/Label.text = tr("MAIN_BUTTON_SETTINGS")
|
|
$MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonQuit/Label.text = tr("MAIN_BUTTON_QUIT")
|
|
|
|
func _apply_scene(actual_scene):
|
|
var node = "MarginContainer/HBoxContainer/MarginContainer/"
|
|
|
|
for scene in ["Title", "Settings", "ChooseScene"]:
|
|
get_node(node + scene).visible = true
|
|
if actual_scene == scene:
|
|
get_node(node + scene).visible = true
|
|
else:
|
|
get_node(node + scene).visible = false
|
|
|
|
# Load scene for select game
|
|
func _on_ButtonPuzzle_pressed():
|
|
_apply_scene("ChooseScene")
|
|
|
|
# Load scene settings
|
|
func _on_ButtonSetting_pressed():
|
|
_apply_scene("Settings")
|
|
|
|
# Click to icon game
|
|
func _on_TextureRect_pressed():
|
|
_apply_scene("Title")
|
|
|
|
# Quit the game
|
|
func _on_ButtonQuit_pressed():
|
|
get_tree().quit(0)
|