27 lines
834 B
GDScript
27 lines
834 B
GDScript
extends Control
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
$HTTPRequest.connect("request_completed", self._on_request_completed)
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
var bodySize = $HTTPRequest.get_body_size()
|
|
var downloadedBytes = $HTTPRequest.get_downloaded_bytes()
|
|
|
|
var percent = downloadedBytes * 100 / bodySize
|
|
$Label.text = "Progress: %d %%" % percent
|
|
pass
|
|
|
|
func download_cpp_dap():
|
|
var url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
|
|
$HTTPRequest.download_file = "user://lldb.tar.xz"
|
|
$HTTPRequest.request(url)
|
|
|
|
|
|
func _on_request_completed(result, response_code, headers, body):
|
|
# TODO: decompress archive
|
|
# OS.execute("")
|
|
pass
|