From b9622d0632519a0082179d78b6496bab6232322b Mon Sep 17 00:00:00 2001 From: Jaap Marsman Date: Mon, 8 Aug 2022 16:55:30 +0800 Subject: [PATCH] trying out online update notifications --- godot/start_menu.gd | 6 ++++-- version_info.csv | 1 + version_stuff.csv | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 version_info.csv delete mode 100644 version_stuff.csv diff --git a/godot/start_menu.gd b/godot/start_menu.gd index 0fa78e1..4263486 100644 --- a/godot/start_menu.gd +++ b/godot/start_menu.gd @@ -16,7 +16,9 @@ func _on_button_update_check_pressed(): $HTTPRequest.request("https://raw.githubusercontent.com/hobbesjaap/wellbeingapp/main/version_stuff.csv") -#func _on_HTTPRequest_request_completed(result, response_code, headers, body): -func _on_request_completed(result, response_code, headers, body): +func _on_HTTPRequest_request_completed(result, response_code, headers, body): +#func _on_request_completed(result, response_code, headers, body): var json = JSON.parse(body.get_string_from_utf8()) program_info.web_release_version = json.result + if program_info.web_release_version > program_info.release_version: + print("There's an update!") diff --git a/version_info.csv b/version_info.csv new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/version_info.csv @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/version_stuff.csv b/version_stuff.csv deleted file mode 100644 index d8263ee..0000000 --- a/version_stuff.csv +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file