khanat-client/scenes/interfaces/music_manager/music_button.gd

54 lines
878 B
GDScript

extends Node
signal music_selected( filename )
signal del_pressed(slot)
signal down_pressed(slot)
signal up_pressed(slot)
var id = 0
func set_music(_filename, _id):
$musicplayer.text = _filename
self.id = _id
func set_disabled():
$musicplayer.disabled = true
func set_play():
$musicplayer.disabled = true
func set_unplay():
$musicplayer.disabled = false
func get_music():
return $musicplayer.text
func get_id():
return self.id
func _on_music_button_pressed():
emit_signal( "music_selected", $musicplayer.text )
func _on_music_button_music_selected(filename):
Config.msg_debug(filename)
MusicManager.play_music(filename)
pass # Replace with function body.
func _on_down_pressed():
emit_signal( "down_pressed", self.id )
func _on_up_pressed():
emit_signal( "up_pressed", self.id )
func _on_del_pressed():
emit_signal( "del_pressed", self.id )