extends Control

var locations = ["","","","","","","",""]
var color = "627986ff"
var preurl = ""
var curso = ""

# Called when the node enters the scene tree for the first time.

func setNameAndColor(nombre,elcolor):
	$UnidadTitulo.text = nombre
	color = elcolor
	$UnidadTitulo.modulate = Color(color)
	#$capsula.self_modulate = Color(color)

func setVisible(index,visibility):
	if index == 1:
		$Container/Doc1.visible = visibility
	elif index == 2:
		$Container/Doc3.visible = visibility
	elif index == 3:
		$Container/Doc3.visible = visibility
	elif index == 4:
		$Container/Doc4.visible = visibility
	elif index == 5:
		$Container/Doc5.visible = visibility
	elif index == 6:
		$Container/Doc6.visible = visibility


func setFileLocation(index,location,nombre):
	locations[index] = location
	if index == 1:
		$Container/Doc1/Label.text = nombre
		$Container/Doc1/Cricle/CircleInterior.modulate = Color(color)
	elif index == 2:
		$Container/Doc2/Label.text = nombre
		$Container/Doc2/Cricle/CircleInterior.modulate = Color(color)
	elif index == 3:
		$Container/Doc3/Label.text = nombre
		$Container/Doc3/Cricle/CircleInterior.modulate = Color(color)
	elif index == 4:
		$Container/Doc4/Label.text = nombre
		$Container/Doc4/Cricle/CircleInterior.modulate = Color(color)
	elif index == 5:
		$Container/Doc5/Label.text = nombre
		$Container/Doc5/Cricle/CircleInterior.modulate = Color(color)
	elif index == 6:
		$Container/Doc6/Label.text = nombre
		$Container/Doc6/Cricle/CircleInterior.modulate = Color(color)

func set_framezise(size):
	$capsula.offset_right = 88 * size


func setAllVisibility(visibility):
	$Container/Doc1.visible = visibility
	$Container/Doc3.visible = visibility
	$Container/Doc3.visible = visibility
	$Container/Doc4.visible = visibility
	$Container/Doc5.visible = visibility
	$Container/Doc6.visible = visibility

func _on_doc_1_pressed():
	print("abrir " + locations[1])
	OS.shell_open(locations[1])

func _on_doc_2_pressed():
	print("abrir " + locations[2])
	OS.shell_open(locations[2])

func _on_doc_3_pressed():
	print("abrir " + locations[3])
	OS.shell_open(locations[3])

func _on_doc_4_pressed():
	print("abrir " + locations[4])
	OS.shell_open(locations[4])

func _on_doc_5_pressed():
	print("abrir " + locations[5])
	OS.shell_open(locations[5])

func _on_doc_6_pressed():
	print("abrir " + locations[6])
	OS.shell_open(locations[6])
