extends Label

onready var levelState := get_tree().root.get_child(3).get_node("%LevelState")

func _ready():
	var wallet = 0
	var deaths = 0
	var kills = 0
	var frees = 0
	var prog = GlobalState.progress_dict
	for key in GlobalState.progress_dict:
		if prog[key].has("currency"):
			wallet += prog[key]["currency"]
		if prog[key].has("deaths"):
			deaths += prog[key]["deaths"]
		if prog[key].has("deaths"):
			kills += prog[key]["kills"]
		if prog[key].has("frees"):
			frees += prog[key]["frees"]
			
	self.text = self.text % [wallet, deaths, kills, frees]
