Updated to Godot 4.4 - Creating workable 0.15 version

This commit is contained in:
Jaap Marsman 2025-03-30 13:40:30 +08:00
parent 14450758d3
commit 51ffd4f81b
12 changed files with 32 additions and 16 deletions

1
godot/EditScreen.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://psov4nxn77wr

View File

@ -0,0 +1 @@
uid://b4r3eb67qd13n

View File

@ -0,0 +1 @@
uid://hff4wu52flpd

1
godot/ProgressBar.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://t1pvqg6e78j

1
godot/Results.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://dhhlom5skgqeq

1
godot/TimerBar.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://dflvmgvxwqrrf

View File

@ -3,6 +3,8 @@ extends Node
var date var date
var ddmmyyyy var ddmmyyyy
var update_text : String
var web_release_version : float var web_release_version : float
var release_version = 0.15 var release_version = 0.15

1
godot/global_ints.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://d05vnomx2cg07

View File

@ -9,7 +9,7 @@ var date
var csv_url = "https://raw.githubusercontent.com/hobbesjaap/time-sampling-form/main/version_info.csv" var csv_url = "https://raw.githubusercontent.com/hobbesjaap/time-sampling-form/main/version_info.csv"
var update_text_url = "https://raw.githubusercontent.com/hobbesjaap/time-sampling-form/main/updater/update_text.md" var update_text_url = "https://raw.githubusercontent.com/hobbesjaap/time-sampling-form/main/updater/update_text.md"
var update_text : String var update_text : String
var text_buffer : String
@onready var date_time_display = $"%CurrentTime" @onready var date_time_display = $"%CurrentTime"
@onready var global_ints = $"/root/GlobalInts" @onready var global_ints = $"/root/GlobalInts"
@ -24,11 +24,13 @@ var update_text : String
# window.position = Vector2i(-8, 0) # window.position = Vector2i(-8, 0)
# window.size = Vector2i(screen_size.x - 66, screen_size.y - 1) # window.size = Vector2i(screen_size.x - 66, screen_size.y - 1)
func check_for_updates(): func check_for_updates():
var os_list : Array = ["Linux", "Windows", "macOS", "OSX"]
var os_check : String var os_check : String
os_check = OS.get_name() os_check = OS.get_name()
print(os_check) print(os_check)
if os_check == "Linux" and "Windows" and "OSX": if os_list.has(os_check):
print("We're on desktop. So let's check for updates!") print("We're on desktop. So let's check for updates!")
$"%HTTPRequest".request(csv_url) $"%HTTPRequest".request(csv_url)
$"%HTTPRequest2".request(update_text_url) $"%HTTPRequest2".request(update_text_url)
@ -44,13 +46,15 @@ func _on_HTTPRequest_request_completed(_result, _response_code, _headers, body):
$"%UpdatePanel".visible = true $"%UpdatePanel".visible = true
$"%UpdateText".text = str(update_text) $"%UpdateText".text = str(update_text)
$"%UpdateIntro".text = str("You are currently using version ",global_ints.release_version,". The latest version available is ",global_ints.web_release_version,".") $"%UpdateIntro".text = str("You are currently using version ",global_ints.release_version,". The latest version available is ",global_ints.web_release_version,".")
if global_ints.web_release_version <= global_ints.release_version:
print("No update available!")
func _on_HTTPRequest2_request_completed(_result, _response_code, _headers, _body): func _on_HTTPRequest2_request_completed(_result, _response_code, _headers, body):
# Need to find a way to load .txt file contents from a URL into a label. This to show what the update changes are. var test_json_conv = JSON.new()
# var json = JSON.parse(body.get_string_from_utf8()) test_json_conv.parse(body.get_string_from_utf8())
# update_text = str(json.result) var json = test_json_conv.get_data()
pass global_ints.update_text = json
func refresh_descriptors(): func refresh_descriptors():
@ -85,6 +89,7 @@ func refresh_descriptors():
$"%5Explanation".text = global_ints.five_explanation $"%5Explanation".text = global_ints.five_explanation
$"%5ExplanationE".text = $"%5Explanation".text $"%5ExplanationE".text = $"%5Explanation".text
func set_manual_url(): func set_manual_url():
if TranslationServer.get_locale() != "nl": if TranslationServer.get_locale() != "nl":
print("We're not Dutch") print("We're not Dutch")
@ -93,6 +98,7 @@ func set_manual_url():
print("We're Dutch") print("We're Dutch")
global_ints.manual_url = "https://www.lerenleukermaken.nl/" global_ints.manual_url = "https://www.lerenleukermaken.nl/"
func _ready(): func _ready():
DisplayServer.window_set_min_size(Vector2i(1280, 720)) DisplayServer.window_set_min_size(Vector2i(1280, 720))
minute_label.text = str(global_ints.observation_minutes) minute_label.text = str(global_ints.observation_minutes)
@ -114,6 +120,7 @@ func _ready():
check_for_updates() check_for_updates()
func _process(_delta): func _process(_delta):
check_time_var += 1 check_time_var += 1

1
godot/main_screen.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://rbmcgn3hetrs

View File

@ -1,15 +1,15 @@
[gd_scene load_steps=25 format=3 uid="uid://b1pk005at7x26"] [gd_scene load_steps=25 format=3 uid="uid://b1pk005at7x26"]
[ext_resource type="Theme" uid="uid://bki1nuccpiu3o" path="res://wb_theme.tres" id="1"] [ext_resource type="Theme" uid="uid://bki1nuccpiu3o" path="res://wb_theme.tres" id="1"]
[ext_resource type="Script" path="res://main_screen.gd" id="2"] [ext_resource type="Script" uid="uid://rbmcgn3hetrs" path="res://main_screen.gd" id="2"]
[ext_resource type="Script" path="res://NameChangePanel.gd" id="4"] [ext_resource type="Script" uid="uid://b4r3eb67qd13n" path="res://NameChangePanel.gd" id="4"]
[ext_resource type="FontFile" uid="uid://df4eo3bryf8la" path="res://Assets/fonts/noto_sans_display.ttf" id="5"] [ext_resource type="FontFile" uid="uid://df4eo3bryf8la" path="res://Assets/fonts/noto_sans_display.ttf" id="5"]
[ext_resource type="FontFile" uid="uid://darkh8o8rieli" path="res://Assets/fonts/noto_sans_display_bold.ttf" id="6"] [ext_resource type="FontFile" uid="uid://darkh8o8rieli" path="res://Assets/fonts/noto_sans_display_bold.ttf" id="6"]
[ext_resource type="Script" path="res://ObservationWindow.gd" id="7"] [ext_resource type="Script" uid="uid://hff4wu52flpd" path="res://ObservationWindow.gd" id="7"]
[ext_resource type="Script" path="res://EditScreen.gd" id="8"] [ext_resource type="Script" uid="uid://psov4nxn77wr" path="res://EditScreen.gd" id="8"]
[ext_resource type="Script" path="res://Results.gd" id="9"] [ext_resource type="Script" uid="uid://dhhlom5skgqeq" path="res://Results.gd" id="9"]
[ext_resource type="Script" path="res://TimerBar.gd" id="10"] [ext_resource type="Script" uid="uid://dflvmgvxwqrrf" path="res://TimerBar.gd" id="10"]
[ext_resource type="Script" path="res://ProgressBar.gd" id="11"] [ext_resource type="Script" uid="uid://t1pvqg6e78j" path="res://ProgressBar.gd" id="11"]
[ext_resource type="Texture2D" uid="uid://yf4ormoh8hes" path="res://Assets/icons/main_icon.png" id="12"] [ext_resource type="Texture2D" uid="uid://yf4ormoh8hes" path="res://Assets/icons/main_icon.png" id="12"]
[ext_resource type="Texture2D" uid="uid://lafpc8rl5lg0" path="res://Assets/icons/noun-input-field-104354.svg" id="12_vtqql"] [ext_resource type="Texture2D" uid="uid://lafpc8rl5lg0" path="res://Assets/icons/noun-input-field-104354.svg" id="12_vtqql"]

View File

@ -15,7 +15,7 @@ config/name_localized={
"nl": "Tijdsteekproef Formulier" "nl": "Tijdsteekproef Formulier"
} }
run/main_scene="res://main_screen.tscn" run/main_scene="res://main_screen.tscn"
config/features=PackedStringArray("4.3") config/features=PackedStringArray("4.4")
run/low_processor_mode=true run/low_processor_mode=true
boot_splash/bg_color=Color(0.952941, 0.933333, 0.847059, 1) boot_splash/bg_color=Color(0.952941, 0.933333, 0.847059, 1)
boot_splash/image="res://Assets/icons/main_icon.png" boot_splash/image="res://Assets/icons/main_icon.png"
@ -31,7 +31,6 @@ GlobalInts="*res://global_ints.gd"
window/size/viewport_width=1280 window/size/viewport_width=1280
window/size/viewport_height=720 window/size/viewport_height=720
window/size/borderless=true
window/stretch/mode="canvas_items" window/stretch/mode="canvas_items"
window/stretch/aspect="expand" window/stretch/aspect="expand"