Add localization support for achievements: implement language-specific titles and update UI components

This commit is contained in:
Kirill
2026-10-18 20:32:20 +03:00
parent e1782c7b10
commit 2aced0c61a
6 changed files with 42 additions and 31 deletions
@@ -2,6 +2,10 @@ extends Node
## Player-wide achievement progress and the shared in-game notification queue.
const E = preload("res://world/owniverse/math/exact.gd")
const ITEM = preload("res://ui/achievements/achievement_item.tscn")
const TITLES = {
"en": preload("res://ui/achievements/achievements.en.png"),
"ru": preload("res://ui/achievements/achievements.ru.png"),
}
var progress_path: String = "user://achievements.cfg"
const HOLD_SECONDS = 3.0
const FADE_SECONDS = 0.3
@@ -158,6 +162,8 @@ func _display_event(event: Dictionary) -> void:
panel.show()
func _rebuild_list() -> void:
var title: TextureRect = stage.get_node_or_null("Achievements/Header/Title")
if title != null: title.texture = TITLES[locale]
var unlocked := 0
var position := 1
for id in definitions:
+7 -5
View File
@@ -11,7 +11,7 @@
[ext_resource type="Texture2D" uid="uid://bmp7e6lmtaex0" path="res://ui/achievements/icons/10g.png" id="9_3xyrb"]
[node name="AchievementItem" type="Control" unique_id=1273881744]
custom_minimum_size = Vector2(0, 128)
custom_minimum_size = Vector2(1080, 128)
layout_mode = 3
anchors_preset = 0
size_flags_horizontal = 3
@@ -19,9 +19,9 @@ script = ExtResource("1_w8f20")
[node name="Row" type="HBoxContainer" parent="." unique_id=2025386077]
layout_mode = 0
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_constants/separation = 16
[node name="Icon1c" type="TextureRect" parent="Row" unique_id=2146478339]
visible = false
@@ -74,8 +74,10 @@ texture = ExtResource("9_3xyrb")
[node name="Label" type="RichTextLabel" parent="Row" unique_id=230945261]
layout_mode = 2
size_flags_horizontal = 3
bbcode_enabled = true
fit_content = true
scroll_active = false
theme_override_font_sizes/normal_font_size = 30
theme_override_font_sizes/bold_font_size = 30
bbcode_enabled = true
text = "123"
fit_content = true
scroll_active = false
vertical_alignment = 1
Binary file not shown.
Binary file not shown.