Loot changes
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var progress_bar = $Panel/VBoxContainer/ProgressBar
|
||||
@onready var status_label = $Panel/VBoxContainer/StatusLabel
|
||||
@onready var file_label = $Panel/VBoxContainer/FileLabel
|
||||
|
||||
func _ready():
|
||||
print("[LoadingScreen] _ready called")
|
||||
|
||||
# Connect to UpdateManager signals
|
||||
if UpdateManager:
|
||||
UpdateManager.update_check_started.connect(_on_update_check_started)
|
||||
UpdateManager.update_progress.connect(_on_update_progress)
|
||||
UpdateManager.update_completed.connect(_on_update_completed)
|
||||
UpdateManager.update_failed.connect(_on_update_failed)
|
||||
|
||||
progress_bar.value = 0
|
||||
|
||||
func _on_update_check_started():
|
||||
status_label.text = "Checking for updates..."
|
||||
progress_bar.value = 0
|
||||
|
||||
func _on_update_progress(downloaded: int, total: int, current_file: String):
|
||||
if total > 0:
|
||||
progress_bar.value = (float(downloaded) / float(total)) * 100.0
|
||||
status_label.text = "Downloading assets... (%d/%d)" % [downloaded, total]
|
||||
file_label.text = current_file
|
||||
else:
|
||||
progress_bar.value = 100.0
|
||||
status_label.text = "No updates needed"
|
||||
file_label.text = ""
|
||||
|
||||
func _on_update_completed(updated_count: int):
|
||||
progress_bar.value = 100.0
|
||||
if updated_count > 0:
|
||||
status_label.text = "Downloaded %d assets" % updated_count
|
||||
else:
|
||||
status_label.text = "All assets up to date"
|
||||
file_label.text = ""
|
||||
|
||||
# Wait a moment then proceed to auth screen
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
GameState.set_state(0)
|
||||
|
||||
func _on_update_failed(error: String):
|
||||
status_label.text = "Update failed: " + error
|
||||
file_label.text = "Click to continue anyway"
|
||||
progress_bar.value = 0
|
||||
|
||||
# Allow continuing anyway after 2 seconds
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
GameState.set_state(0)
|
||||
Reference in New Issue
Block a user