Renamed newest_local_version -> local_version
This commit is contained in:
parent
989742955b
commit
db7c7d96e8
23
Main_menu.gd
23
Main_menu.gd
@ -1,16 +1,17 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
var newest_version
|
# Define variables
|
||||||
var newest_version_data
|
var newest_version # The newest version available online
|
||||||
var newest_local_version
|
var newest_version_data # The data about the newest version online
|
||||||
var os_name
|
var local_version # The version installed on this computer
|
||||||
var suffix
|
var os_name # The simplified name of the OS (linux, or windows)
|
||||||
|
var suffix #
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
if newest_version != null:
|
if newest_version != null:
|
||||||
newest_local_version = Versions.get_version()
|
local_version = Versions.get_version()
|
||||||
if newest_local_version:
|
if local_version:
|
||||||
if newest_version > newest_local_version :
|
if newest_version > local_version :
|
||||||
$Panel/Play_button.text = "Update"
|
$Panel/Play_button.text = "Update"
|
||||||
else:
|
else:
|
||||||
$Panel/Play_button.text = "Play"
|
$Panel/Play_button.text = "Play"
|
||||||
@ -48,14 +49,14 @@ func _download_request_completed(result, response_code, headers, body):
|
|||||||
dl_file.store_buffer(body)
|
dl_file.store_buffer(body)
|
||||||
dl_file.close()
|
dl_file.close()
|
||||||
|
|
||||||
newest_local_version = newest_version_data.tag_name
|
local_version = newest_version_data.tag_name
|
||||||
Store.write_store("current_version", newest_local_version)
|
Store.write_store("current_version", local_version)
|
||||||
|
|
||||||
if os_name == "linux":
|
if os_name == "linux":
|
||||||
OS.execute("chmod", ["+x", OS.get_config_dir()+"/UltraFlare/current/UltraFlare-"+os_name+"-x86_64"])
|
OS.execute("chmod", ["+x", OS.get_config_dir()+"/UltraFlare/current/UltraFlare-"+os_name+"-x86_64"])
|
||||||
|
|
||||||
func _on_Play_button_pressed():
|
func _on_Play_button_pressed():
|
||||||
if not newest_local_version or newest_version > newest_local_version:
|
if not local_version or newest_version > local_version:
|
||||||
var download = HTTPRequest.new()
|
var download = HTTPRequest.new()
|
||||||
var url
|
var url
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user