#2 #6 #7 Added a new sync screen that shows progress during sync
All checks were successful
Build / build (push) Successful in 1m22s

This commit is contained in:
2025-09-19 22:15:37 +02:00
parent 3e4d417b4f
commit 4e6e37775d
17 changed files with 443 additions and 64 deletions

View File

@@ -8,8 +8,6 @@ extends Control
# 386 LOC 12/6 - 2024
##TODO
# 13. Fix graphics in lists
# 14. Fix layout
# 15. Fix for local play
@onready
@@ -55,7 +53,7 @@ var sound_test_button: Button = $SoundTestButton
var sync_button: Button = $SyncButton
@onready
var sync_popup: PopupPanel = $SyncPopupPanel
var sync_window: Control = %SyncWindow
@onready
var settings_button: Button = $SettingsButton
@@ -149,8 +147,6 @@ func _ready() -> void:
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"
Settings.selected_server = 3
Settings.winning_score = 5
@@ -172,6 +168,9 @@ func _ready() -> void:
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)
sync_window.connect("sync_started", _on_sync_started)
sync_window.connect("sync_finished", _on_sync_finished)
add_players_button.pressed.connect(add_players)
add_player_button.pressed.connect(add_player)
@@ -210,13 +209,13 @@ func _input(event: InputEvent) -> void:
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()
reset_playlist()
func repeat_song() -> void:
Settings.auto_repeat_song = !Settings.auto_repeat_song
@@ -362,26 +361,23 @@ func get_statistics() -> void:
func sync_games() -> void:
print("sync_games")
sync_button.disabled = true
var games_synced: Callable = func games_synced() -> void:
sync_button.disabled = false
sync_popup.visible = true
print("games_synced")
reset_playlist()
update_from_server()
sync_window.start_sync()
var new_games_synced: Callable = func new_games_synced(synced) -> void:
sync_button.disabled = false
sync_popup.visible = true
print("games_synced")
print("synced: ", synced)
reset_playlist()
update_from_server()
if Settings.quick_sync == true:
Settings.make_request2("/sync/new", new_games_synced, true)
else:
Settings.make_request2("/sync/quick", games_synced, false)
func _on_sync_started() -> void:
print("_on_sync_started")
sync_button.disabled = false
sound_test_button.disabled = true
reset_playlist_button.disabled = true
show_answer_button.disabled = true
next_button.disabled = true
func _on_sync_finished() -> void:
print("_on_sync_finished")
update_from_server()
sound_test_button.disabled = false
reset_playlist_button.disabled = false
show_answer_button.disabled = false
next_button.disabled = false
func get_suggestion_list() -> void:
print("get_suggestion_list")