main/ holds the main window and top bar, quiz/ the quiz and its parts, player/ the music player, popups/ every popup and what they share, data/ the songs, players, playlist and settings, server/ the MusicServer client, common/ the list row and GameLog, and themes/ the themes and style boxes.
28 lines
848 B
GDScript
28 lines
848 B
GDScript
class_name SongControls
|
|
extends Control
|
|
## The buttons for the song that is playing: show the answer, and go to the next song.
|
|
|
|
signal show_answer_pressed
|
|
signal next_pressed
|
|
|
|
@onready var show_answer_button: Button = $ShowAnswerButton
|
|
@onready var next_button: Button = $NextButton
|
|
|
|
|
|
func _ready() -> void:
|
|
show_answer_button.pressed.connect(show_answer_pressed.emit)
|
|
next_button.pressed.connect(next_pressed.emit)
|
|
|
|
|
|
## Enables Next while there is a downloaded song to play next.
|
|
func set_next_enabled(enabled: bool) -> void:
|
|
next_button.disabled = !enabled
|
|
|
|
|
|
## Disables both buttons, e.g. while the server syncs the song list. Unlocking enables
|
|
## Show answer again; Next comes back when the next song has been downloaded.
|
|
func set_locked(locked: bool) -> void:
|
|
show_answer_button.disabled = locked
|
|
if locked:
|
|
next_button.disabled = true
|