Revert "first attempt at converting to Godot 4"

This reverts commit b11d28d574.
This commit is contained in:
Jaap Marsman 2023-03-29 08:59:51 +08:00
parent b11d28d574
commit d9eae61efa
14 changed files with 788 additions and 462 deletions

2
.gitignore vendored
View File

@ -8,8 +8,6 @@
export.cfg
export_presets.cfg
*.import
.godot/
godot/.godot/
# Imported translations (automatically generated from CSV files)
*.translation

View File

@ -1,8 +1,8 @@
extends CanvasLayer
@onready var gi = $"/root/GlobalInts"
@onready var global_ints = gi
@onready var main_window = $"../../AppWindow"
onready var gi = $"/root/GlobalInts"
onready var global_ints = gi
onready var main_window = $"../../AppWindow"
func _ready():
pass # Replace with function body.

View File

@ -1,7 +1,7 @@
extends Panel
@onready var global_ints = $"/root/GlobalInts"
onready var global_ints = $"/root/GlobalInts"
func _on_OkButton_pressed():

View File

@ -1,7 +1,7 @@
extends CanvasLayer
@onready var global_ints = $"/root/GlobalInts"
onready var global_ints = $"/root/GlobalInts"
var time_lefts : int

View File

@ -1,7 +1,7 @@
extends ProgressBar
@onready var global_ints = $"/root/GlobalInts"
onready var global_ints = $"/root/GlobalInts"
func _ready():

View File

@ -1,7 +1,7 @@
extends CanvasLayer
@onready var global_ints = $"/root/GlobalInts"
onready var global_ints = $"/root/GlobalInts"
var js_callback = JavaScript.create_callback(self, "load_handler");
var js_interface;

View File

@ -1,7 +1,7 @@
extends ProgressBar
@onready var global_ints = $"/root/GlobalInts"
onready var global_ints = $"/root/GlobalInts"
var time_lefts : int

View File

@ -48,7 +48,7 @@ func load_image():
js_interface.upload(js_callback);
await self.read_completed
yield(self, "read_completed")
var imageType = js_interface.fileType;
var imageData = JavaScript.eval("_HTML5FileExchange.result", true) # interface doesn't work as expected for some reason

View File

@ -1,4 +1,4 @@
@tool
tool
extends EditorPlugin

View File

@ -1,7 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=3 uid="uid://jbihewyaxy2u"]
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="Sky" id="1"]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
sky = SubResource("1")
background_sky = SubResource( 1 )

View File

@ -10,9 +10,9 @@ var update_text_url = "https://raw.githubusercontent.com/hobbesjaap/time-samplin
var update_text : String
@onready var date_time_display = $"%CurrentTime"
@onready var global_ints = $"/root/GlobalInts"
@onready var minute_label = $"StartScreen/InstructionPanel/MinuteBox/MinuteLabel"
onready var date_time_display = $"%CurrentTime"
onready var global_ints = $"/root/GlobalInts"
onready var minute_label = $"StartScreen/InstructionPanel/MinuteBox/MinuteLabel"
func check_for_updates():
@ -26,9 +26,7 @@ func check_for_updates():
func _on_HTTPRequest_request_completed(_result, _response_code, _headers, body):
var test_json_conv = JSON.new()
test_json_conv.parse(body.get_string_from_utf8())
var json = test_json_conv.get_data()
var json = JSON.parse(body.get_string_from_utf8())
global_ints.web_release_version = json.result
if global_ints.web_release_version > global_ints.release_version:
print("There's an update!")
@ -39,9 +37,7 @@ func _on_HTTPRequest_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()
test_json_conv.parse(body.get_string_from_utf8())
# var json = test_json_conv.get_data()
# var json = JSON.parse(body.get_string_from_utf8())
# update_text = str(json.result)
pass

File diff suppressed because it is too large Load Diff

View File

@ -6,16 +6,15 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
config_version=4
[application]
config/name="Time Sampling Form"
run/main_scene="res://main_screen.tscn"
config/features=PackedStringArray("4.0")
run/low_processor_mode=true
boot_splash/bg_color=Color(0.952941, 0.933333, 0.847059, 1)
boot_splash/image="res://Assets/icons/main_icon.png"
boot_splash/bg_color=Color( 0.952941, 0.933333, 0.847059, 1 )
config/icon="res://Assets/icons/main_icon.png"
config/macos_native_icon="res://Assets/icons/main_icon.icns"
config/windows_native_icon="res://Assets/icons/icon.ico"
@ -27,13 +26,14 @@ HTML5File="*res://addons/HTML5FileExchange/HTML5FileExchange.gd"
[display]
window/size/viewport_width=1280
window/size/viewport_height=720
window/size/width=1280
window/size/height=720
window/stretch/mode="2d"
window/stretch/aspect="keep"
[editor_plugins]
enabled=PackedStringArray("res://addons/HTML5FileExchange/plugin.cfg")
enabled=PoolStringArray( "res://addons/HTML5FileExchange/plugin.cfg" )
[gui]
@ -45,7 +45,7 @@ common/enable_pause_aware_picking=true
[rendering]
environment/defaults/default_environment="res://default_env.tres"
quality/intended_usage/framebuffer_allocation=0
quality/intended_usage/framebuffer_allocation.mobile=0
2d/snapping/use_gpu_pixel_snap=true
environment/default_environment="res://default_env.tres"

View File

@ -1,80 +1,56 @@
[gd_resource type="Theme" load_steps=16 format=3 uid="uid://cft2814mm2aav"]
[gd_resource type="Theme" load_steps=16 format=2]
[ext_resource type="FontFile" uid="uid://pimhoja8acya" path="res://Assets/fonts/noto_sans_display_bold.ttf" id="1"]
[ext_resource type="FontFile" uid="uid://c21retrvbsple" path="res://Assets/fonts/noto_sans_display.ttf" id="2"]
[ext_resource path="res://Assets/fonts/noto_sans_display_bold.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://Assets/fonts/noto_sans_display.ttf" type="DynamicFontData" id=2]
[sub_resource type="FontFile" id="1"]
fallbacks = Array[Font]([ExtResource("1")])
face_index = null
embolden = null
transform = null
cache/0/16/0/ascent = 0.0
cache/0/16/0/descent = 0.0
cache/0/16/0/underline_position = 0.0
cache/0/16/0/underline_thickness = 0.0
cache/0/16/0/scale = 1.0
cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0)
[sub_resource type="DynamicFont" id=1]
size = 24
font_data = ExtResource( 1 )
[sub_resource type="StyleBoxFlat" id="4"]
[sub_resource type="StyleBoxFlat" id=4]
bg_color = Color( 0.207843, 0.219608, 0.317647, 1 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="5"]
[sub_resource type="StyleBoxFlat" id=5]
bg_color = Color( 0.862745, 0.435294, 0.329412, 1 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="6"]
[sub_resource type="StyleBoxFlat" id=6]
bg_color = Color( 0.941176, 0.772549, 0.517647, 1 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="2"]
[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 0.862745, 0.435294, 0.329412, 1 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="7"]
[sub_resource type="StyleBoxFlat" id=7]
bg_color = Color( 0.941176, 0.772549, 0.517647, 1 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="FontFile" id="3"]
fallbacks = Array[Font]([ExtResource("2")])
face_index = null
embolden = null
transform = null
cache/0/16/0/ascent = 0.0
cache/0/16/0/descent = 0.0
cache/0/16/0/underline_position = 0.0
cache/0/16/0/underline_thickness = 0.0
cache/0/16/0/scale = 1.0
cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0)
[sub_resource type="DynamicFont" id=3]
size = 24
font_data = ExtResource( 2 )
[sub_resource type="FontFile" id="8"]
fallbacks = Array[Font]([ExtResource("2")])
face_index = null
embolden = null
transform = null
cache/0/16/0/ascent = 0.0
cache/0/16/0/descent = 0.0
cache/0/16/0/underline_position = 0.0
cache/0/16/0/underline_thickness = 0.0
cache/0/16/0/scale = 1.0
cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0)
[sub_resource type="DynamicFont" id=8]
size = 24
font_data = ExtResource( 2 )
[sub_resource type="StyleBoxFlat" id="9"]
[sub_resource type="StyleBoxFlat" id=9]
content_margin_left = 15.0
content_margin_right = 5.0
bg_color = Color( 0.207843, 0.219608, 0.317647, 1 )
@ -83,7 +59,7 @@ corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="11"]
[sub_resource type="StyleBoxFlat" id=11]
bg_color = Color( 0.952941, 0.933333, 0.847059, 1 )
border_width_left = 2
border_width_top = 2
@ -95,16 +71,16 @@ corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxEmpty" id="12"]
[sub_resource type="StyleBoxEmpty" id=12]
[sub_resource type="StyleBoxFlat" id="13"]
[sub_resource type="StyleBoxFlat" id=13]
bg_color = Color( 0.862745, 0.435294, 0.329412, 1 )
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="StyleBoxFlat" id="14"]
[sub_resource type="StyleBoxFlat" id=14]
bg_color = Color( 0.941176, 0.772549, 0.517647, 1 )
corner_radius_top_left = 5
corner_radius_top_right = 5
@ -112,17 +88,17 @@ corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[resource]
Button/fonts/font = SubResource("1")
Button/styles/disabled = SubResource("4")
Button/styles/focus = SubResource("5")
Button/styles/hover = SubResource("6")
Button/styles/normal = SubResource("2")
Button/styles/pressed = SubResource("7")
Button/fonts/font = SubResource( 1 )
Button/styles/disabled = SubResource( 4 )
Button/styles/focus = SubResource( 5 )
Button/styles/hover = SubResource( 6 )
Button/styles/normal = SubResource( 2 )
Button/styles/pressed = SubResource( 7 )
Label/colors/font_color = Color( 0, 0, 0, 1 )
Label/fonts/font = SubResource("3")
LineEdit/fonts/font = SubResource("8")
LineEdit/styles/normal = SubResource("9")
Panel/styles/panel = SubResource("11")
PanelContainer/styles/panel = SubResource("12")
ProgressBar/styles/bg = SubResource("13")
ProgressBar/styles/fg = SubResource("14")
Label/fonts/font = SubResource( 3 )
LineEdit/fonts/font = SubResource( 8 )
LineEdit/styles/normal = SubResource( 9 )
Panel/styles/panel = SubResource( 11 )
PanelContainer/styles/panel = SubResource( 12 )
ProgressBar/styles/bg = SubResource( 13 )
ProgressBar/styles/fg = SubResource( 14 )