diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-06-04 02:17:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-04 02:17:28 +0200 |
commit | 3236f51d700674aee6ee6572109ffb3d5fa5fed2 (patch) | |
tree | b898150a8a45e7c0d814459e7f12f39429acefeb /game/src/Game/Menu/MainMenu/ReleaseInfoBox.gd | |
parent | 73e29d02e48739aba5ca5db1b9575c67e795400f (diff) | |
parent | b98166b28c47cccff731d30959b8250fb27ff408 (diff) |
Merge pull request #130 from Spartan322/organize/godot-project
Diffstat (limited to 'game/src/Game/Menu/MainMenu/ReleaseInfoBox.gd')
-rw-r--r-- | game/src/Game/Menu/MainMenu/ReleaseInfoBox.gd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/game/src/Game/Menu/MainMenu/ReleaseInfoBox.gd b/game/src/Game/Menu/MainMenu/ReleaseInfoBox.gd new file mode 100644 index 0000000..e363162 --- /dev/null +++ b/game/src/Game/Menu/MainMenu/ReleaseInfoBox.gd @@ -0,0 +1,41 @@ +extends HBoxContainer + +@export +var _version_label : Button + +@export +var _commit_label : Button + +@export +var _checksum_label : Button + +var _checksum : String = "????" + +# 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 = Checksum.get_checksum_text() + _update_checksum_label_text() + +func _notification(what : int): + match what: + NOTIFICATION_TRANSLATION_CHANGED: + _update_checksum_label_text() + +func _update_checksum_label_text() -> void: + _checksum_label.tooltip_text = tr("MAINMENU_CHECKSUM").format({ "checksum": _checksum }) + _checksum_label.text = "(%s)" % _checksum.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) |