Sort the scripts and scenes into folders
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.
This commit is contained in:
1 parent
a0428e3475
commit
d77b72159d
115 files changed
+94
-84
No files matched your search
@@ -0,0 +1,26 @@
|
||||
class_name MusicListPanel
|
||||
extends PanelContainer
|
||||
## The list of songs in the playlist, one row per song.
|
||||
|
||||
## Emitted when the row of song number [param song_no] is clicked.
|
||||
|
||||
signal song_clicked(song_no: int)
|
||||
|
||||
var _song_list_object: PackedScene = preload("res://quiz/SongRow.tscn")
|
||||
|
||||
@onready var _rows: VBoxContainer = %MusicList
|
||||
|
||||
|
||||
## Shows the songs in the playlist again, so it shows their latest state.
|
||||
func refresh() -> void:
|
||||
Settings.delete_children(_rows)
|
||||
for s: SongObject in Playlist.get_playlist():
|
||||
var new_song_list_object: SongRow = _song_list_object.instantiate()
|
||||
new_song_list_object.song_object = s
|
||||
new_song_list_object.gui_input.connect(_on_row_input.bind(s.song_number))
|
||||
_rows.add_child(new_song_list_object)
|
||||
|
||||
|
||||
func _on_row_input(event: InputEvent, song_no: int) -> void:
|
||||
if event is InputEventMouseButton && event.pressed && event.button_index == MOUSE_BUTTON_LEFT:
|
||||
song_clicked.emit(song_no)
|
||||
Reference in new issue
Block a user