Disable 'UPDATE' button when updating

This commit is contained in:
Noah 2022-10-28 13:44:56 -05:00
parent 64f41c2bb4
commit d942277add

View File

@ -85,6 +85,9 @@ func _download_request_completed(result, response_code, headers, body):
if os_name == "linux":
OS.execute("chmod", ["+x", OS.get_config_dir()+"/UltraFlare/current/UltraFlare-"+os_name+"-x86_64"])
# Enable (Un-disable?) the Play_button
$Panel/Play_button.disabled = false
# When the play button is pressed,
func _on_Play_button_pressed():
# If local_version is null, or the newest version available online is greater than the version currently installed,
@ -110,6 +113,16 @@ func _on_Play_button_pressed():
# Send an HTTP request to the url
var error = download.request(url)
# If the request was *created* successfully (Not neccessarily saying the server responded positively),
if error == OK:
# Disable the Play_button (So it can't be clicked multiple times)
$Panel/Play_button.disabled = true
# If not,
else:
# Debug message!
print("Failed to send HTTP request to server! Error: "+error)
# If not,
# Play the game
else: