2022-07-31 05:27:58 +00:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
|
2022-08-03 01:01:10 +00:00
|
|
|
onready var user_info = get_node("/root/UserValues")
|
2022-08-07 01:08:10 +00:00
|
|
|
onready var program_info = get_node("/root/ProgramValues")
|
2022-07-31 05:27:58 +00:00
|
|
|
|
|
|
|
func _ready():
|
2022-08-08 08:53:39 +00:00
|
|
|
$HTTPRequest.connect("request_completed", self, "_on_request_completed")
|
|
|
|
|
2022-07-31 05:27:58 +00:00
|
|
|
|
2022-08-08 06:42:26 +00:00
|
|
|
func _process(_delta):
|
|
|
|
$welcome_title.text = "Good morning " + user_info.user_first_name + "!"
|
2022-08-08 08:53:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_button_update_check_pressed():
|
|
|
|
$HTTPRequest.request("https://raw.githubusercontent.com/hobbesjaap/wellbeingapp/main/version_stuff.csv")
|
|
|
|
|
|
|
|
|
2022-08-08 08:55:30 +00:00
|
|
|
func _on_HTTPRequest_request_completed(result, response_code, headers, body):
|
|
|
|
#func _on_request_completed(result, response_code, headers, body):
|
2022-08-08 08:53:39 +00:00
|
|
|
var json = JSON.parse(body.get_string_from_utf8())
|
|
|
|
program_info.web_release_version = json.result
|
2022-08-08 08:55:30 +00:00
|
|
|
if program_info.web_release_version > program_info.release_version:
|
|
|
|
print("There's an update!")
|