Update client screens and deck editor

This commit is contained in:
dingo
2026-05-19 17:16:19 -04:00
parent 8439f287b4
commit 41c18da1ed
5 changed files with 205 additions and 13 deletions
@@ -33,6 +33,10 @@ var _expected_total : int = 1
var _pulse_tween : Tween = null
## SceneTree timer that fires if the sync hangs with no progress.
var _sync_timeout : SceneTreeTimer = null
## True only while we are actively waiting for sync signals from ContentCache.
## Cleared by _on_sync_failed so that a late sync_complete/sync_progress from a
## timed-out run cannot navigate the player or restart the watchdog.
var _sync_accepting : bool = false
# ── Lifecycle ─────────────────────────────────────────────────────────────────
@@ -138,6 +142,7 @@ func _on_version_error(code: String) -> void:
func _do_sync() -> void:
_stop_pulse()
_sync_accepting = true
_expected_total = max(ContentCache.definition_count(), 1)
var cached := ContentCache.definition_count()
if cached > 0:
@@ -152,6 +157,8 @@ func _do_sync() -> void:
# ── ContentCache signal handlers ──────────────────────────────────────────────
func _on_sync_progress(fetched_total: int) -> void:
if not _sync_accepting:
return
_expected_total = max(_expected_total, fetched_total)
var pct := 5.0 + 80.0 * float(fetched_total) / float(_expected_total)
progress_bar.value = clampf(pct, 5.0, 85.0)
@@ -159,6 +166,9 @@ func _on_sync_progress(fetched_total: int) -> void:
func _on_sync_complete(_total: int) -> void:
if not _sync_accepting:
return
_sync_accepting = false
_sync_timeout = null
progress_bar.value = 90.0
_check_active_session()
@@ -224,6 +234,7 @@ func _go_to_main() -> void:
func _on_sync_failed(error: String) -> void:
_sync_accepting = false
_sync_timeout = null
_stop_pulse()
_set_status("Sync failed: %s" % error)