From 793a8939c4f721844c276a3d49293c23c902c8d3 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sun, 26 Mar 2023 09:22:03 -0400 Subject: Add automated git release info retrieval on export Makes debug easier to see and handle Add commit hash label to MainMenu Add click-copyable tag, commit hash, and checksum to main menu Rename VersionChecksumBox to ReleaseInfoBox Move ReleaseInfoBox to separate scene and script Add GIT_INFO.gd for generic project running Add openvic2-plugin addon for handling export plugin Replaces GIT_INFO.gd on export Setup build workflow to retrieve commit hash, tag, and release --- game/src/MainMenu/ReleaseInfoBox.gd | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 game/src/MainMenu/ReleaseInfoBox.gd (limited to 'game/src/MainMenu/ReleaseInfoBox.gd') diff --git a/game/src/MainMenu/ReleaseInfoBox.gd b/game/src/MainMenu/ReleaseInfoBox.gd new file mode 100644 index 0000000..48686f3 --- /dev/null +++ b/game/src/MainMenu/ReleaseInfoBox.gd @@ -0,0 +1,31 @@ +extends HBoxContainer + +@export +var _version_label : Button + +@export +var _commit_label : Button + +@export +var _checksum_label : Button + +# REQUIREMENTS: +# * UIFUN-97 +func _ready(): + _version_label.text = _GIT_INFO_.release_name + _version_label.tooltip_text = _GIT_INFO_.tag + _commit_label.text = _GIT_INFO_.short_hash + _commit_label.tooltip_text = _GIT_INFO_.commit_hash + # UI-111 + _checksum_label.tooltip_text = "Checksum " + Checksum.get_checksum_text() + _checksum_label.text = "(" + Checksum.get_checksum_text().substr(0, 4) + ")" + + +func _on_version_label_pressed(): + DisplayServer.clipboard_set(_GIT_INFO_.tag) + +func _on_commit_label_pressed(): + DisplayServer.clipboard_set(_GIT_INFO_.commit_hash) + +func _on_checksum_label_pressed(): + DisplayServer.clipboard_set(Checksum.get_checksum_text()) -- cgit v1.2.3-56-ga3b1