From e4a4304ea021a2a5e25966fe0ef10180df47e5c4 Mon Sep 17 00:00:00 2001 From: Jaap Marsman Date: Sun, 6 Nov 2022 19:50:21 +0800 Subject: [PATCH] Continuing work on updater info --- godot/main_screen.gd | 3 ++ godot/main_screen.tscn | 75 ++++++++++++++++++++++++++++++++++++++++++ updater/update_text.md | 5 +++ 3 files changed, 83 insertions(+) create mode 100644 updater/update_text.md diff --git a/godot/main_screen.gd b/godot/main_screen.gd index 2269e0c..7e5dab8 100644 --- a/godot/main_screen.gd +++ b/godot/main_screen.gd @@ -25,6 +25,8 @@ func _on_HTTPRequest_request_completed(_result, _response_code, _headers, body): global_ints.web_release_version = json.result if global_ints.web_release_version > global_ints.release_version: print("There's an update!") + $"%UpdatePanel".visible = true + # elif global_ints.web_release_version == global_ints.release_version: # print("There is no update!") @@ -71,6 +73,7 @@ func _ready(): $"ObservationWindow".visible = false $"Results".visible = false $"EditScreen".visible = false + $"%UpdatePanel".visible = false global_ints.date = OS.get_date() global_ints.ddmmyyyy = str(global_ints.date.day, "-", global_ints.date.month, "-", global_ints.date.year) diff --git a/godot/main_screen.tscn b/godot/main_screen.tscn index 4e69f53..f26694c 100644 --- a/godot/main_screen.tscn +++ b/godot/main_screen.tscn @@ -573,6 +573,79 @@ margin_bottom = 516.0 theme = ExtResource( 1 ) text = "OK" +[node name="UpdatePanel" type="Panel" parent="StartScreen"] +unique_name_in_owner = true +visible = false +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -640.0 +margin_top = -171.0 +margin_right = 640.0 +margin_bottom = 359.0 +custom_styles/panel = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="Update" type="Label" parent="StartScreen/UpdatePanel"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -172.5 +margin_top = -250.0 +margin_right = 172.5 +margin_bottom = -200.0 +custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_fonts/font = SubResource( 6 ) +text = "An Update is available!" +align = 1 + +[node name="BottomButtons" type="HBoxContainer" parent="StartScreen/UpdatePanel"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -500.0 +margin_top = 180.0 +margin_right = 500.0 +margin_bottom = 240.0 + +[node name="GoToUpdate" type="Button" parent="StartScreen/UpdatePanel/BottomButtons"] +margin_right = 498.0 +margin_bottom = 60.0 +size_flags_horizontal = 3 +theme = ExtResource( 1 ) +text = "Download Update" + +[node name="IgnoreUpdate" type="Button" parent="StartScreen/UpdatePanel/BottomButtons"] +margin_left = 502.0 +margin_right = 1000.0 +margin_bottom = 60.0 +size_flags_horizontal = 3 +theme = ExtResource( 1 ) +text = "Ignore Update" + +[node name="UpdateIntro" type="Label" parent="StartScreen/UpdatePanel"] +margin_left = 33.0 +margin_top = 107.0 +margin_right = 1249.0 +margin_bottom = 148.0 +theme = ExtResource( 1 ) +text = "You are currently using version XX. The latest version available is XX. Version changes are:" +autowrap = true + +[node name="UpdateText" type="Label" parent="StartScreen/UpdatePanel"] +margin_left = 33.0 +margin_top = 146.0 +margin_right = 1249.0 +margin_bottom = 432.0 +theme = ExtResource( 1 ) +text = "text" +autowrap = true + [node name="EditScreen" type="CanvasLayer" parent="."] unique_name_in_owner = true visible = false @@ -1205,6 +1278,8 @@ text = "Item5" [connection signal="pressed" from="StartScreen/InstructionPanel/BottomButtons/Start" to="." method="_on_Start_pressed"] [connection signal="pressed" from="StartScreen/NameChangePanel/NameContainer/OkButton" to="StartScreen/NameChangePanel" method="_on_OkButton_pressed"] [connection signal="pressed" from="StartScreen/InstructionScreen/InstructionContainer/InsOkButton" to="." method="_on_InsOkButton_pressed"] +[connection signal="pressed" from="StartScreen/UpdatePanel/BottomButtons/GoToUpdate" to="." method="_on_PupilName_pressed"] +[connection signal="pressed" from="StartScreen/UpdatePanel/BottomButtons/IgnoreUpdate" to="." method="_on_Start_pressed"] [connection signal="pressed" from="EditScreen/Panel/CancelButton" to="EditScreen" method="_on_CancelButton_pressed"] [connection signal="pressed" from="EditScreen/Panel/OKButton" to="EditScreen" method="_on_OKButton_pressed"] [connection signal="pressed" from="EditScreen/Panel/ClearAll" to="EditScreen" method="_on_ClearAll_pressed"] diff --git a/updater/update_text.md b/updater/update_text.md new file mode 100644 index 0000000..7420736 --- /dev/null +++ b/updater/update_text.md @@ -0,0 +1,5 @@ +This text is just a placeholder. + +- But I want to test if it works. +- Like this. +- Or this. \ No newline at end of file