extends CanvasLayer

@onready var timer = get_node("%time")
@onready var important_vars = $"%impvars"
@onready var booking_screen = $"%BookingScreen"
@onready var lesson_grid = $"%LessonGrid"
@onready var button_grid = $"%ButtonGrid"
@onready var reset_menu = $"%ResetMenu"

@onready var lunch_label = $"%Lesson8"
@onready var a1l8 = $"%A1L8"
@onready var a2l8 = $"%A2L8"
@onready var b1l8 = $"%B1L8"
@onready var b2l8 = $"%B2L8"
@onready var cl8 = $"%CL8"
@onready var dl8 = $"%DL8"
@onready var el8 = $"%EL8"
@onready var fl8 = $"%FL8"
@onready var gl8 = $"%GL8"

var lunch_enabled = false

func create_ini_file():
	var ini_title = important_vars.day_uid + ".ini"
	print(ini_title)

# Called when the node enters the scene tree for the first time.
func _ready():
	create_ini_file()
	$"%DayLabel".text = timer.dayofweek_word + " " + str(timer.day_number) + " " + timer.month_word
	booking_screen.visible = false
	lesson_grid.visible = true
	reset_menu.visible = false
#	print(lunch_enabled)
	
func toggle_lunch():
	
	if lunch_enabled == false:
		lunch_label.visible = true
		a1l8.visible = true
		a2l8.visible = true
		b1l8.visible = true
		b2l8.visible = true
		cl8.visible = true
		dl8.visible = true
		el8.visible = true
		fl8.visible = true
		gl8.visible = true
		lunch_enabled = true
		
	else:
		lunch_label.visible = false
		a1l8.visible = false
		a2l8.visible = false
		b1l8.visible = false
		b2l8.visible = false
		cl8.visible = false
		dl8.visible = false
		el8.visible = false
		fl8.visible = false
		gl8.visible = false
		lunch_enabled = false

func show_reset_menu():
	reset_menu.visible = true
	lesson_grid.visible = false
	button_grid.visible = false

func _on_SettingsButton_pressed():
#	toggle_lunch()
	show_reset_menu()
