aboutsummaryrefslogtreecommitdiff
path: root/game/src/MainMenu
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-03-30 15:04:58 +0200
committer GitHub <noreply@github.com>2023-03-30 15:04:58 +0200
commit3384b21177a160f7192a2e4877eea3b29880bf4e (patch)
treedb9c9a37a187e15ef494a700f8afe5d65c3a8b78 /game/src/MainMenu
parent8f213935bdea2400b6809f9d5db45dde3416dedc (diff)
Added Localisation (#77)
* Added Localisation * Removed `.gdignore`s. * Localisation dir path and Locale name cleanup * Incomplete entry warnings + README
Diffstat (limited to 'game/src/MainMenu')
-rw-r--r--game/src/MainMenu/MainMenu.tscn14
-rw-r--r--game/src/MainMenu/ReleaseInfoBox.gd16
-rw-r--r--game/src/MainMenu/ReleaseInfoBox.tscn10
3 files changed, 25 insertions, 15 deletions
diff --git a/game/src/MainMenu/MainMenu.tscn b/game/src/MainMenu/MainMenu.tscn
index 10bf526..5fb6ca9 100644
--- a/game/src/MainMenu/MainMenu.tscn
+++ b/game/src/MainMenu/MainMenu.tscn
@@ -34,7 +34,7 @@ layout_mode = 2
size_flags_vertical = 6
size_flags_stretch_ratio = 1.5
theme_type_variation = &"TitleLabel"
-text = "OpenVic2"
+text = "MAINMENU_TITLE"
horizontal_alignment = 1
vertical_alignment = 1
@@ -60,7 +60,7 @@ focus_neighbor_right = NodePath("../ContinueButton")
focus_next = NodePath("../ContinueButton")
focus_previous = NodePath("../ExitButton")
theme_type_variation = &"TitleButton"
-text = "New Game"
+text = "MAINMENU_NEW_GAME"
clip_text = true
[node name="ContinueButton" type="Button" parent="Panel/VBox/Margin/ButtonList"]
@@ -72,7 +72,7 @@ focus_next = NodePath("../MultiplayerButton")
focus_previous = NodePath("../NewGameButton")
theme_type_variation = &"TitleButton"
disabled = true
-text = "Continue"
+text = "MAINMENU_CONTINUE"
clip_text = true
[node name="MultiplayerButton" type="Button" parent="Panel/VBox/Margin/ButtonList"]
@@ -84,7 +84,7 @@ focus_neighbor_right = NodePath("../OptionsButton")
focus_next = NodePath("../OptionsButton")
focus_previous = NodePath("../ContinueButton")
theme_type_variation = &"TitleButton"
-text = "Multiplayer"
+text = "MAINMENU_MULTIPLAYER"
clip_text = true
[node name="OptionsButton" type="Button" parent="Panel/VBox/Margin/ButtonList"]
@@ -96,7 +96,7 @@ focus_neighbor_right = NodePath("../CreditsButton")
focus_next = NodePath("../CreditsButton")
focus_previous = NodePath("../MultiplayerButton")
theme_type_variation = &"TitleButton"
-text = "Options"
+text = "MAINMENU_OPTIONS"
clip_text = true
[node name="CreditsButton" type="Button" parent="Panel/VBox/Margin/ButtonList"]
@@ -108,7 +108,7 @@ focus_neighbor_right = NodePath("../ExitButton")
focus_next = NodePath("../ExitButton")
focus_previous = NodePath("../OptionsButton")
theme_type_variation = &"TitleButton"
-text = "Credits"
+text = "MAINMENU_CREDITS"
clip_text = true
[node name="ExitButton" type="Button" parent="Panel/VBox/Margin/ButtonList"]
@@ -120,7 +120,7 @@ focus_neighbor_right = NodePath("../NewGameButton")
focus_next = NodePath("../NewGameButton")
focus_previous = NodePath("../OptionsButton")
theme_type_variation = &"TitleButton"
-text = "Exit"
+text = "MAINMENU_EXIT"
clip_text = true
[node name="BottomSpace" type="Control" parent="Panel/VBox"]
diff --git a/game/src/MainMenu/ReleaseInfoBox.gd b/game/src/MainMenu/ReleaseInfoBox.gd
index 48686f3..ca03af3 100644
--- a/game/src/MainMenu/ReleaseInfoBox.gd
+++ b/game/src/MainMenu/ReleaseInfoBox.gd
@@ -9,6 +9,8 @@ var _commit_label : Button
@export
var _checksum_label : Button
+var _checksum : String = "????"
+
# REQUIREMENTS:
# * UIFUN-97
func _ready():
@@ -17,9 +19,17 @@ func _ready():
_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) + ")"
+ _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") % _checksum
+ _checksum_label.text = "(%s)" % _checksum.substr(0, 4)
func _on_version_label_pressed():
DisplayServer.clipboard_set(_GIT_INFO_.tag)
@@ -28,4 +38,4 @@ func _on_commit_label_pressed():
DisplayServer.clipboard_set(_GIT_INFO_.commit_hash)
func _on_checksum_label_pressed():
- DisplayServer.clipboard_set(Checksum.get_checksum_text())
+ DisplayServer.clipboard_set(_checksum)
diff --git a/game/src/MainMenu/ReleaseInfoBox.tscn b/game/src/MainMenu/ReleaseInfoBox.tscn
index d15ae31..821982b 100644
--- a/game/src/MainMenu/ReleaseInfoBox.tscn
+++ b/game/src/MainMenu/ReleaseInfoBox.tscn
@@ -11,25 +11,25 @@ _checksum_label = NodePath("ChecksumLabel")
[node name="VersionLabel" type="Button" parent="."]
layout_mode = 2
-tooltip_text = "OpenVic2 v0.01 \"Primum Mobile\""
+tooltip_text = "VERSION_MISSING"
theme_type_variation = &"VersionLabel"
-text = "v0.01"
+text = "VERSION_MISSING"
flat = true
alignment = 0
[node name="CommitLabel" type="Button" parent="."]
layout_mode = 2
theme_type_variation = &"CommitLabel"
-text = "ffffffff"
+text = "????????"
flat = true
alignment = 0
[node name="ChecksumLabel" type="Button" parent="."]
editor_description = "UI-111"
layout_mode = 2
-tooltip_text = "Checksum 00000000"
+tooltip_text = "CHECKSUM_MISSING"
theme_type_variation = &"ChecksumLabel"
-text = "(0000)"
+text = "(????)"
flat = true
alignment = 0