Downloader_UI.gd 664 B

123456789101112131415161718192021222324
  1. extends Panel
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. # Called when the node enters the scene tree for the first time.
  6. func _ready():
  7. Messenger.connect("statusUpdate", self, "_on_status_updated")
  8. # Called every frame. 'delta' is the elapsed time since the previous frame.
  9. #func _process(delta):
  10. # pass
  11. func _on_status_updated(download):
  12. rect_size = $VBoxContainer.rect_size
  13. $VBoxContainer/name.text = download._file_name
  14. $VBoxContainer/size.text = "size: %s"%download._file_size
  15. $VBoxContainer/downloaded.text = "downloaded: %s"%download._downloaded_size
  16. $VBoxContainer/ProgressBar.value = download._downloaded_percent