extends CheckBox

func _ready():
	if ResourceLoader.exists('user://patches/music.tres'):
		var loader = load("user://patches/music.tres")
		$AudioStreamPlayer.playing = loader.data[0]
		pressed = loader.data[0]

func _on_CheckBox_toggled(button_pressed):
	$AudioStreamPlayer.playing = button_pressed
	var data2 = load("res://dataresource.gd").new()
	data2.data = [button_pressed]
	ResourceSaver.save('user://patches/music.tres', data2)
	pass # Replace with function body.
