This repository has been archived on 2025-04-15. You can view files and clone it, but cannot push or open issues or pull requests.
Gamify-Life/Gamify Life/Menu Stuffs/Script/Main Menu.gd
2025-04-15 11:55:58 -07:00

53 lines
1.2 KiB
GDScript

extends Node2D
@export var Task_Scene: PackedScene
@export var Calendar_Scene: PackedScene
@onready var Anim = get_node("Animation")
@onready var Whoosh = get_node("Whoosh")
func _ready():
if int(GlobalVars.LoadSingle("user://Date")) != Time.get_date_dict_from_system().day:
get_node("Tasks/InfoCircle").visible = true
# Main menu functions
func _on_tasks_pressed():
get_tree().change_scene_to_packed(Task_Scene)
func _on_quit_pressed():
get_tree().quit()
func _on_extras_pressed():
if !Anim.is_playing():
Anim.play("Show_Extras")
Whoosh.play()
func _on_items_pressed():
if !Anim.is_playing():
Anim.play("Show_Items")
Whoosh.play()
func _on_upgrades_pressed():
if !Anim.is_playing():
Anim.play("Show_Upgrades")
Whoosh.play()
func _on_calendar_pressed():
get_tree().change_scene_to_packed(Calendar_Scene)
# Extras functions
func _on_e_back_pressed():
if !Anim.is_playing():
Anim.play("Hide_Extras")
Whoosh.play()
# Item functions
func _on_Exclaim_back_pressed():
if !Anim.is_playing():
Anim.play("Hide_Items")
Whoosh.play()
# Shop functions
func _on_Dollar_back_pressed():
if !Anim.is_playing():
Anim.play("Hide_Upgrades")
Whoosh.play()