menu logic
This commit is contained in:
parent
9f838a64f5
commit
f3ef07486f
2 changed files with 85 additions and 14 deletions
25
menu/menu.gd
25
menu/menu.gd
|
|
@ -1,14 +1,25 @@
|
|||
extends Control
|
||||
|
||||
enum Page{
|
||||
Menu,
|
||||
Credits
|
||||
}
|
||||
var menu_page : Page = Page.Menu
|
||||
@export var menu_container : Control
|
||||
@export var credits_container : Control
|
||||
@export var exit_button : Button
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
if OS.get_name() == "Web":
|
||||
exit_button.hide()
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
menu_container.visible = menu_page == Page.Menu
|
||||
credits_container.visible = menu_page == Page.Credits
|
||||
|
||||
|
||||
func _on_intro_button_pressed() -> void:
|
||||
|
|
@ -19,3 +30,15 @@ func _on_intro_button_pressed() -> void:
|
|||
func _on_skip_button_pressed() -> void:
|
||||
GameManager.are_we_skipping_intro = true
|
||||
get_tree().change_scene_to_file("res://game_scene.tscn")
|
||||
|
||||
|
||||
func _on_credits_meta_clicked(meta: Variant) -> void:
|
||||
OS.shell_open(str(meta))
|
||||
|
||||
|
||||
func _on_credits_button_pressed() -> void:
|
||||
menu_page = Page.Credits
|
||||
|
||||
|
||||
func _on_back_button_pressed() -> void:
|
||||
menu_page = Page.Menu
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue