extends Container

func _ready() -> void:
	%DebugScaleSlider.value_changed.connect(Global.set_scale)
	
	%TaraButton.pressed.connect(_on_tara_button)
	%OkayButton.pressed.connect(Global.confirm_entry)
	%FinishButton.pressed.connect(_on_finish_button)
	
	Global.cart_updated.connect(_on_cart_updated)
	
	Global.weights_updated.emit() # Replace placeholder texts

func _on_tara_button():
	var popup = load("res://tara_popup.tscn").instantiate()
	add_child(popup)
	popup.popup_centered()
	
func _on_finish_button():
	var popup = load("res://finish_popup.tscn").instantiate()
	add_child(popup)
	popup.popup_centered()
	

func _on_cart_updated():
	%CartTotal.text = "Summe: %.2f€" % (Global.cart_total_cents / 100.0)
