From d942277add7962b70af816d182bfd6ddcf9f9db6 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 28 Oct 2022 13:44:56 -0500 Subject: [PATCH] Disable 'UPDATE' button when updating --- Main_menu.gd | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Main_menu.gd b/Main_menu.gd index a0aabeb..17e93fe 100644 --- a/Main_menu.gd +++ b/Main_menu.gd @@ -84,6 +84,9 @@ func _download_request_completed(result, response_code, headers, body): # IF the os is "linux" based, use chmod to change the file to executable 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(): @@ -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: