godot-third-person-basic-scene/scenes/music/music_field.gd

18 lines
315 B
GDScript

extends HBoxContainer
signal selected_music(pos)
var filename:String = ""
var pos:int = 0
func set_music(_filename, musicname, _pos, selected:bool):
filename = _filename
pos = _pos
$Music.set_text(musicname)
$Selected.set_pressed(selected)
func _on_music_pressed():
emit_signal( "selected_music", pos )