Skip to content

Commit 861feed

Browse files
authored
Merge pull request #338 from Maaack/add-auto-update-warning
Adds warning message to update window
2 parents 81a652b + 44aecb0 commit 861feed

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

addons/maaacks_game_template/installer/update_plugin.gd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const PLUGIN_TEMP_ZIP_PATH := "res://%s_%s_update.zip"
3333
@onready var _success_dialog : AcceptDialog = $SuccessDialog
3434
@onready var _release_label : RichTextLabel = %ReleaseLabel
3535
@onready var _update_label : Label = %UpdateLabel
36+
@onready var _warning_message_button : LinkButton = %WarningMessageButton
37+
@onready var _warning_message_label : Label = %WarningMessageLabel
3638
@onready var _release_notes_button : LinkButton = %ReleaseNotesButton
3739
@onready var _release_notes_panel : Panel = %ReleaseNotesPanel
3840
@onready var _stage_label : Label = %StageLabel
@@ -124,6 +126,10 @@ func _on_update_confirmation_dialog_confirmed() -> void:
124126
_download_and_extract_node.run()
125127
_installing_dialog.show()
126128

129+
func _on_warning_message_button_pressed():
130+
_warning_message_label.show()
131+
_warning_message_button.hide()
132+
127133
func _on_release_notes_button_pressed() -> void:
128134
_release_notes_panel.show()
129135
_release_notes_button.hide()

addons/maaacks_game_template/installer/update_plugin.tscn

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ Update to v0.0.0?"
4747
[node name="HSeparator" type="HSeparator" parent="UpdateConfirmationDialog/MarginContainer/VBoxContainer"]
4848
layout_mode = 2
4949

50+
[node name="WarningMessageButton" type="LinkButton" parent="UpdateConfirmationDialog/MarginContainer/VBoxContainer"]
51+
unique_name_in_owner = true
52+
layout_mode = 2
53+
text = "Warning About Updating"
54+
55+
[node name="WarningMessageLabel" type="Label" parent="UpdateConfirmationDialog/MarginContainer/VBoxContainer"]
56+
unique_name_in_owner = true
57+
visible = false
58+
custom_minimum_size = Vector2(624, 205)
59+
layout_mode = 2
60+
text = "Not all updates are backwards compatible!
61+
62+
Updating can cause issues with previously copied examples. It is recommended to delete any copied example files before starting an update, if it is an option. Otherwise, pay attention to the Release Notes for an idea for how changes may impact your project.
63+
64+
Lastly, save your work and proceed with caution."
65+
autowrap_mode = 3
66+
5067
[node name="ReleaseNotesButton" type="LinkButton" parent="UpdateConfirmationDialog/MarginContainer/VBoxContainer"]
5168
unique_name_in_owner = true
5269
layout_mode = 2
@@ -121,6 +138,7 @@ dialog_text = "%s updated to v%s."
121138
[connection signal="zip_saved" from="DownloadAndExtract" to="." method="_on_download_and_extract_zip_saved"]
122139
[connection signal="canceled" from="UpdateConfirmationDialog" to="." method="_on_update_confirmation_dialog_canceled"]
123140
[connection signal="confirmed" from="UpdateConfirmationDialog" to="." method="_on_update_confirmation_dialog_confirmed"]
141+
[connection signal="pressed" from="UpdateConfirmationDialog/MarginContainer/VBoxContainer/WarningMessageButton" to="." method="_on_warning_message_button_pressed"]
124142
[connection signal="pressed" from="UpdateConfirmationDialog/MarginContainer/VBoxContainer/ReleaseNotesButton" to="." method="_on_release_notes_button_pressed"]
125143
[connection signal="canceled" from="ErrorDialog" to="." method="_on_error_dialog_canceled"]
126144
[connection signal="confirmed" from="ErrorDialog" to="." method="_on_error_dialog_confirmed"]

0 commit comments

Comments
 (0)