#1: Fixed bug with inspiration list and search list not updating on sync and server changed
All checks were successful
Build / build (push) Successful in 1m30s
All checks were successful
Build / build (push) Successful in 1m30s
This commit is contained in:
@@ -63,6 +63,9 @@ var settings_button: Button = $SettingsButton
|
||||
@onready
|
||||
var settings_popup: PopupPanel = $SettingsPopupPanel
|
||||
|
||||
@onready
|
||||
var settings_window: BoxContainer = $SettingsPopupPanel/SettingsWindow
|
||||
|
||||
@onready
|
||||
var statistics_button: Button = $StatisticsButton
|
||||
|
||||
@@ -129,6 +132,9 @@ var auto_repeat_song_button: CheckButton = $RepeatSongCheckButton
|
||||
@onready
|
||||
var music_player_container: PanelContainer = $MusicPlayer
|
||||
|
||||
@onready
|
||||
var debug_label: Label = $DebugLabel
|
||||
|
||||
var player := preload("res://Player.tscn")
|
||||
var song_list_object := preload("res://song_list_object.tscn")
|
||||
|
||||
@@ -142,6 +148,7 @@ func _ready() -> void:
|
||||
var is_mac: bool = OS.has_feature("macos")
|
||||
if is_debug:
|
||||
print("is_debug")
|
||||
debug_label.visible = true
|
||||
##Settings.default_path = "http://localhost:8080"
|
||||
##Settings.selected_server = 3
|
||||
Settings.default_path = "http://localhost:8080"
|
||||
@@ -164,6 +171,7 @@ func _ready() -> void:
|
||||
new_player_name_field.connect("enter_key_pressed", add_player)
|
||||
music_player_container.connect("play_next_song", fetch_song.bind(false))
|
||||
music_player_container.connect("update_song_list", update_song_list)
|
||||
settings_window.connect("server_changed", server_updated)
|
||||
|
||||
add_players_button.pressed.connect(add_players)
|
||||
add_player_button.pressed.connect(add_player)
|
||||
@@ -199,6 +207,17 @@ func _input(event: InputEvent) -> void:
|
||||
if Settings.fullscreen == false:
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
|
||||
|
||||
func server_updated() -> void:
|
||||
print("server_updated")
|
||||
update_from_server()
|
||||
reset_playlist()
|
||||
reset_points()
|
||||
|
||||
func update_from_server() -> void:
|
||||
print("update_from_server")
|
||||
search_view.get_list_of_games()
|
||||
get_suggestion_list()
|
||||
|
||||
func repeat_song() -> void:
|
||||
Settings.auto_repeat_song = !Settings.auto_repeat_song
|
||||
|
||||
@@ -349,8 +368,7 @@ func sync_games() -> void:
|
||||
sync_popup.visible = true
|
||||
print("games_synced")
|
||||
reset_playlist()
|
||||
get_suggestion_list()
|
||||
search_view.get_list_of_games()
|
||||
update_from_server()
|
||||
|
||||
var new_games_synced: Callable = func new_games_synced(synced) -> void:
|
||||
sync_button.disabled = false
|
||||
@@ -358,8 +376,7 @@ func sync_games() -> void:
|
||||
print("games_synced")
|
||||
print("synced: ", synced)
|
||||
reset_playlist()
|
||||
get_suggestion_list()
|
||||
search_view.get_list_of_games()
|
||||
update_from_server()
|
||||
|
||||
if Settings.quick_sync == true:
|
||||
Settings.make_request2("/sync/new", new_games_synced, true)
|
||||
@@ -371,6 +388,7 @@ func get_suggestion_list() -> void:
|
||||
var populate_list: Callable = func populate_list(array) -> void:
|
||||
if typeof(array) == TYPE_ARRAY:
|
||||
games = []
|
||||
Settings.delete_children(inspiration_list)
|
||||
games.append_array(array)
|
||||
for game: String in games:
|
||||
var inspiration_label: Label = Label.new()
|
||||
|
||||
Reference in New Issue
Block a user