forked from team-sg/hero-mark-2
20 lines
618 B
GDScript
20 lines
618 B
GDScript
extends TextureButton
|
|
|
|
export (Array, String) var titles
|
|
export (Array, AudioStream) var sounds
|
|
var current_selection = 0
|
|
onready var body = $SoundLabel/Label
|
|
|
|
func _gui_input(event):
|
|
if Input.is_action_just_pressed("ui_left"):
|
|
current_selection -= 1
|
|
elif Input.is_action_just_pressed("ui_right"):
|
|
current_selection += 1
|
|
elif Input.is_action_just_pressed("ui_accept"):
|
|
Audio.play_sound(sounds[current_selection],Audio.ac_collectible)
|
|
elif Input.is_action_just_pressed("ui_cancel"):
|
|
Audio.ac_music.stop()
|
|
current_selection = posmod(current_selection,sounds.size())
|
|
body.text = titles[current_selection]
|
|
|
|
|