Made improvements to the Search window, Made small changes to the inspiration list scrolling, Made small changes to the player list, Changed the term game to soundtrack, #28: Made changes to the sync window
This commit is contained in:
1 parent
235bdcbcb5
commit
8da6fc442f
17 files changed
+448
-363
No files matched your search
+24
-22
@@ -23,7 +23,7 @@ var inspiration_scroll: ScrollContainer = $ScrollContainer
|
||||
var inspiration_list: VBoxContainer = $ScrollContainer/VBoxContainer
|
||||
|
||||
@onready
|
||||
var game_label: Label = $VBoxContainer/GameLabel
|
||||
var soundtrack_label: Label = $VBoxContainer/SoundtrackLabel
|
||||
|
||||
@onready
|
||||
var song_label: Label = $VBoxContainer/SongLabel
|
||||
@@ -106,6 +106,9 @@ var music_list: VBoxContainer = $MusicListPanel/ScrollContainer/MusicList
|
||||
@onready
|
||||
var player_container: VBoxContainer = $Players/VBoxContainer
|
||||
|
||||
@onready
|
||||
var players_list_container: VBoxContainer = $Players/VBoxContainer/ScrollContainer/PlayersListVBoxContainer
|
||||
|
||||
@onready
|
||||
var character_select: Control = $CharacterSelect
|
||||
|
||||
@@ -134,7 +137,7 @@ var player: PackedScene = preload("res://Player.tscn")
|
||||
var song_list_object: PackedScene = preload("res://song_list_object.tscn")
|
||||
|
||||
var songs: Array= []
|
||||
var games: Array = []
|
||||
var soundtracks: Array = []
|
||||
var current_player: Node
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
@@ -152,7 +155,7 @@ func _ready() -> void:
|
||||
next_button.pressed.connect(play_next_song)
|
||||
show_answer_button.pressed.connect(show_answer_pressed)
|
||||
search_button.pressed.connect(show_search)
|
||||
sync_button.pressed.connect(sync_games)
|
||||
sync_button.pressed.connect(sync_soundtracks)
|
||||
sound_test_button.pressed.connect(music_player_container.get_sound_test_song)
|
||||
statistics_button.pressed.connect(get_statistics)
|
||||
shortcuts_button.pressed.connect(show_shortcuts)
|
||||
@@ -180,7 +183,7 @@ func _ready() -> void:
|
||||
get_suggestion_list()
|
||||
fetch_song_list_at_start()
|
||||
fetch_song()
|
||||
search_view.get_list_of_games()
|
||||
search_view.get_list_of_soundtracks()
|
||||
new_character_select.load_characters()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
@@ -220,7 +223,7 @@ func server_updated() -> void:
|
||||
|
||||
func update_from_server() -> void:
|
||||
print("update_from_server")
|
||||
search_view.get_list_of_games()
|
||||
search_view.get_list_of_soundtracks()
|
||||
get_suggestion_list()
|
||||
reset_playlist()
|
||||
new_character_select.load_characters()
|
||||
@@ -245,7 +248,7 @@ func fetch_song_list_at_start() -> void:
|
||||
for d: Dictionary in data:
|
||||
var new_song_object: SongObject = SongObject.new()
|
||||
new_song_object.song_number = d.SongNo
|
||||
new_song_object.game_title = d.Game
|
||||
new_song_object.soundtrack_title = d.Soundtrack
|
||||
new_song_object.song_title = d.Song
|
||||
new_song_object.is_answered = true
|
||||
new_song_object.has_played = true
|
||||
@@ -291,7 +294,7 @@ func fetch_song() -> void:
|
||||
var fetch_song_info_done: Callable = func fetch_song_info_done(data_received: Dictionary) -> void:
|
||||
print("fetch_song_info_done")
|
||||
new_song_object.song_number = data_received.SongNo
|
||||
new_song_object.game_title = data_received.Game
|
||||
new_song_object.soundtrack_title = data_received.Soundtrack
|
||||
new_song_object.song_title = data_received.Song
|
||||
|
||||
print("new_song_object: ", new_song_object.to_string())
|
||||
@@ -312,7 +315,7 @@ func fetch_song() -> void:
|
||||
func update_song_list() -> void:
|
||||
print("update_song_list")
|
||||
if Playlist.currently_playing_song >= 0:
|
||||
game_label.text = Playlist.get_current_game_title()
|
||||
soundtrack_label.text = Playlist.get_current_soundtrack_title()
|
||||
song_label.text = Playlist.get_current_song_title()
|
||||
Settings.delete_children(music_list)
|
||||
for s: SongObject in Playlist.get_playlist():
|
||||
@@ -371,10 +374,10 @@ func show_qr() -> void:
|
||||
func get_statistics() -> void:
|
||||
print("get_statistics")
|
||||
statistic_popup.visible = true
|
||||
statistic_label.text = "Total amount of games in the playlist: " + str(games.size())
|
||||
statistic_label.text = "Total amount of soundtracks in the playlist: " + str(soundtracks.size())
|
||||
|
||||
func sync_games() -> void:
|
||||
print("sync_games")
|
||||
func sync_soundtracks() -> void:
|
||||
print("sync_soundtracks")
|
||||
sync_window.start_sync()
|
||||
|
||||
func _on_sync_started() -> void:
|
||||
@@ -397,17 +400,16 @@ func get_suggestion_list() -> void:
|
||||
print("get_suggestion_list")
|
||||
var populate_list: Callable = func populate_list(array) -> void:
|
||||
if typeof(array) == TYPE_ARRAY:
|
||||
games = []
|
||||
soundtracks = []
|
||||
Settings.delete_children(inspiration_list)
|
||||
games.append_array(array)
|
||||
for game: String in games:
|
||||
soundtracks.append_array(array)
|
||||
for soundtrack: String in soundtracks:
|
||||
var inspiration_label: Label = Label.new()
|
||||
inspiration_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
|
||||
inspiration_label.add_theme_font_size_override("font_size", 20)
|
||||
inspiration_label.text = game
|
||||
inspiration_label.text = soundtrack
|
||||
inspiration_label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
||||
inspiration_list.add_child(inspiration_label)
|
||||
inspiration_scroll.scroll_to_bottom()
|
||||
else:
|
||||
print("Unexpected data")
|
||||
Settings.make_request2("/music/all", populate_list, true)
|
||||
@@ -434,7 +436,7 @@ func add_player() -> void:
|
||||
|
||||
func load_players() -> void:
|
||||
print("load_players")
|
||||
Settings.delete_player_children(player_container)
|
||||
Settings.delete_player_children(players_list_container)
|
||||
var counter: int = 0
|
||||
for player_object: PlayerObject in Settings.player_array:
|
||||
print(player_object.player_name)
|
||||
@@ -445,7 +447,7 @@ func load_players() -> void:
|
||||
new_player.connect("change_character_clicked", _on_player_change_character_clicked.bind(new_player, player_object.player_name))
|
||||
new_player.connect("player_removed", _on_player_removed.bind(counter))
|
||||
|
||||
player_container.add_child(new_player)
|
||||
players_list_container.add_child(new_player)
|
||||
counter += 1
|
||||
|
||||
func _on_point_given(player_given_point: int) -> void:
|
||||
@@ -519,11 +521,11 @@ func dir_contents(path: String) -> void:
|
||||
dir.list_dir_begin()
|
||||
var file_name: String = dir.get_next()
|
||||
songs.clear()
|
||||
games = []
|
||||
soundtracks = []
|
||||
while file_name != "":
|
||||
if dir.current_is_dir():
|
||||
#print("Found directory: " + file_name)
|
||||
games.append(file_name)
|
||||
soundtracks.append(file_name)
|
||||
else:
|
||||
#print("Found file: " + file_name)
|
||||
if file_name.ends_with(".mp3"):
|
||||
@@ -532,7 +534,7 @@ func dir_contents(path: String) -> void:
|
||||
else:
|
||||
print("An error occurred when trying to access the path.")
|
||||
|
||||
for game: String in games:
|
||||
for soundtrack: String in soundtracks:
|
||||
var local_inspiration_label: Label = Label.new()
|
||||
local_inspiration_label.text = game
|
||||
local_inspiration_label.text = soundtrack
|
||||
inspiration_list.add_child(local_inspiration_label)
|
||||
Reference in new issue
Block a user